Jump to content


Photo

easy questions .. newbie


  • Please log in to reply
4 replies to this topic

#1 GoDaddy

GoDaddy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 03 June 2006 - 02:39 AM

hi, i'm a newbie at this php thing.

I have a file called home.html

which is like this
<form action="processorder.php" method="POST">
<html>
<body>
<table>

<tr>
<td>Tires</td>
<td><input type="text" name="textboxTires" size="3" maxlength="3"/></td>
</tr>

<tr>
<td colspan="2"><input type="button" value="Submit"/></td>
</tr>

</table>
</body>
</html>
</form>


and my processorder.php is like this

<?php $tires = $_POST['textboxTires']; ?>


<?php echo $tires.'tires<br/>'; ?>



when i click on Submit .. nothing happens .. Am I missing something here? I thought that the submit button would of done a post and would of called the processorder.php ...

Also, is there anywhere on the net that teaches how to use Zend Studio?

Thanks

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 June 2006 - 02:44 AM

Your html is wrong - you can't put elements OUTSIDE the file. Try this instead:
<html>
<body>
<form action="processorder.php" method="POST">
<table>

<tr>
<td>Tires</td>
<td><input type="text" name="textboxTires" size="3" maxlength="3"/></td>
</tr>

<tr>
<td colspan="2"><input type="button" value="Submit"/></td>
</tr>

</table>
</form>
</body>
</html>

Learn Zend Studio? Zend maybe? The documentation that came with it, maybe?
Legend has it that reading the manual never killed anyone.
My site

#3 GoDaddy

GoDaddy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 03 June 2006 - 02:48 AM

i've found my error .. it was in the input type .. it was button ... i've changed it to submit ....

So it raises another question .. when the type is of button .. how do you tell the button that when the user clicks on it .. to do a post to the processorder.php?

[!--quoteo(post=379519:date=Jun 2 2006, 10:44 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 2 2006, 10:44 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Your html is wrong - you can't put elements OUTSIDE the file. Try this instead:
<html>
<body>
<form action="processorder.php" method="POST">
<table>

<tr>
<td>Tires</td>
<td><input type="text" name="textboxTires" size="3" maxlength="3"/></td>
</tr>

<tr>
<td colspan="2"><input type="button" value="Submit"/></td>
</tr>

</table>
</form>
</body>
</html>

Learn Zend Studio? Zend maybe? The documentation that came with it, maybe?
[/quote]


Thanks! that was a mistake ..

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 03 June 2006 - 05:00 AM

If you have a button of type "button", not "submit", the only way to make it work is to use Javascript.

Ken

#5 GoDaddy

GoDaddy
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 04 June 2006 - 02:04 PM

[!--quoteo(post=379549:date=Jun 3 2006, 01:00 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 3 2006, 01:00 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
If you have a button of type "button", not "submit", the only way to make it work is to use Javascript.

Ken
[/quote]

Im also not familiar with javascript. So i guess there's will be something like onlick="the javascript function"

but then again in that javascript function... how do call another php file? like how can it call my file processorder.php ... which will process the order from the home.html file?

Thanks





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users