runnerjp Posted February 20, 2007 Share Posted February 20, 2007 ok for some reaosn every thing i write on the page is a link and i do not under stand why http://www.runnerselite.com <html xmlns="undefined"> <head> <link rel="stylesheet" type="text/css" href="css/line.css"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body {background-image: url(http://www.runnerselite.com/images/line.jpg); background-repeat: repeat-x; background-position: 0px 160px} --> </style> </head> <body bgcolor="#FFFFFF"> <span style="position: absolute; top: 4px; left: 30px;"> <img src="http://www.runnerselite.com/images/runner.jpg"> </span> <span style="position: absolute; top: px; left: 290px;"> <img src="http://runnerselite.com/images/LOGO.jpg"></span> <span style="position: absolute; top: 13px; left: 1157px;"> Welcome <font size="3" face="Times"> <b>Guest</b> please <a href="register.php">Register</span> </body> </html> <html> <head><link rel="stylesheet" type="text/css" href="css/line.css"/></head> <body> <div id="background"> </div> <span style="position: absolute; top: 210px; left: 280px;"> <img src="http://www.runnerselite.com/images/training.jpg" width="120" height="120" /></span> <span style="position: absolute; top: 218px; left: 422px;"> Welcome to RunnersElite </span> </body> </html> [code] for some reason the welcome to runners elite text has become a link to [quote]<a href="register.php">Register[/quote] have i not closed it off or something :S [/code] Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/ Share on other sites More sharing options...
aftab_jii Posted February 20, 2007 Share Posted February 20, 2007 at first glnace i can see that you havent closed <a href=..> on: Welcome <font size="3" face="Times"> <b>Guest</b> please <a href="register.php">Register</span> Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189358 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 how would i close this?? by typing /a> ??? new to this stuff sorry for being petty Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189359 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 <a href="THIS IS MY HTTP LINK">THIS IS MY TEXT THAT WILL BE LINKED</ a > THIS IS NON LINKED TEXT Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189362 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 but i did that <? if($auth[displayname] == ""){ echo'Welcome <font size="3" face="Times"> <b>Guest</b> please <a href="register.php">Register'[/url]; }else{ echo"you are logged in as ".$auth[displayname]; } ?> and i got this error message Parse error: syntax error, unexpected '[', expecting ',' or ';' in /home/runnerse/public_html/include/header.inc.php Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189363 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 Where is the closing </ a >? as defined in my post? Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189365 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 I know what is happening. This board is converting </ a > with no spaces to [/url]. Change [/url] to </ a> Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189366 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 sorry i copyed wrong then i was mesisng around with it b4 u pasted back... this is what i put <? if($auth[displayname] == ""){ echo'Welcome <font size="3" face="Times"> <b>Guest</b> please <a href="register.php">Register'</a>; }else{ echo"you are logged in as ".$auth[displayname]; } ?> yet im getting an error Parse error: syntax error, unexpected '/' in /home/runnerse/public_html/include/header.inc.php Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189367 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 Ok the issue is that you have your PHP and HTML mixed up. Use the following <? if($auth[displayname] == "") { echo "Welcome <font size="3" face="Times"> <b>Guest</b> please <a href=/"register.php/">Register"</a>; }else{ echo"you are logged in as ".$auth[displayname]; } ?> Not the / before the " register.php..... and again after it. With single ' and " dounble quotes you are ending the tring to be echoed and therefore PHP wis throwing an error. By escaping these quotes using a / you tell php to ignore them and continue. Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189372 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 ok i did that echo'Welcome <font size="3" face="Times"> <b>Guest</b> please <a href=/"register.php/">Register'</a>; and yet still i get same error :S Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189377 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 sorry my fault...you need to put the / before EVERY ' or " in your echo statement apart from the last one which closes the echo statement. Really with the explanation you should be able to try and work this out. echo "this" ..... this echo "this is "my" fault" ....error echo "this is /"my/" fault" ....this is "my" fault Ok Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189378 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 do u mean like this <? if($auth[displayname] == /""/){ echo'Welcome <font size="3" face="Times"> <b>Guest</b> please <a href=/"register.php/">Register"</a>; }else{ echo/"you are logged in as /".$auth[displayname]; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189380 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 and im also getting Parse error: syntax error, unexpected $end in /home/runnerse/public_html/include/header.inc.php on line 24 what does this mean :S is my code that badly writen lol Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189381 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 no i dont. that is not part of your echo statement... now is it?? Your echo statement begins with the word echo. read my last post more carefully...please. Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189383 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 <?php if($auth[displayname] == "") { echo "Welcome <font size=/"3/" face=/"Times/"> <b>Guest</b> please <a href=/"register.php/">Register</a>; } else { echo "you are logged in as ".$auth[displayname]; } php?> Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189385 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 how comes "you are logged in as ". does not need doing? Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189386 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 lol there is still something wrong with it because now im getting Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/runnerse/public_html/include/header.inc.php on echo "Welcome <font size=/"3/" face=/"Times/"> <b>Guest</b> please <a href=/"register.php/">Register</a>; but it must have to end in ; (is that right lol) Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189387 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 Right "You are logged in as" does not need because it is a start and a finish quote...LIKE I SAID MY PREVIOUS POSTS This error is generated by my sloppy coding. use echo "Welcome <font size=/"3/" face=/"Times/"> <b>Guest</b> please <a href=/"register.php/">Register</a>"; you really need to learn some of the basics here before trying to migrate to projects like this. The echo statement contains a $string ie a set of charachters to be output. These need to be contained within " my string " quotes. becasue you have used quotes WITHIN the string, PHP thisnks that you are trying to close that $string. This is why you MUST escape (/) any quote marks contained WHITIN the $string.....get it? Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189390 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 i get it so every time you have a string thats open you have to close it with / meaning stop so why is it asking expecting ',' or ';' along the line whin it all ready has it in place Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189393 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 NO i never said ANYTHING about / meaning stop or ending a string with / show me your code that you have now. Really I am trying to help, but if you are not prepared to fully read my posts...there is little I can do. Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189400 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 rlly i am reading the posts <?php if($auth[displayname] == "") { echo "Welcome <font size=/"3/" face=/"Times/"> <b>Guest</b> please <a href=/"register.php/">Register</a>"; } else { echo "you are logged in as ".$auth[displayname]; } php?> see this is what iv got so far Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189404 Share on other sites More sharing options...
Snooble Posted February 20, 2007 Share Posted February 20, 2007 <?php if($auth[displayname] == "") { echo "Welcome <font size='3' face='Times'> <b>Guest</b> please <a href='register.php'>Register</a>"; } else { echo "you are logged in as ".$auth[displayname]; } ?> That works. Now post the source of /include/header.inc.php Snooble Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189407 Share on other sites More sharing options...
willpower Posted February 20, 2007 Share Posted February 20, 2007 feckin hell...i'm losing the plot here.... Whislt I take no responsibility for your lack of comrehesion...I do absorb all resposibility for my own pathetic fuck up. and I am sorry!!!! you need to replace all the /'s with \'s I don't know why but i put them ALL the wrong way around. School boy error. if($auth[displayname] == "") { echo "Welcome <font size=\"3\" face=\"Times\"> <b>Guest</b> please <a href=\"register.php\">Register</a>"; } else { echo "you are logged in as ".$auth[displayname]; } Try That... Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189409 Share on other sites More sharing options...
Snooble Posted February 20, 2007 Share Posted February 20, 2007 yes that's why i dont escape quotes unless i have to... @runnerjp placing \ infront of your " is called (escaping) it means that your echo command doesn't end prematurely. echo "i'm echoing a link <a href="oopsimessedup.bad">the echo has ended already so this isn't seen</a>" echo "i'm echoing a link <a href='usingsinglequotes.good'>as the echo hasn't finished this will all be a link to the page</a>" Hope that makes it a little clearer, i'm new to this too... I suggest... STUDY STUDY STUDY! Snooble Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189417 Share on other sites More sharing options...
trq Posted February 20, 2007 Share Posted February 20, 2007 Escape sequences are backslashes \ in php (and most languages), also, there is no such tag as php?> Try... <?php if($auth['displayname'] == "") { echo "Welcome <font size=\"3\" face=\"Times\"> <b>Guest</b> please <a href=\"register.php\">Register</a>"; } else { echo "you are logged in as ".$auth['displayname']; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/39284-solved-wierd-stuff-are-happening-with-text-like-for-some-reaosn-every-thing-i-write-is/#findComment-189423 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.