GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Need some php help. Please! (https://gfy.com/showthread.php?t=56485)

chodadog 04-11-2002 03:58 AM

Need some php help. Please!
 
Ok, i'm trying to work on this random banner thing. And it all works fine..

Except for the onmouseover status window bit..

For example.

IMG SRC works fine:

src=\"$img\"

and the Alt attribute works fine:

alt=\"[$alt]\"

now.. i've tried everything i can think of to put the $status_url into the code.. but i keep winding up with errors..

onmouseover="window.status='http://www.somewhere.com';return true;"

Stuff i've tried already that doesn't work:

onmouseover="window.status='$status_url';return true;"
onmouseover="window.status=/'$status_url/';return true;"
onmouseover=/"window.status='$status_url';return true;/"
onmouseover=/"window.status=/'$status_ur/l';return true;/"

Some help would be greatly appreciated!

Thanks in advance.

Babaganoosh 04-11-2002 04:25 AM

Unless you made a typo, you are escaping the quotes backwards

onmouseover="window.status=/'$status_url/';return true;"
onmouseover=/"window.status='$status_url';return true;/"
onmouseover=/"window.status=/'$status_ur/l';return true;/"


You have / instead of \

chodadog 04-11-2002 04:31 AM

Yeah, that was a typo i made during the post, but not what i had done in the code. So just.. swap those around! :P

Any ideas on what i should be doing though, besides that? i'm really stumped! :(

ServerGenius 04-11-2002 04:39 AM

PHP Code:

echo "<a href=\"http://www.domain.com\" onmouseover=\"window.status='http://www.somewhere.com';return true;\">test</a>"

This works :winkwink:

DynaMite :thumbsup

chodadog 04-11-2002 04:49 AM

Thanks dude. But the http://www.somewhere.com isn't supposed to be there. i want the variable $status_url in there.
but no matter how i do it.. i get errors.. i've tried escaping every way i can think of!

chodadog 04-11-2002 05:20 AM

*bump*

i know that's an annoying thing to do, but i need this ASAP! :D

A&H, come back! :P

chodadog 04-11-2002 05:37 AM

hey. i figured it's not actually a problem with my escaping..

this is the line of the code i wanna change:

list($img, $url, $alt) = explode("|", $line[$rIndex]);

i wanna add anotehr category.. so i figured.. it'd be as simple as changing it to this:

list($img, $url, $alt, $status_url) = explode("|", $line[$rIndex]);

and then changing:

blah.gif|http://blah.com|Teens 4 Free

To

blah.gif|http://blah.com|Teens 4 Free|http://www.statusurl.com

What am i forgetting to do?

This is the entire code by the way:
-------------

PHP Code:

<?php

function PrintBanner() {
$fp fopen("banners.txt""r");
$index 0;
while (!
feof($fp)) {
  
$line[$index] = fgets($fp256);
  
$index++;
 }

$rIndex mt_rand(0$index -1);
list(
$img$url$alt) = explode("|"$line[$rIndex]);
$banner =  "<a href=\"$url\" target=_blank> <img src=\"$img\" width=\"468\" height=\"60\" border=\"0\" alt=\"[$alt]\"></a>\n";
return 
$banner;
}

?>

----------

and the text file with the data

----------

image1.gif|http://somewhere.com/?wm=47887|Sexy Teens
image2.gif|http://somewhere.com/?wm=47888|Sexy Lesbians
image3.gif|http://somewhere.com/?wm=47889|Sexy Asians

-----------


Once again, i'm fucking cluseless here!

PS. After 23047 edits, i think i got this whore of a thing to display corrently

spanky 04-11-2002 07:05 AM

howdy do,
My first post but I don't really have anything to say other than chodadog, this sucker below works for me.
PHP Code:

<?php

$banners_dat 
"./banners.txt";

function 
PrintBanner() {
    global 
$banners_dat;

    
$arry = @file($banners_dat);
    if( !isset(
$arry) || !$arry || !is_array($arry) )
        return 
false;

    list(
$img$url$alt$status) = explode("|"$arry[rand(0,sizeof($arry)-1)]);
    
$focus=$mouseover="\"window.status='$status'; return true;\"";
    
$mouseout="\"window.status='Done'; return true;\"";

    return 
"<a 
        href=\"
$url\" 
        target=_blank 
        OnMouseOver=
$mouseover 
        OnFocus=
$focus 
        OnMouseOut=
$mouseout><img 
                    src=\"
$img\" 
                    width=\"468\" 
                    height=\"60\" 
                    border=\"0\" 
                    alt=\"[
$alt]\"></a>\n";
}

print 
PrintBanner();
?>

cheers

chodadog 04-11-2002 07:45 AM

Thanks dude. Just figured out what the problem with the one i posted was. But thanks anyways ;)


All times are GMT -7. The time now is 03:38 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123