Page 1 of 1

help with a url

Posted: Fri Jul 05, 2002 2:44 am
by epic
Im making a script for my webhost because he never updates the hosted site page. so i want to make him a script where all he has todo is update the database via my form which is fine i can do that.
the only thing that is troubling me is that.
The urls that have to be out putted onto the page have to have the http:// in them. and when i try add that bit to the array part of the php script it comments out the rest of the script.
Eg.

Code: Select all

while ( $data = mysql_fetch_array( $result ) )
		{
		echo 'Hosted Sites: '.
		$data&#1111;'sitename'].'  <a href="http://'.
		$data&#1111;'url'].'">'.
		$data&#1111;'sitename'].'</a><br />';
the // in the http:// comments out the rest of the script.. is there any way to combat this??

Posted: Fri Jul 05, 2002 3:22 am
by twigletmac
Is it actually causing the script not to run because since those //'s are enclosed within a string they don't get recognised as comments.
This

Code: Select all

echo 'Hosted Sites: '.$data&#1111;'sitename'].'<a href="http://'.$data&#1111;'url'].'">'.$data&#1111;'sitename'].'</a><br />';
works just fine for me.

Mac

Posted: Fri Jul 05, 2002 3:33 am
by Nezzar
If it is making trouble you could try the following (dunno why it should but...):

Code: Select all

while ( $data = mysql_fetch_array( $result ) ) 
      &#123; 
      echo 'Hosted Sites: '. 
      $data&#1111;'sitename'].'  <a href="http:/'.'/'. 
      $data&#1111;'url'].'">'. 
      $data&#1111;'sitename'].'</a><br />';
Notice the '.' between the two /

Posted: Fri Jul 05, 2002 7:19 am
by protokol
I think maybe what's happening is that his editor is showing him that it is a commented out line, when really it's completely valid because it's inside quotes.

Is this correct epic???

Posted: Fri Jul 05, 2002 7:21 am
by twigletmac
That's what I thought but I thought I'd be kind and didn't say it.

Mac

Posted: Fri Jul 05, 2002 7:23 am
by protokol
Well it's early and I haven't had my coffee yet. I'm likely to say anything. Bah!