Jump to content

Search the Community

Showing results for tags 'PHP'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 988 results

  1. Mudsaf

    mail() questions

    Im wondering how does this mail() function work. I got PHP script likewhile ($row = mysql_fetch_array($result2)) {mail($row['Sahkoposti'], 'New comment on websites', '$text');} 1. $row['Sahkoposti'] = Email2. 'Subject'3. text Im wondering does this email thing require SMTP service or some port open to work correctly.
  2. Mudsaf

    File Uploading Script

    Okay this is part of my file upload script what has been taken from tizag websites. Somehow this is giving me the error and $target_path = ../Materials/ if (isset($_GET['submit'])) {$target_path = $_GET['directory'];$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "File ". basename( $_FILES['uploadedfile']['name']). " has been sussefully added to websites.";} else { echo "There was error during upload, please check that filesize is not higer than 8MB.";echo $target_path;}}
  3. Hello everybody Im wondering how can you make page that displays every .jpg, .gif & .pdf files from directories on website table. Im not sure what coding language i have to use, but i think its mostly html. PHP & javascript code will be accepted too. Found solution after some research: http://www.brightcherry.co.uk/scribbles/php-list-all-files-in-a-directory/
  4. hey everyone :)I want make a tab use funtion java script , so every menu tap have form for input datamy problemo , when I doing input data the tab go to proses file inputI want when do input , stay at menu tab and dont move to file proces how for do it thjs befroe
  5. hey eryone I want do edit a menu select , ex: a menu selct Date , how to display data from db in the menu select it , Can help me Thask befpre
  6. Mudsaf

    [PHP Wiki]

    Okay, my problem is that i want text to appear at "table of contents" place on PHPWiki, but the text size should be normal size. At the moment i can only make "Headers 1 & 2" that appears in table of contents spot on "my" websites.
  7. Hello W3S... im having this error: (LOOK AT ATTACHED PICTURE...) and here is my shop.php code: include ("shop_undermenu.php");$catID = $_GET['cat_id'];if(!isset($catID)){$result = mysql_query ('SELECT * FROM `shop_cat` ORDER BY shop_cat_id ASC LIMIT 1');$row = mysql_fetch_assoc ($result);$catID = $row['shop_cat_id'];}$query = "SELECT * FROM shop_items WHERE FK_catID = ".$catID;$result = mysql_query($query); if(mysql_num_rows($result)>0){echo "<form action='' method='post'>";echo "<table class='shop_table_100'>";echo "<tr class='shop_tr_holder_css'>";echo "<td>Add</td>";echo "<td>Amount</td>";echo "<td>Product Name</td>";echo "<td>Price</td>";echo "<td>More Info</td>";echo "</tr>";while ($row = mysql_fetch_assoc($result)){echo "<tr>\n";echo "<td><input type='checkbox' name='check_addbox[".$row['item_id']."]' /></td>\n"; ////extra array...echo "<td><input type='text' name='amount[".$row['item_id']."]' size='1' value='1' /></td>\n"; //With extra array...echo "<td>".$row['item_name']."</td>\n";echo "<td>".$row['item_price']."</td>\n";echo "<td><a href='details.php'>Info</a></td>\n";echo "</tr>\n";}echo "</table>"; echo "<form action='' method='post'>";echo "<table class='shop_table_100'";echo "<tr>";echo "<td><input type='submit' name='add_item' id='submit' class='shop_add_submit_button' value='Update Cart' /></td>";echo "</tr>";echo "</table>";echo "</form>";}//Ending IF (Num_Rows...)else{echo "<form action='' method='post'>";echo "<table class='shop_table_100'>"; echo "<tr class='shop_tr_holder_css'>";echo "<td>ERROR!</td>";echo "</tr>"; echo "</table>";echo "</form>"; echo "<form action='' method='post'>";echo "<table class='shop_table_100'>"; echo "<tr>";echo "<td>There are no Products added yet.</td>";echo "</tr>"; echo "</table>";echo "</form>";} if(isset($_POST['add_item'])){if(!empty($_POST['check_addbox'])){ foreach($_POST['check_addbox'] as $p_id => $check) { $amount = $_POST['amount'][$p_id]; //Getting the Amount from the box... $_SESSION['cart'][$p_id] += $amount; //adding them to the session... header("location: shop.php"); }}} and that runs ok... the problem is in the shop_undermenu.php file i think... Code: <?php$under_query = "SELECT * FROM shop_cat";$under_result = mysql_query($under_query)or die(mysql_error());while($u_row = mysql_fetch_assoc($under_result)){echo "<a href='shop.php?cat_id=".$u_row['shop_cat_id']."'>".$u_row['shop_cat_name']."</a> ";}?> ideas on how to fix would be greate ... and note that im telling it to go to the First Category automaticly... but why its giving that error in the picture i dont know... i mean... i tried for fun to delete all of the SQL tables i had about the cat... (with a backup ofcourse...) but what i wish is that if there is no categories... but still products... and the products does not appear... then i wish just to show the error messeage that i was trying to like in the picture... ideas would be awsome... thanks W3S... Regards: rootKID -> Further information (in Details) can be given if this is not enough ...
  8. Hi all I have a MS Server 2008R2 set up with IIS7 In IIS I have set up an SMTP (with the IIS6 requirements) and the standard PHP that you get with it all. The SMTP server works. Reason we have to use a local SMTP server to interface with our actual mail server is because the external server requires TLS authentication and many smaller office scanning machines don't support it. I am able to send mail through the SMTP without issue, both from an office MFP and from a mail client like Outlook 2010. The PHP works too. I have it displaying PHP webpages and even going as far as accessing ODBC data resources. However, the two of them don't work together. I create a basic webpage that is as follows: <html><body> <?php if (mail("me@example.com","Test Subject","Test body")) {echo "success";} else {echo "failed";} ?></body><html> I also have the following in the PHP.ini I found in "C:\Program Files (x86)\PHP\v5.3\" [mail function]SMTP = localhostsmtp_port = 25sendmail_from = no-reply@example.com And yet, all I get is "failed" each time I have run the webpage. Anyone have any ideas on where I can get the PHP/SMTP/Other logs to give me more information? I have monitored the queue folder for the SMTP and it doesn't seem to even receive the mail from the PHP site.
  9. Mudsaf

    Problem with PHP

    Im selecting data from my database, but i want the image to be smaller in one place and higer in other place. So i got like mainpage what selects 1 from latest news & mainpage doesn't have that much space at "Width" as the image or video would require, but is it possible to make the "img/video" smaller before i get it from database. Example i want the code at mainpage to have like 200 width150 height News page should show the video as it has been posted to MySQL. Example here 600 width (The amount set when inserting the post)400 heigh (The amount set when inserting the post) This might be bit confusing but i can try explain again if some1 doesn't get my point.
  10. I wonder whether someone may be able to help me please. This script below is called upon a button click from one of my HTML pages and it's purpose is to delete images stored on my server and the associated child node from a XML file. <?phpif (!empty($_POST)) { $image = $_POST['image']; if (file_exists($image)) { unlink($image); } $doc = new DOMDocument; $doc->load('UploadedFiles/' . '1' . '/' . '1' . '/' . 'files.xml'); // iterate over all tags named <file> $list = $doc->getElementsByTagName('file'); foreach ($list as $domElement) { // check whether attribute 'source' equals $image if ($domElement->getAttribute('source') == $image) { // remove the node $domElement->parentNode->removeChild($domElement); } } echo $doc->saveXML();}?> The problem I'm having is that I can delete the physical image, but I'm unable to delete the node from the XML file. I know that the file path is correct because I've used a XPath 'search for' script and I can successfully see the contents of the file. So I know that this isn't the issue. In addition to the above, I've also tried the following: <?php if (!empty($_POST)) {$image = $_POST['image']; if (file_exists($image)) {unlink($image);}} $searchString = 'image'; $doc = new DOMDocument;$doc->preserveWhiteSpace = FALSE;$doc->load('UploadedFiles/' . '1' . '/' . '1' . '/' . 'files.xml'); $xPath = new DOMXPath($doc);$query = sprintf('//files[./source[contains(., "%s")]]', $searchString);foreach($xPath->query() as $node) {$node->parentNode->removeChild($node);}$doc->formatOutput = TRUE;echo $doc->saveXML();?> This is an extract of my XML file: <?xml version="1.0" encoding="utf-8" ?>- <files><file name="AC-0003749.jpg" source="AC-0003749.jpg" size="3873" originalname="AC-0003749.jpg" description="No description provided" userid="1" locationid="1" /></files> Unfortunately this doesn't delete the node either. I've been working on this for quite some time and I'm not really sure what to do next. i just wondered whether someone may be able to look at this please and let me know where I'm going wrong. Many thanks and regards
  11. I am developing the file locally with LAMPP and my source file is like this: <?php echo "The server is working"; ?><?php$file=fopen("file.txt", "r") or exit("Unable to open file!");?> In the same directory is a text file named file.txt and it has a line on text in it. The output however is only The server is working. Nothing else.
  12. Can you please provide Cake PHP tutorial in this website? Tutorials of this website are so simple that I want to have every tutorial related to PHP on this website only.
  13. I have some data in a flat file. These are the fields: nameaddressziplatlng A row of data might look something like: fishing hole #1, Catalina Island U.S., 90704, 33.3, 118.4 There are fifty rows of data. I am trying with PHP to encode this data into an XML file. The ultimate goal is that the data will be stored on the disk in XML format and when requested PHP will read the XML file and retrieve the data and put it into an array so I can encode the data in JSON and send it back off to JavaScript (AJAX). I'm very familiar with working with flat files and SQL however XML is a bit unfamiliar to me as of yet. How would this be accomplished? Good Evening W3Schools!
  14. At the top of my page, I have: <?php//connect to dbinclude "MyConnect.php";// $artist = $_GET['Mia'];?> Inside the "MyConnect" is: //get all of the photos$photoList = "";$artist = $_POST['artist'];$sql = mysql_query("SELECT * FROM $artist ORDER BY photoID DESC LIMIT 6");//check for photos$photoCount = mysql_num_rows($sql); if ($photoCount > 0){ while($row = mysql_fetch_array($sql)){ $photoID = $row["photoID"]; $photoName = $row["photoName"]; $photoList .= '<li class="thumb"> <a href="#"><img src="../images/mia/' . $photoName . '.jpg" alt="' . $photoName . '" width="100" height="100" /></a> </li>'; }}else{ $dynamicList = "There are no photos at this time!";} What I'm trying to do is, set $artist to equal Mia which will make FROM $artist into FROM Mia. I want to repeat this on more pages.
  15. hey friends, I have a problem with this, what happpenned with its Notice: Undefined index:, I use XAMP 17.7 , berfore I use XAMP1.7.1 the notice never appear , wht is wrong pls , help me thks mastah ..
  16. damju87

    PHP Loops

    How do I set this kind of loop? First, it fills the cell with the data from the database. <table border="1"><tr><td>Row 1, cell 1</td></tr></table> Then, if there is more data added into the database. <table border="1"><tr><td>Row 1, cell 1</td><td>Row 1, cell 2</td></tr></table> Here's where I want the loop to start. I want it to repeat the process when the row has two cells by creating a new row.
  17. Good day, I am quite new to web design with only 3 weeks experience and I ran into a problem that totally elude me. I am currently working on my website and I am stuck with my "Send" button. I can't apply the style from my CSS to my php button, it is supposed to be on the right side and look like the clear button, instead I get a plain rectangle box on the left side. [/left] The first part of the following code is to make a clear button. Here is the html part of the code:[/left] [/size][/color][/font][/left]<div class="alignright"><a href="#" class="link4" onClick="document.getElementById('contacts-form').reset()"><span><span>Effacer</span></span></a><span><span><input type="submit" class="link2" value="Envoyer" id="submit-button"/></span></span>[font="Arial, Helvetica, sans-serif"][color="#555555"][size=3] And here is the CSS code for both buttons, one in HTML and the other in php: [/size][/font][/color][/left][/size][/font][/color][/left].link2 {display:inline-block;color:#fff;font-size:15px;line-height:1.2em;text-decoration:none;background:url(http://gatesinnovation.com/GATES/Images/link2-bgd.gif) left top repeat-x;letter-spacing:-1px;text-transform:uppercase}.link2:hover {color:#336633}.link2 span {display:block;background:url(http://gatesinnovation.com/GATES/Images/link2-left.gif) no-repeat left top}.link2 span span {background:url(http://gatesinnovation.com/GATES/Images/link2-right.gif) no-repeat right top;padding:10px 22px}] .link4 {display:inline-block;color:#fff;font-size:15px;line-height:1.2em;text-decoration:none;background:url(http://gatesinnovation.com/GATES/Images/link4-bgd.gif) left top repeat-x;letter-spacing:-1px;text-transform:uppercase}.link4:hover {color:#336633}.link4 span {display:block;background:url(http://gatesinnovation.com/GATES/Images/link4-left.gif) no-repeat left top}.link4 span span {background:url(http://gatesinnovation.com/GATES/Images/link4-right.gif) no-repeat right top;padding:10px 22px} I am pretty sure that what is causing it is the missing in the php part, but I am unsure how to insert it in this code.If you need more info to be able to solve this I will gladly provide you with the information you request,here is the website dev link to see it in context: Contact pageThank you for your time.[/left]
  18. I've kind taught myself PHP whilst looking online for examples. I use classes, I just wonder if I'm setting up my classes the right way. Do you have to explicity give a class access to another class in the way I've done below?: $db = new dbConnectionMSSQL();$systemLog = new systemLog();$clubTickets = new clubTickets();$Customers = new Customers();$Events = new Events();$TicketOrders = new TicketOrders();$PlacesOfInterest = new PlacesOfInterest();$Tonight = new Tonight(); $clubTickets->db = $db;$clubTickets->Customers = $Customers;$clubTickets->Events = $Events;$clubTickets->PlacesOfInterest = $PlacesOfInterest;$clubTickets->TicketOrders = $TicketOrders;$clubTickets->Tonight = $Tonight; That's what I've been doing up until now. Is there a more efficient way to do it? Every time I create a new class, I need to copy the bold coce above for that class. Or is that just life in PHP?
  19. hello,I need help in my academic project. I need to transfer some data from one php script on one machine to that on another. I am using curl for that. I can use CURLOPT_POSTFIELDS for that but it does not transfer the control to second script. I want to use CURLOPT_FOLLOWLOCATION but how to use it i dont know. So please help me out with some code.this is what i tried.curl.php
  20. I'm trying to save a lot of time instead of editing the page everytime. Wouldn't it be easier to just change the information in the database, right? I've been searching for days on how to do it but having no luck. I will be very grateful for the help. Thank you. <table id="data"> <tr> <th scope="row">Occupation</th> <td>Singer</td> </tr> <tr> <th scope="row">Debut</th> <td>December 02, 2011</td> </tr> <tr> <th scope="row">Data of Birth</th> <td>February 13, 1990</td> </tr> <tr> <th scope="row">Record Label</th> <td>Ttakttaguri Entertainment</td> </tr> <tr> <th scope="row">Links</th> <td><a href="http://d2kr.com/hboard3/" target="_blank">Official</a>, <a href="http://blog.naver.com/agia0213">Naver Blog</a>, <a href="https://twitter.com/#!/agia0213">Twitter</a>, <a href="http://me2day.net/agia0213" target="_blank">Me2day</a></td> </tr></table>
  21. hello everyone, I've been working on a script that reads records out of database each record is a small array of questions(basically a survey system), per record a total score is assigned(this is the Javascript part) //echo the question list from the database$query_questions = mysql_query("SELECT * FROM `vraag`");while($result = mysql_fetch_array($query_questions)){//displaying the questionsecho "<br /><br /><b>";echo $result['header']. "</b><br />";echo $result['beschrijving']. "<br /><br />";echo $result['onderwerp']. "<br />"; //sneaky rogue values!$aantal = $result['aantal_vragen'];//this is a troublesome part of code as well I'll elaborate on this further down the postecho "<input type='hidden' id='number_of_questions' value=".$aantal." mousedown='calculate_score(this.value,0)'/>";$array = unserialize($result['vraag']);//the question list is stored in an array which I'll read out later//retrieve the content from the array foreach($array as $value){//below I created five radio elements because I want people to give each question a score from 1 to 5 I //used the form tag so that each each row of radio boxes would behave properlyecho "<form><table><td>". $value."</td>";echo "<td>1<input type='radio' name='vraag[]' value=1 onclick='calculate_score(".$aantal.",this.value)'/></td><td>2<input type='radio' name='vraag[]' value=2 onclick='calculate_score(".$aantal.",this.value)'/></td><td>3<input type='radio' name='vraag[]' value=3 onclick='calculate_score(".$aantal.",this.value)'/></td><td>4<input type='radio' name='vraag[]' value=4 onclick='calculate_score(".$aantal.",this.value)'/></td><td>5<input type='radio' name='vraag[]' value=5 onclick='calculate_score(".$aantal.",this.value)'/></td></table></form>";}}echo "Uw totaal score is: <span id='total_score' name='span[]'></span>";echo "<br /><form action='submit_survey.php' method='POST'><input type='hidden' name='total' value='total_score.value' />Naam : <input type='text' name='naam_opleider' /><br />bedrijf: <input type='text' name='bedrijf' /><br />Straat: <input type='text' name='straat' /><br />Postcode, Plaats: <input type='text' name='postcode' /><br /><input type='submit' value='versturen' /></form>"; what goes wrong is that it uses the last record of the query as the value to calculate with, it ignores the first record and the second and only picks up the last(third) record I want it to assign a score per record so shortly drawn out[record 1]score [record 2]score [record 3]score currently it works like this[record 1] [record 2] [record 3]score So shortly how do I fix this? I don't think the javascript is essential to the problem but if necessary I can include it :)edit note: There are no syntax errors purely functional I removed a for loop that wasn't really doing anythingthanks in advance
  22. hello w3schools... was wondering... im searching for the momment being for good and relieable sources to start up a reseller company... and the only 2 sources i find nice is ->opencart (newest version...)->BoxBilling (newest version...)... so here is my problem/question... does anyone in here knows how i can integrate boxbilling billing system into opencart?... because opencart is a shop and not recommended for hosting bills and such stuff... but boxbilling is... but i also like to sell stuff (one time)... and there opencart comes in handy and not boxbilling... so anyone... knows how to integrate the boxbilling system into the opencart?... and yeah... its a bigger project... i know... because boxbilling are running all billings automaticly... so it will be alot of ###### of coding... but still... have been looking alot and have made my mind clear... the only thing is that im needing a little help to do the first step ... so... hoping answers soon ... BUMP: Dont know if this is the right section... but also kinda discuss-able thread... so... discuss... .
  23. Hello W3S... i have a little trouble here witch im in a need of little help with...im for the momment being trying to make a new portfolio design... the only problem im standing with right now is the box im making... (VIEW AT PICTURE IVE ADDED BELOW...) well... what im trying to do is to make a (latest News) box... but note that i said (box)... all the elements/modifications im making on my portfolio should be places into a nice designed box...that would look alot pretty... the only problem is that i dont know how to make these boxes... orr... yeah... i can, but it would take hours/days... since im not the best when its comming to the box-making css/html part... and besides that, i also need help to code the news box so (as seemed in the picture added...),so people can see (date added,they can drop the table down with a java-klappe,ect...) but the most important part is to code/design the box...so if you could give me some sort of tutorial how to add... then i would be so freaking happy! ... thanks dudes... hoping someone can help me out. .Hoping answers soon... Regards: rootKID EDIT: If you did not understand what i just said... then leave a comment and i will (try) my best to make a new and more explained/detailed stuff of the problem i have... thanks..
  24. Hello everyone, Lets share the best books you know related to web development. Share their links as well so that they can easily be downloaded should be in PDF formate. Thanks.
  25. Err

    What's wrong with this?

    function dbErr($num,$n) { switch ($num) { case 1044: case 1045: $err = err("Access to \"{$n}\" denied using current DB User and/or DB Pass."); break; case 1049: $err = err("The database \"{$n}\" does not exist."); break; case 2002: $err = err("There is no such DB Host. Check spelling."); break; default: $err = err("There is a problem connecting to the database. ".mysql_errno().": ".mysql_error()); } return $err; } function dbConnect($h,$u,$p,$n) { if (!$con = @mysql_connect($h,$u,$p)) {$err = dbErr(mysql_errno(),$n);} else if (!@mysql_select_db($n,$con)) {$err = dbErr(mysql_errno(),$n);} return (isset($err)) ? $err : ""; } I got told my code was wrong so I come here hoping people can prove there is a fault in my code. I suspect that people are simply not understanding some PHP syntax. If you can find anything wrong with this, let me know. Edit: I should note that the code works fine, but since I was told by several people it was wrong, I'm out to be proved wrong.
  • Create New...