cooldude832 Posted October 6, 2007 Share Posted October 6, 2007 I have a form that when processed produces a url of /search.php?type=1&location=Special+Events and when i say <?php foreach ($_GET as $key => $value){ echo $key." :".$value; } ?> nothing is showing up. Nor Can i access anything get anyway. I've tried using post on it too, nothing I'm on 4.7 so I know the $_GET nomenclature isn't an issue, but I've stumped. Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/ Share on other sites More sharing options...
BlueSkyIS Posted October 6, 2007 Share Posted October 6, 2007 can we see the form HTML? Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/#findComment-363447 Share on other sites More sharing options...
cooldude832 Posted October 6, 2007 Author Share Posted October 6, 2007 I'll show part of it as I'm embarrassed by its uglyness (I didn't write the original form), however its not the issue, because I can manually set get via typing a url. <h4>Event Search</h4> <form name="serach" method="get" action="<?php echo $_SERVER['php_self'];?>"> <input type="hidden" name="type" value="2" /> <br />Date (yyyy/mm/dd): <input type="text" name="year" value="yyyy" size="4" /> <input type="text" name="month" value="mm" size="2" /> <input type="text" name="day" value="dd" size="2" /> <br /> <input type="submit" value="search" /> </form> but you actually made me realize something interesting as its not actually processing as the $_SERVER is lower case I will try that Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/#findComment-363459 Share on other sites More sharing options...
BlueSkyIS Posted October 6, 2007 Share Posted October 6, 2007 works as posted for me: <?php foreach ($_GET as $key => $value){ echo $key." :".$value; } ?> <h4>Event Search</h4> <form name="serach" method="get" action="<?php echo $_SERVER['php_self'];?>"> <input type="hidden" name="type" value="2" /> <br />Date (yyyy/mm/dd): <input type="text" name="year" value="yyyy" size="4" /> <input type="text" name="month" value="mm" size="2" /> <input type="text" name="day" value="dd" size="2" /> <br /> <input type="submit" value="search" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/#findComment-363463 Share on other sites More sharing options...
cooldude832 Posted October 6, 2007 Author Share Posted October 6, 2007 yeah its not my server, nor do i have access to adjust settings, but what I've come to the conclusion is this. Each page basically includes a skeleton layout that has the actual content area inside of it. When I capitalized the PHP_SELF part of the server it processed it to the included file just the content, not the actual page that was being viewed. That successfully showed the get variables. So I tried to change it so it went right to the search page (The one with the layout and the form is included, however now it won't show get. I know its processing php as that is not the issue, but there is something funny with the server not processing forms to a page other than its self I think. Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/#findComment-363474 Share on other sites More sharing options...
BlueSkyIS Posted October 6, 2007 Share Posted October 6, 2007 ugh. sounds like you might be stumped by "protection" of some sort... Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/#findComment-363476 Share on other sites More sharing options...
cooldude832 Posted October 6, 2007 Author Share Posted October 6, 2007 It just doesn't make sense to me how it can process to /redesign/source/serach.php?type=2&location=Special+Events&year=yyyy&month=mm&day=dd but not to /redesign/search.php?type=2&location=Special+Events&year=yyyy&month=mm&day=dd when the second url is the actual page the users visit, and the top is just the source code for the content section. I'll have to talk to the person I am doing this for and see what their conclusion is. Quote Link to comment https://forums.phpfreaks.com/topic/72106-server-can-not-send-data-via-getpost/#findComment-363479 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.