Forum Moderators: coopster

Message Too Old, No Replies

making $var's into URL's

         

NL_Cartman

10:06 am on Sep 19, 2003 (gmt 0)

10+ Year Member



Hi, i've been searching for some time now, and cant seem to find a simple method, get the line below right;

<a href=\"$_POST[www]\" target=\"new\">" . $_POST["www"] . "</a>"

its adding the line to my webaddress?, like [mysite.nl...]

I just want the variable not a page on my site.

I must be very simple, yet i'me struggling with it :S

Thnx

Nick_W

10:08 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm a little confused. What do you want it to look like?

Nick

NL_Cartman

10:13 am on Sep 19, 2003 (gmt 0)

10+ Year Member



hi Nick,

the $_post["www"] = "http://www.yoursite.nl"

when i try to link to it, like i do above;

he's adding the url of my site automaticly, and the link looks like this:

"http://www.mysite.nl/http://www.yoursite.nl"

instead of: "http://www.yoursite.nl"

Nick_W

10:20 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried just printing the var to check it's ok? - I can't see anything wrong with the code so my guess is the var is actually what is being printed...?

Nick

NL_Cartman

10:30 am on Sep 19, 2003 (gmt 0)

10+ Year Member



as you see, the var is getting echo'd as a link, that works fine indeed, but somehow he keeps placing the url of my site in front of the other url

i also tried;

<a href=\"$_POST["www"]\" target=\"new\">" . $_POST["www"] . "</a>"

<a href=\"$_POST[www]\" target=\"new\">" . $_POST["www"] . "</a>"

<a href=\"" . $_POST["www"] . "\" target=\"new\">" . $_POST["www"] . "</a>"

?

Nick_W

10:33 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do you get with: print($_POST['www']);

Nick

NL_Cartman

10:36 am on Sep 19, 2003 (gmt 0)

10+ Year Member



whatever i put in it , the var is not the problem

I'me pretty sure i need another statement to let php read the url as a new url, so it wont ad my site url in front of the $_POST["www"]

Nick_W

10:40 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So when you print the var without trying to make a url you get [mydomain.nl...] right?

Nick

NL_Cartman

10:43 am on Sep 19, 2003 (gmt 0)

10+ Year Member



Ooooow Damn Damn, what an ASS i ame! , better i say it myself!

i didn't actualy put a correct URL in the form-field that produces the $_POST["www"] , therefore it didn't work :¦

I'me sorry to have wasted your time, and bandwidth!

Thanx A Whole Lot Nick! :)

Nick_W

10:50 am on Sep 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Then there is no reason why

print('<a href="'.$_POST['www'].'">site</a>');

shouldn't work...

Nick

NL_Cartman

10:57 am on Sep 19, 2003 (gmt 0)

10+ Year Member



i didn't expect the "http://" to be important, i guess i should have