chordsoflife Posted December 23, 2008 Share Posted December 23, 2008 I've got a form submitting to itself. Simple so far, right? Here's my problem: the form is alll the way at the bottom of the page, and when the page reloads, it shoots the user back to the top of the page. I should add: my goal is for the page to reload at the bottom. I'm hoping this is a stupid little thing I should know. Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/ Share on other sites More sharing options...
MadTechie Posted December 23, 2008 Share Posted December 23, 2008 try this <a name="theform"></a> <form action="#theform" method="POST"> ..blar... Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721878 Share on other sites More sharing options...
chordsoflife Posted December 23, 2008 Author Share Posted December 23, 2008 Fancy that. What's the point of the php_self line then? Why can't you just put action="#"? Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721881 Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 Fancy that. What's the point of the php_self line then? Why can't you just put action="#"? You can. $_SERVER['PHP_SELF'] is for holding the current script. What you do with it is up to you. Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721891 Share on other sites More sharing options...
MadTechie Posted December 23, 2008 Share Posted December 23, 2008 $_SERVER['PHP_SELF'] has alot of uses but personally i never rarely use them on a form. EDIT: oh by the way you don't need to have action if you pointing to yourself Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721912 Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 EDIT: oh by the way you don't need to have action if you pointing to yourself You do if you want you html to validate. Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721917 Share on other sites More sharing options...
MadTechie Posted December 23, 2008 Share Posted December 23, 2008 Owww i don't know that was a requirement... Note to self.. listen to thorpe more Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721927 Share on other sites More sharing options...
chordsoflife Posted December 23, 2008 Author Share Posted December 23, 2008 Thanks, I appreciate it. Learned a lot from that question. Link to comment https://forums.phpfreaks.com/topic/138096-solved-_serverphp_self-question/#findComment-721943 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.