kiowa_jackson Posted October 26, 2007 Share Posted October 26, 2007 Let's say I have an incoming link going to www.mydomain.com/page.html?src=[value] where the value is the id of an ad or whatever. Is it possible to insert this value in to an outbound link on www.mydomam.com/page.html, i.e. is it possible to create a link that will automatically pass on this value to a different page? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/ Share on other sites More sharing options...
pocobueno1388 Posted October 26, 2007 Share Posted October 26, 2007 Yes, but you would need to use a .php extension. Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-378691 Share on other sites More sharing options...
premiso Posted October 26, 2007 Share Posted October 26, 2007 www.php.net/header <?php header("Location:" . $_GET['src']); ?> Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-378695 Share on other sites More sharing options...
kiowa_jackson Posted October 26, 2007 Author Share Posted October 26, 2007 Not sure if I understand this right, but I'm not looking for a redirect, I want them to be able to see the page, then click the link. So they would come to my page /page.php?srw=[variable]. And then whatever linke they'd click on that page would pass on the variable to the next page. If I understood the above code correctly, that was for redirecting an entire page. Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-378726 Share on other sites More sharing options...
premiso Posted October 26, 2007 Share Posted October 26, 2007 More information is needed. What do you want to do with the src= ? Do you want to redirect the user, display it in an iframe, log it in a database? What is the goal of this script? Do you want it to simply take what is in src= and create a link from it? It's like the blind leading the blind. Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-378732 Share on other sites More sharing options...
kiowa_jackson Posted October 26, 2007 Author Share Posted October 26, 2007 Sorry. I want a user to come to my page via a link http://www.mysite.com/page.php?src=[value] then I want this user to either click a normal link and/or fill out a form. The form or link (I'd like to do both for different purposes, but whatever is possible) will then send them to a different domain. I want the original variable to be passed on like this: http://www.otherdomain.com?src=[value] So that the original value gets dynamically inserted to the outgoing links. Hope that covers it, thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-378745 Share on other sites More sharing options...
premiso Posted October 26, 2007 Share Posted October 26, 2007 Using the $_GET['src'] where needed: <?php echo '<a href="http://www.someoensdomain.com/?src=' . $_GET['src'] . '">Click Here</a>'; echo '<br /><form method="post" action="site.php?src=' . $_GET['src'] . '"><input type="hidden" src="' . $_GET['src'] . '" name="src" /><input type="submit" name="submit" value="Submit!" /></form>'; ?> I think that is what you are looking for...? Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-378763 Share on other sites More sharing options...
kiowa_jackson Posted October 27, 2007 Author Share Posted October 27, 2007 YES, that is EXACTLY what I was looking for :D This will be very useful for me, thank you Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-379330 Share on other sites More sharing options...
darkfreaks Posted October 27, 2007 Share Posted October 27, 2007 solved? Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-379331 Share on other sites More sharing options...
marcus Posted October 27, 2007 Share Posted October 27, 2007 Yes, but you would need to use a .php extension. No, you don't need a .php extension. You can have a mime-type set to make html viewed as php. Quote Link to comment https://forums.phpfreaks.com/topic/74899-solved-can-i-inser-value-from-mypagehtmlsrcvalue-into-a-link/#findComment-379336 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.