Jump to content

Archived

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

Buyocat

Problems with POST data

Recommended Posts

I'm trying to make a form using some PHP and Smarty, the form I generate looks like this:
[code]
<fieldset>
<legend>Add Book</legend>
</legend>
<form action="http://www.myurl.com/elevator?state=library&action=submit" method="post">
<span>Title:
<input type="text" name="title" length="40" maxlength="40" value="" /></span><br />
<span>Author:
<input type="text" name="author" length="40" maxlength="40" value="" /></span><br />
<span>Publisher:
<input type="text" name="publisher" length="40" maxlength="40" value="" /></span><br />
<span>Genre:
<input type="text" name="genre" length="40" maxlength="40" value="" /></span><br />
<input type="submit" name="enter" value="Submit" /><br />
</form>
</fieldset>
[/code]
However when I submit data nothing gets posted. I have tried echoing out the data at the ?state & action specified but it isn't set (I am using an if clause and it's echoing out stuff to signify that the post data is unset). Anyone have a clue as to where my post data is going and what I can do to fix it?

Share this post


Link to post
Share on other sites
action="http://www.myurl.com/elevator?state=library&action=submit"

shouldn't that be elevator.php

blah.com/elevator.php?state=library&action=submit

Share this post


Link to post
Share on other sites
No, elevator is a directory and it has an index file that instructs the PHP with what to do, in this case it is calling a listener which is looking for states and actions and then triggering stuff. The listener is correctly finding the states and actions however the post data isn't finding its way through.

Share this post


Link to post
Share on other sites
I've been able to do some testing and I've found that if I write the address like so:
./?state=library&action=submit
instead of like this:
[a href=\"http://www.vaultedceilings.net/elevator?state=library&action=submit\" target=\"_blank\"]http://www.vaultedceilings.net/elevator?st...y&action=submit[/a]
then the form works correctly. Can anyone who understands the inner workings of HTML post explain to me why the second and more desirable expression does not work?

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.