CainFool Posted August 2, 2009 Share Posted August 2, 2009 I know I'm in the wrong forum, I just wanted to grab attention here first, but if any moderator wants it moved, move it, I just want some attention as this is a-needed mod for my game. I'm looking to display a javascript alert when users go to loggedin.php, yes? Well if I put it into the header, it will come up on every single page, won't it! I'm not 100% what include_once is, but here is the code I have in my header after include('globals.php'); include_once('alert.php'); And in my alert file, it shows:- <?php echo "<body onload='javascript:alert('testing')'>"; ?> Basically I am going to hook this up to a database so in my Staff Panel I can change "testing" by the database (I can do that) But I think I need include_once explained first. Does that mean that it will only show the page once following your cache? I do need help, yes this is a long post. But when I go onto my game, I get a PHP Error inside the alert.php file, I'm sure it's easy to spot, but if you seen my other modifications I am quite a noob. ::) So if anybody can help me it would be appreciated, thanks! (ps, I can do databases and hook it up, so it's okay.) Note: If you seen in my header text script, you seen I used the table "header" well i'm going to use "footer" (another.. table, is it?) inside "header" and use that and basically use the same stuff from the header text mod. Alright, here's a summary what I need. Whats wrong with my alert.php file include_once explained noob way Thanks! Also if I can't do it by include_once, can you tell me another way? Quote Link to comment Share on other sites More sharing options...
CainFool Posted August 2, 2009 Author Share Posted August 2, 2009 Re: [HELP][V2]I need Mod Help [i Know I'm in Wrong Forum] Okay here's a little update, <?php $name = mysql_fetch_object($db->query("SELECT `footer` FROM `header`")); echo sprintf("<body onload='javascript:alert(%s);'> ",stripslashes($name->text)); ?> I did some editing there, and now I get this:- Fatal error: Call to a member function query() on a non-object in ***/alert.php on line 2 Quote Link to comment Share on other sites More sharing options...
CainFool Posted August 3, 2009 Author Share Posted August 3, 2009 Re: [HELP][V2]I need Mod Help [i Know I'm in Wrong Forum] Sorry for triple post, but i'm getting somewhere. <?php include('globals.php'); $name = mysql_fetch_object($db->query("SELECT `footer` FROM `header`")); echo sprintf("<body onload='javascript:alert(%s);'> ",stripslashes($name->footer)); ?> Comes up with my main game template, with nothing in where the content usually is. Just blank. In my table "footer", I have "testing" wrote in it. Any suggestions? Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted August 3, 2009 Share Posted August 3, 2009 Re: [HELP][V2]I need Mod Help [i Know I'm in Wrong Forum] <?php include_once('globals.php'); //Include once which mean's that //if globals.php is including globals.php again //it won't and no error's will be displayed //(thats what i think if im wrong some one prove me); $content = mysql_query('SELECT `footer` FROM `header`'); $content = mysql_fetch_object($name); echo '<body onload="alert(\''.$content->footer.'\');">'; ?> Quote Link to comment Share on other sites More sharing options...
CainFool Posted August 3, 2009 Author Share Posted August 3, 2009 Re: [HELP][V2]I need Mod Help [i Know I'm in Wrong Forum] Alright, here's a brief description what I want to happen. Depending on their cookies, I want a Javascript alert to come up when they login. So it's only going to come up once because my website is already viewed in their cookies. Getting what I mean? Quote Link to comment Share on other sites More sharing options...
Strats Posted August 3, 2009 Share Posted August 3, 2009 Re: [HELP][V2]I need Mod Help [i Know I'm in Wrong Forum] Not being rude but Criminal Intentions? That name has been used by Mariachi he had criminal-intention.com But has had some trouble. Quote Link to comment Share on other sites More sharing options...
CainFool Posted August 5, 2009 Author Share Posted August 5, 2009 Re: [HELP][V2]I need Mod Help [i Know I'm in Wrong Forum] His is criminal-intention Mines is criminal intentions difference, not much, but there's still a difference. Quote Link to comment 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.