FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » testing for source to use
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
testing for source to use [message #181611] Fri, 24 May 2013 03:23 Go to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma:
Senior Member
In this bit of code, the procedure is fairly simple.
1) get the value from the database.
2) check the value to find out what the first character is.
3) if the first character is "/" then the source is my site.
4) if not, the source is youtube.

I chose the / because I've never seen it used in the values on youtube.
and it makes finishing off the url easier.

the problem is, no matter what link I select, the url is always MY SITE!

What other ways can I do this?

Oh, and Beau dear? Shut the fuck up with seeing a big blank page because
that makes you a liar.

www.mroldies.net/test4.php



$result = mysql_query("SELECT avid FROM A$year WHERE id = $number");
if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
$vid = mysql_fetch_row($result);

echo $vid[0];
$v=$vid[0];
$v1=substr($v,0,1);


$yt="http://www.youtube.com/watch?v=".$vid[0];

if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
echo "<br />".$yt;
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: use a value form a manu list in a form on the same page
Next Topic: TEST only
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 02:37:39 GMT 2024

Total time taken to generate the page: 0.04061 seconds