Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
trying to fwrite a link on new page
Old 05-24-2005, 01:57 AM trying to fwrite a link on new page
Skilled Talker

Posts: 69
Trades: 0
Can anyone help? I am trying to create a html link on my new page buy all I am getting is comments because that's the symbol for it. Can anyone tell me how to make this work as a link?

content="<?php
\$n=count(\$regarray);
for (\$i=0; \$i<\$n; \$i++ )
{echo (\"<a href=\"http://\".\$regarray[\$i].\"\">\".\$regarray[\$i].\"</a><br>\");}
?>"

The http:// part is killing me because after the // is commenting out.

Any help would be appreciated.

Matt
weddingm is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-24-2005, 02:11 AM
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,168
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
Trades: 0
there's too much going on in that code ... and i don't quite understand it .... anyway ... i thinkyour problem is 9in the fact that after echo, this is returned: "<a href="http://".$regarray[$i]."">".$regarray[$i]."</a><br>"

instead of "<a href=\"http://".$regarray[$i]."\">".$regarray[$i]."</a><br>" ... add an extra \\ ... i think ...
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 05-24-2005, 04:38 AM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
You need to escape the / with a \ ?
Also you don't need to escape $s and so on when inside php tags - even though you might be in an html string.

PHP Code:
<?php
$n
=count($regarray);
for (
$i=0$i<$n$i++ ) {
  echo (
"<a href=\"http:\/\/".$regarray[$i]."\">".$regarray[$i]."</a><br>");
}
?>"
That ought to do.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Reply     « Reply to trying to fwrite a link on new page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53054 seconds with 12 queries