11Tami Posted February 22, 2007 Share Posted February 22, 2007 Hello, here is some code that if show is in a url and is equal to 1 then the following php text should appear. Problem is when I put in a url like this http://www.website.com/show=1.php nothing happens. When I use this http://www.website.com/page.php?show=1 It doesn't like that either, it says a question ? mark cannot be used in a url address. Please someone let me know the proper way to do this. To link a url to this code.....Thank you very much <?php $show = $_GET['show']; if($show == 1){ print 'text here'; } ?> Quote Link to comment Share on other sites More sharing options...
skali Posted February 22, 2007 Share Posted February 22, 2007 <a href='website.com/your_page_with_code.php?show=1'>show me</a> Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 22, 2007 Author Share Posted February 22, 2007 Thanks, but I don't know what you mean. I need to know what to name the page? If I name it something like this.... code.php?show=1 I cannot upload it to my ftp account. It says it will not take the question mark in the url address. Should this be happening? <?php $show = $_GET['show']; if($show == 1){ print "text"; } ?> Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 22, 2007 Share Posted February 22, 2007 The page is just code.php. When you link to the page, you make the link have show=1. Are you being serious? I think you're having a joke at us at this point. You've spent at least a week on how to do a query string... Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 22, 2007 Author Share Posted February 22, 2007 Very nice, its only been 3 days. Some of us don't do query strings. Quote Link to comment Share on other sites More sharing options...
heckenschutze Posted February 22, 2007 Share Posted February 22, 2007 ... Query strings is one of the main methods to transport information from page to page... + recv' input Quote Link to comment Share on other sites More sharing options...
TRI0N Posted February 22, 2007 Share Posted February 22, 2007 First off your URL sting needs to be: http://www.website.com/page.php?show=1 Inside page.php you need to have the follwoing <?php $show = $_REQUEST['show'] ; if ($show == 1) { print "Hello World"; } if ($show == 2) { print "Goodbye World"; } ?> Now you should see that if you follow that URL to the page you have the code inside of. If you are getting that error message means your Web Server is not configured correctly for PHP and that is the main problem. Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 23, 2007 Author Share Posted February 23, 2007 Thank you very much Trion. You were the only one that full explained it to me in detail instead of just throwing me the code without saying how to use it. It works great! I'll send you a thank you. Quote Link to comment 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.