Jump to content

[SOLVED] wierd stuff are happening with text like for some reaosn every thing i write is


runnerjp

Recommended Posts

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]

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites


<?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?>

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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?

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

<?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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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'];


    }

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.