Buyocat Posted June 3, 2006 Share Posted June 3, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/11109-problems-with-post-data/ Share on other sites More sharing options...
.josh Posted June 3, 2006 Share Posted June 3, 2006 action="http://www.myurl.com/elevator?state=library&action=submit"shouldn't that be elevator.php blah.com/elevator.php?state=library&action=submit Quote Link to comment https://forums.phpfreaks.com/topic/11109-problems-with-post-data/#findComment-41537 Share on other sites More sharing options...
Buyocat Posted June 3, 2006 Author Share Posted June 3, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/11109-problems-with-post-data/#findComment-41554 Share on other sites More sharing options...
Buyocat Posted June 3, 2006 Author Share Posted June 3, 2006 I've been able to do some testing and I've found that if I write the address like so:./?state=library&action=submitinstead 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? Quote Link to comment https://forums.phpfreaks.com/topic/11109-problems-with-post-data/#findComment-41575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.