Jump to content

turbocueca

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Everything posted by turbocueca

  1. [a href=\"http://infocenter.awardspace.com/inter/ps2ub/submit2.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/submit2.php[/a] [a href=\"http://infocenter.awardspace.com/inter/ps2ub/insert.php\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/insert.php[/a] insert.php: [code]<?php    if (isset($_POST['Submit'])) {                     include 'db.php';         $n=$_POST['textfield3'];         $s=$_POST['radiobutton1'];         $w=$_POST['radiobutton'];                 $c=$_POST['textfield'];         $p=$_POST['textfield2'];         $e=$_POST['textfield22'];                  foreach($_POST as $post) {         if ($post == '') {         $error("Blank field detected"); //line 23         }         }                  if (!$error) {         $query="INSERT INTO usbextreme (name,system,work_status,comments,postedby,email) VALUES             ('$n','$s','$w','$c','$p','$e')";                 $exec=mysql_query($query,$connect);         } else {         echo "try again";         }         echo '</p> <p align="center"><strong>Success</strong></p> <p align="center"><a href="submit.php">Add another game</a> | <a href="index.php">Check game list ';         } else {         echo "<center><b>This page should only be accessed when submitting a game<b></center>";         } ?>[/code] Whats the problem?
  2. Fatal error: Call to undefined function: () in /home/www/infocenter.awardspace.com/inter/ps2ub/insert.php on line 23 i removed those [] anyway, what's foreach?
  3. What does that $post and isset does? I can't test the code right now, the server is having some probs..
  4. [code]   <?php    if (isset($_POST['Submit'])) {                     include 'db.php';         $n=$_POST['textfield3'];         $s=$_POST['radiobutton1'];         $w=$_POST['radiobutton'];                 $c=$_POST['textfield'];         $p=$_POST['textfield2'];         $e=$_POST['textfield22'];                  foreach($_POST[] as $post) {         if ($post == '') {         $error("Blank field detected");         }         }                  if (!$error) {         $query="INSERT INTO usbextreme (name,system,work_status,comments,postedby,email) VALUES     ('$n','$s','$w','$c','$p','$e')";                 $exec=mysql_query($query,$connect);         } else {         echo "try again";         }         echo '</p> <p align="center"><strong>Success</strong></p> <p align="center"><a href="submit.php">Add another game</a> | <a href="index.php">Check game list ';         } else {         echo "<center><b>This page should only be accessed when submitting a game<b></center>";         } ?>[/code]
  5. the var $post is the one that has the value of the field right? And what does the ! behind $error or isset as I sometimes see? it gives this error: Warning: Invalid argument supplied for foreach() in /home/www/infocenter.awardspace.com/inter/ps2ub/insert.php on line 21
  6. I try with an if statement, $var="", but it gave an error. How can I check for blank fields?
  7. When submiting information through a PHP page to a mysql database, how can I make a field required? It must have any information or the user won't be able to submit any info.
  8. I'm learning to do php forms, and I'm testing in this page: [a href=\"http://infocenter.awardspace.com/submit.php\" target=\"_blank\"]http://infocenter.awardspace.com/submit.php[/a] , it should return the value written on the "Game Name" textbox when clicking OK but it doesn't. submit.php: [code]<td width="111"><strong>Game Name:* </strong></td>     <td width="319"><form id="form3" name="form3" method="post" action="">       <label>         </label>       <input name="textfield3" type="text" size="53" maxlength="45" />     </form>    </td> (...) <form id="form6" name="form6" method="post" action="insert.php">   <label></label>   <div align="center">     <p>       <input type="submit" name="Submit" value="OK" />     </p>     <p><a href="index.php">Back</a></p>   </div> </form> [/code] insert.php: [code]<?php    echo $_POST['textfield3']; ?>[/code]
  9. please take a look: [a href=\"http://infocenter.awardspace.com/inter/ps2ub/submit.html\" target=\"_blank\"]http://infocenter.awardspace.com/inter/ps2ub/submit.html[/a] First of all, how can I expand the text boxes at that page? - SOLVED And, how can I associate the text boxes and buttons with MySQL? I'm not being able to find a specific tutorial for this.
  10. my phpmyadmin doesn't want to add fields, what's the sql code to add them? no problem, i did it
  11. How to create a field that takes the date of the insertion of a record in MySQL? Or something that gives the possiblity to know when was a record added to the DB.
  12. [code]    if($page > 1)     {         $prev=($page-1);         echo "<a href="".$_SERVER['PHP_SELF']."?page=$prev"><<Previous</a> ";     } [/code] Lines 26-30 [a href=\"http://infocenter.awardspace.com/pages.php\" target=\"_blank\"]http://infocenter.awardspace.com/pages.php[/a] there's an error I can't repair.
  13. How can I divide MySQL DBs in multiple pages automatically. For example, a db has an output limit of 10 but it has 30 records, but below the records outputting there is a link to page 1, 2 and 3 that show all 30 records. Can someone help me?
  14. Works fine. Thanks Ken, Thanks Ober.
  15. take a look [a href=\"http://infocenter.90megs.com/index3.php\" target=\"_blank\"]http://infocenter.90megs.com/index3.php[/a] [code]   (...)             $imgs = array('wg','po','nwr','dnas');                          while ($row=mysql_fetch_row($qq))         {         echo '<tr>             <td width="250" scope="col"><b>'.$row[1].'<b></td>             <td width="85" scope="col">'.$row[2].'</td>             <td width="65"  scope="col">';             list($width, $height, $type, $attr) = getimagesize('images/' . $imgs[$row[3]] . '.png');             echo '<img src="images/' . $imgs[$row[3]] . '.png' . $attr . '></td>             <td width="250" scope="col">'.$row[4].'</td>             <td width="100" scope="col">'.$row[5].'</td>             <td width="150" scope="col">'.$row[6].'</td>                         </tr>';         } ?>[/code]
  16. will it detect the value of the fieldfor each record ? (1,2,3,4)
  17. Hello, I want to replace a value from a field in my mysql db by an image, but I don't know how to, I've tried using IF but it always gives error, maybe because I don't know where to it. [code]         echo '<tr>             <td width="250" scope="col"><b>'.$row[1].'<b></td>             <td width="85" scope="col">'.$row[2].'</td>             <td width="65"  scope="col">'.$row[3].'</td>             <td width="250" scope="col">'.$row[4].'</td>             <td width="100" scope="col">'.$row[5].'</td>             <td width="150" scope="col">'.$row[6].'</td>                         </tr>';         }[/code] This is the code that outputs the records form the db. I want to replace the values at the third row by an image thats located in my server. If you check [a href=\"http://infocenter.90megs.com\" target=\"_blank\"]http://infocenter.90megs.com[/a] you will see the images I mean, but in [a href=\"http://infocenter.90megs.com/index2.php\" target=\"_blank\"]http://infocenter.90megs.com/index2.php[/a] it doenst have any image, just 1,2,3, or 4 on the third row. How can I replace those numbers by an image. Can someone help me? 1 - images/wg.png 2 - images/po.png 3 - images/nwr.png 4 - images/dnas.png
  18. I'm sorry, maybe you're getting tired of me, but this is very important to me, and you are great people. I can now easily output mysql records but if I have 50 records, mysql outputs those 50recs to my php script, what I want is to have a limit of the records like showing just 20 records, and then having a link to show more 20 records, and another link to show the rest. The links to the rest of the db are not need right now, I just want to limit the records number for now. Thanks before.
  19. Hello, if you check [a href=\"http://infocenter.90megs.com/i.php\" target=\"_blank\"]http://infocenter.90megs.com/i.php[/a] , you'll get a mysql database output. I want to make that database outputting its records by ascending alphabetical order from the Name column. Currently, it is being ordered by ID column that's hidden on the website. Can someone help me?
  20. Hello, can someone tell me how can I output all fields of a row in a mysql db using php? and then write.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.