GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 12-Aug-2005, 06:11
oozsakarya oozsakarya is offline
New Member
 
Join Date: May 2005
Posts: 26
oozsakarya is on a distinguished road
Question

Can you help me about php forms?


Codes of form1.html is below

HTML Code:
<html> <head> <title> CH1/Bob'sAuto Parts </title> </head> <body> <form action="form1.php" method="POST"> <table border="0"> <tr bgcolor="#cccccc"> <td width="150">Item </td> <td width="150">Quantity </td> </tr> <tr> <td>Tires</td> <td align="center"><input type="text" name="tireqty" size="5" maxlength="3"></td> </tr> <tr> <td> Oil </td> <td align="center"><input type="text" name="oilqty" size="5" maxlength="3"></td> </tr> <tr> <td>Spark Plugs</td> <td align="center"><input type="text" name="sparkqty" size="5" maxlength="3"></td> </tr> <tr> <td colspan="2" align="center"> <input type="submit" value="Submit Order"></td> </tr> </table> </form> </body>

And codes of form1.php is below.

PHP Code:

<? php
         // create short variable names
         $tireqty=$_POST['tireqty'];
         $oilqty=$_POST['oilqty'];
         $sparkqty=$_POST['sparkqty'];    
?>

<html>
<head>
   <title> CH1/Bob'sAuto Parts - Order Results </title>
</head>

<body>
   <h1>Bob's Auto Parts</h1>
   <h2>Order Results</h2>

      <?php
         echo '<p>Order processed at.';    
     echo  date('H:i, jS F');
     echo '</p>' ; 

     echo '<p>Your order is as follows: </p>';
     echo $tireqty.'tires<br />';
     echo $oilqty.'bottles of oil<br />';
     echo $sparkqty.'spark plugs<br />';
      ?>      
</body>

</html>

bUT I COULD NOT EXECUTE ABOVE CODES TRUE.I wrote to browser localhost/form1.html then I entered numbers to text boxes. Then I clicked button but after then a page is sent to me from server which is empty.

CAN YOU HELP ME?
Last edited by JdS : 12-Aug-2005 at 07:57. Reason: Please insert your Php code between [php] & [/php] tags; edited title
  #2  
Old 12-Aug-2005, 07:59
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Inside form1.php, remove the space within <? php.
  #3  
Old 12-Aug-2005, 08:32
oozsakarya oozsakarya is offline
New Member
 
Join Date: May 2005
Posts: 26
oozsakarya is on a distinguished road

Very Thanks


OoH! Thank you very much!!! I can not think that <? php can cause an error. I tried very much for this problem and I could be mad.
  #4  
Old 12-Aug-2005, 08:35
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
The book you are using is VERY good!!! I used the same one to learn PHP/MySQL.

If you are just learning, here is an invaluable tip: set PHP's error reporting to report everything.
  #5  
Old 11-Sep-2005, 22:13
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,108
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Quote:
Originally Posted by JdS
The book you are using is VERY good!!! I used the same one to learn PHP/MySQL.

If you are just learning, here is an invaluable tip: set PHP's error reporting to report everything.

You know, I have heard you mention this book you love so much more than once JdS. Would you be so kind as to share the name of it with the unwashed masses.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
 
 

Recent GIDBlogA Week in Kuwait by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you help me about using forms in php??? oozsakarya MySQL / PHP Forum 2 10-May-2005 04:15
Help ! I need help starting up on Php ! onauc MySQL / PHP Forum 11 04-Jan-2005 23:57
Forms and PHP nniehoff MySQL / PHP Forum 2 20-Dec-2004 07:33
php software dopee MySQL / PHP Forum 0 04-May-2004 11:26
All the big PHP script collections that matter jrobbio MySQL / PHP Forum 5 06-Jun-2003 16:14

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:47.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.