Jump to content

Archived

This topic is now archived and is closed to further replies.

GoDaddy

easy questions .. newbie

Recommended Posts

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

I have a file called home.html

which is like this
[code]
<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/>'; ?>

[/code]


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

Share this post


Link to post
Share on other sites
Your html is wrong - you can't put elements OUTSIDE the file. Try this instead:
[code]<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>[/code]

Learn Zend Studio? Zend maybe? The documentation that came with it, maybe?

Share this post


Link to post
Share on other sites
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) [snapback]379519[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Your html is wrong - you can't put elements OUTSIDE the file. Try this instead:
[code]<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>[/code]

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


Thanks! that was a mistake ..

Share this post


Link to post
Share on other sites
If you have a button of type "button", not "submit", the only way to make it work is to use Javascript.

Ken

Share this post


Link to post
Share on other sites
[!--quoteo(post=379549:date=Jun 3 2006, 01:00 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 3 2006, 01:00 AM) [snapback]379549[/snapback][/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

Share this post


Link to post
Share on other sites

×

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.