11Tami Posted February 19, 2007 Share Posted February 19, 2007 Hello, I need some php to do something important but should be somewhat easy. But I'm not sure how to approach it. Basically I need to put a text link into some php. So that only when the text link is clicked on a small form will appear. Thats it! The rest I can figure out on my own, just need to know how the form can appear when a text link is clicked on, using php. Please let me know, and thank you very much. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 You can't, that's javascript. PHP is serverside, everything runs before the user sees the page. Anything that happens after the page is loaded is client-side : javascript. Quote Link to comment Share on other sites More sharing options...
cmgmyr Posted February 19, 2007 Share Posted February 19, 2007 You can go that fairly easily with AJAX (Javascript) Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 19, 2007 Author Share Posted February 19, 2007 I don't think that seems correct. If the page is refreshed when the link is clicked then the server can read it. I have seen other sites do this. Anyone know how? Quote Link to comment Share on other sites More sharing options...
smc Posted February 19, 2007 Share Posted February 19, 2007 Well if you want it to do a refresh you can always store a variable to a session that reads "true" and then when the page is refreshed it checks to see if that variable is true and if it is it echo's the HTML of the table. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 19, 2007 Share Posted February 19, 2007 If you want the page to refresh, then yes you can do that. Have the link contain something like http://mysite.com/page.php?show=1 and then on the page do: <?php $show = $_GET['show']; if($show == 1){ print 'The other text here'; } ?> Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 20, 2007 Author Share Posted February 20, 2007 Thanks very much you guys and Jesirose, I have this in a page.php page. <?php $show = $_GET['show']; if($show == 1) {print "<a href='http://www.website.com/page.php?show=1'>test link</a>";} ?> But no text link is appearing. I guess it would help to know that this is supposed to do? For instance is my page supposed to be named page.php?show=1???? instead of just page.php .... If so what does that all doing? Thanks a lot. Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 20, 2007 Author Share Posted February 20, 2007 Strange that post added a whole bunch of stuff to it that I didn't add. Let me try again. I have this in a page.php page. <?php $show = $_GET['show']; if($show == 1) {print "<a href='http://www.website.com/page.php?show=1'>test link</a>";} ?> But no text link is appearing. I guess it would help to know that your code is supposed to do? For instance is my page supposed to be named page.php?show=1? instead of just page.php .... and how does all this connect with it? Thanks a lot. Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 20, 2007 Author Share Posted February 20, 2007 Man it did it again! That link is supposed to say this </a> at the end of it, not the . Quote Link to comment Share on other sites More sharing options...
marcus Posted February 20, 2007 Share Posted February 20, 2007 <?php $show = $_GET['show']; if($show == 1){ print "<a href=\'http://www.website.com/page.php?show=1\'>TEST LINK</a>\n"; } ?> I'm not the best @ escaping so it might be wrong. Btw, put your code in PHP or Code tags Quote Link to comment Share on other sites More sharing options...
11Tami Posted February 20, 2007 Author Share Posted February 20, 2007 Thats terrific but I still don't know what it does. Also my post is still incorrect. I am trying to make a closing A tag for an a href link. But it keeps turning it into a url tag instead. Can anyone tell me what this code and the "Show" commands are supposed to do? Thank you very much. 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.