-
Posts
29 -
Joined
-
Last visited
Never
Everything posted by Seitan
-
or alternativly or could do this <tbody><tr> <td><strong>Game Name:</strong> Can you Run Mc Donald's !</td> </tr> <tr> <td><div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="400" width="500"> <param name="movie" value="rgames/swf/mcdonalds-eng.swf"> <param name="quality" value="high"> <embed src="rgames/swf/mcdonalds-eng.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="400" width="500"> </object> </div></td> </tr> <tr> <td><strong>Game Description:</strong> Run McDonald's as if you are its CEO. Grow pastures & soy fields, corrupt people, run campaigns & keep McDonald's in profit ! You need to use your head, so do not play if you don't have one !<br> <strong>Game Total Played: </strong>436 <p align="center"><a href="index.php?id=ljg&gid=194" onclick="return popitup('index.php?id=ljg&gid=194')">Full Screen View</a> </p> <p>Game Category: Misc Games<br>***PLACE GOOGLE ADS HERE</p></td> </tr> </tbody>
-
the footer file you supplied doesn't have the any of the stuff in your content section, it looks like it just has one of the side columns anyways, I looked at the page source and here is my suggestion <tbody><tr> <td><strong>Game Name:</strong> Can you Run Mc Donald's !</td> </tr> <tr> <td><div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="400" width="500"> <param name="movie" value="rgames/swf/mcdonalds-eng.swf"> <param name="quality" value="high"> <embed src="rgames/swf/mcdonalds-eng.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="400" width="500"> </object> </div></td> </tr> <tr> <td><strong>Game Description:</strong> Run McDonald's as if you are its CEO. Grow pastures & soy fields, corrupt people, run campaigns & keep McDonald's in profit ! You need to use your head, so do not play if you don't have one !<br> <strong>Game Total Played: </strong>436 <p align="center"><a href="index.php?id=ljg&gid=194" onclick="return popitup('index.php?id=ljg&gid=194')">Full Screen View</a> </p> <p>Game Category: Misc Games</p></td> </tr> <tr><td> ****PLACE GOOGLE ADS HERE***</td></tr> </tbody>
-
set the height in #content to auto
-
ok I read the article at the top about the headers....so I broke it into 2 pages the login script is like this <?php # login.php // This is the login page for the site. // Include the configuration file for error management and such. require_once ('../****/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Login'; $header = 'Login'; include ('../php/header.php'); ?> <p>Your browser must allow cookies in order to log in.</p> <form action="login2.php"method="post"> <p><b>User Name:</b><br> <input type="text" name="user_name" size="20" maxlength="40" value="<?php if (isset($_POST ['user_name'])) echo $_POST['user_name']; ?>" /></p> <p><b>Password:</b> <br><input type="password" name="password" size="20" maxlength="20" /></p> <div align="center"><input type="submit" name="submit" value="Login" /></div> <input type="hidden" name="submitted" value="TRUE" /> </form> <a href ="../php/forgot_password.php">Forgot Password?</a> <?php include ('../php/footer.php'); ?> and then the the script that runs the login is like this <?php # login.php // This is the login page for the site. // Include the configuration file for error management and such. require_once ('../****/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Login'; $header = 'Login'; if (isset($_POST['submitted'])) { // Check if the form has been submitted. require_once ('../****/mysql_connect.php'); // Connect to the database. // Validate the user name address. if (!empty($_POST['user_name'])) { $u = escape_data($_POST ['user_name']); } else { echo '<p><font color="red"size="-1"> You forgot to enter your User Name! </font></p>'; $u = FALSE; } // Validate the password. if (!empty($_POST['password'])) { $p = escape_data($_POST ['password']); } else { $p = FALSE; echo '<p><font color="red"size="-1"> You forgot to enter your password! </font></p>'; } if ($u && $p) { // If everything's OK. // Query the database. $query = "SELECT user_name FROM users WHERE (user_name='$u' AND password=SHA('$p')) AND active IS NULL"; $result = mysql_query ($query) or trigger_error ("Query: $query\n <br />MySQL Error: " . mysql_error()); if (@mysql_num_rows($result) == 1) { // A match was made. // Register the values & redirect. $row = mysql_fetch_array ($result,MYSQL_NUM); mysql_free_result($result); mysql_close(); $_SESSION['user_name'] = $row[1]; $_SESSION['user_id'] = $row[0]; ob_end_clean(); // Delete the buffer. header('Location: http://www.ourvegankitchen.com'); exit(); // Quit the script. } else { //No match was made. echo '<p><font color="red"size="-1">Either the user name and password entered do not match those on file or you have not yet activated your account.</font></p>'; } } else { echo '<p><font color="red"size="-1">Please try again. </font></p>'; } mysql_close(); } // End of SUBMIT conditional. include ('../php/header.php'); ?> <?php include ('../php/footer.php'); ?> so is this better? I am just learning this stuff so I need to understand the how the code is supposed to be structured? Anyways, this doesn't work for me, so can someone please help
-
Hi, I'm having some strange problems with my redirect. It doesn't work. I have a page for users to login and every time they do, it doesn't redirect the user, it just shows a blank page. Here is my code. The whole page. At the bottom I will also post just the redirect code. <?php # login.php // This is the login page for the site. // Include the configuration file for error management and such. require_once ('../****/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Login'; $header = 'Login'; include ('../php/header.php'); if (isset($_POST['submitted'])) { // Check if the form has been submitted. require_once ('../****/mysql_connect.php'); // Connect to the database. // Validate the user name address. if (!empty($_POST['user_name'])) { $u = escape_data($_POST ['user_name']); } else { echo '<p><font color="red"size="-1"> You forgot to enter your User Name! </font></p>'; $u = FALSE; } // Validate the password. if (!empty($_POST['password'])) { $p = escape_data($_POST ['password']); } else { $p = FALSE; echo '<p><font color="red"size="-1"> You forgot to enter your password! </font></p>'; } if ($u && $p) { // If everything's OK. // Query the database. $query = "SELECT user_name FROM users WHERE (user_name='$u' AND password=SHA('$p')) AND active IS NULL"; $result = mysql_query ($query) or trigger_error ("Query: $query\n <br />MySQL Error: " . mysql_error()); if (@mysql_num_rows($result) == 1) { // A match was made. // Register the values & redirect. $row = mysql_fetch_array ($result,MYSQL_NUM); mysql_free_result($result); mysql_close(); $_SESSION['user_name'] = $row[1]; $_SESSION['user_id'] = $row[0]; ob_end_clean(); // Delete the buffer. header('Location: http://www.ourvegankitchen.com'); exit(); // Quit the script. } else { //No match was made. echo '<p><font color="red"size="-1">Either the user name and password entered do not match those on file or you have not yet activated your account.</font></p>'; } } else { echo '<p><font color="red"size="-1">Please try again. </font></p>'; } mysql_close(); } // End of SUBMIT conditional. ?> <p>Your browser must allow cookies in order to log in.</p> <form action="login.php"method="post"> <p><b>User Name:</b><br> <input type="text" name="user_name" size="20" maxlength="40" value="<?php if (isset($_POST ['user_name'])) echo $_POST['user_name']; ?>" /></p> <p><b>Password:</b> <br><input type="password" name="password" size="20" maxlength="20" /></p> <div align="center"><input type="submit" name="submit" value="Login" /></div> <input type="hidden" name="submitted" value="TRUE" /> </form> <a href ="../php/forgot_password.php">Forgot Password?</a> <?php include ('../php/footer.php'); ?> and here is the redirect if ($u && $p) { // If everything's OK. // Query the database. $query = "SELECT user_name FROM users WHERE (user_name='$u' AND password=SHA('$p')) AND active IS NULL"; $result = mysql_query ($query) or trigger_error ("Query: $query\n <br />MySQL Error: " . mysql_error()); if (@mysql_num_rows($result) == 1) { // A match was made. // Register the values & redirect. $row = mysql_fetch_array ($result,MYSQL_NUM); mysql_free_result($result); mysql_close(); $_SESSION['user_name'] = $row[1]; $_SESSION['user_id'] = $row[0]; ob_end_clean(); // Delete the buffer. header('Location: http://www.ourvegankitchen.com'); exit(); // Quit the script. } else { //No match was made. echo '<p><font color="red"size="-1">Either the user name and password entered do not match those on file or you have not yet activated your account.</font></p>'; } }
-
Im trying to display all the links that aren't approved. This is what I have [code]"SELECT u.url_id, url, title, description FROM urls AS u, url_associations AS ua WHERE u.url_id = ua.url_id AND ua.approved = 'N' ORDER BY date_submitted DESC";[/code] Unfortunately it displays [b]all[/b] the links. can someone help?
-
[Resolved] trying to set options for certain users
Seitan replied to Seitan's topic in PHP Coding Help
nevermind, I just took out the \n and that worked fine, thanks for the help -
[Resolved] trying to set options for certain users
Seitan replied to Seitan's topic in PHP Coding Help
[quote author=drifter link=topic=118093.msg482253#msg482253 date=1165782597] first if you use a single quote you can avoid escaping so many double quotes. second I believe multidemsional variables can not be parse good when in double quotes. third your parse error is because your if is in the quotes[/quote] Yeah that worked, except I have a \n\n\n\n at the top of the page -
Hey, I'm trying to set up options for certain users on my site, but I keep getting an error Here is my code [code]echo " <tr> <td align=\"left\"><a href=\"http://{$row['url']}\" target=\"_new\">{$row['title']}</a></td> <td align=\"left\">{$row['description']}</td> if ($_SESSION['user_id'] == '?' || $_SESSION['user_id'] == '?') { <td align=\"center\"><a href=\"edit_url.php?uid={$row['url_id']}\">edit</a></td> } </tr>\n";[/code] and here is my error [quote]Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /homepages/29/d178597021/htdocs/php/view_urls.php on line 74[/quote] Line 74 is the if statement, but it looks fine to me (but im a noob so that doesn't mean much). Could someone help?
-
cool thanks
-
by the way, how do I marked this resolved, do I just edit it and add [resolved] or is there a button or link?
-
Sweet thanks, that worked.
-
no that didn't work, I just got this instead [quote]Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /homepages/29/d178597021/htdocs/php/change_password.php on line 49[/quote]
-
Hey, I'm trying to put together a change password thing, and I keep getting a problem with it. Here is the error. [quote]Notice: Query: UPDATE `users` SET `password` = SHA('?), `active` = NULL WHERE `user_name` = somename MySQL Error: Unknown column 'somename' in 'where clause' in /homepages/29/d178597021/htdocs/php/change_password.php on line 50[/quote] Here is my SQL statement [code]"UPDATE `users` SET `password` = SHA('$p'), `active` = NULL WHERE `user_name` = {$_SESSION['user_name']}";[/code] The thing is, that there [b]is [/b]a record with the user_name somename. So I don't get with it. I've tried some variations, like changing it to user_id, but that doesn't work either.
-
[ resolved ] Having a problem with an if statement....again
Seitan replied to Seitan's topic in PHP Coding Help
nevermind, I just forgot a ' , anyways that totally helped, thanks...much appreciated :D -
[ resolved ] Having a problem with an if statement....again
Seitan replied to Seitan's topic in PHP Coding Help
I gotta a parse error when I put that line in. [code] Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /homepages/29/d178597021/htdocs/php/header.php on line 106[/code] -
[ resolved ] Having a problem with an if statement....again
Seitan replied to Seitan's topic in PHP Coding Help
Here is my session array [code] $row = mysql_fetch_array ($result,MYSQL_NUM); mysql_free_result($result); mysql_close(); $_SESSION['user_name'] = $row[1]; $_SESSION['user_id'] = $row[0]; [/code] And the if statement doesn't display the admin link at all now -
[ resolved ] Having a problem with an if statement....again
Seitan replied to Seitan's topic in PHP Coding Help
Well that looks good, but it doesn't work... -
[ resolved ] Having a problem with an if statement....again
Seitan posted a topic in PHP Coding Help
Alright, I need help with an if statement, I'm trying to add an admin link to my page, but only for users who have specific user id's....this is what I have so far [code]if ($_SESSION['user_id'] == '1' OR '2') { echo '<a href="../php/admin.php">Admin</a>'; }[/code] unfortunately the admin link shows up for everyone, so what am I doing wrong -
Actually I got it working, but you guys helped......I put the while statement at the beginning and then just put everything like [font=Verdana]$row['Submitted by'] or $row['Directions'][/font] So thank you for your help.
-
it doesn't work...I don't get anything now
-
yep that works, I replaced it with the number one, and I got the first ingredient, but I only get the first ingredient
-
Here is my new SQL statement, I tried picking every field individually [code]$query = "SELECT `Recipe Number`,`Recipe Name`,`Submitted By`,`Ingredient 1`,`Ingredient 2`,`Ingredient 3`,`Ingredient 4`,`Ingredient 5`,`Ingredient 6`,`Ingredient 7`,`Ingredient 8`,`Ingredient 9`,`Ingredient 10`,`Ingredient 11`,`Ingredient 12`,`Ingredient 13`,`Ingredient 14`,`Ingredient 15`,`Ingredient 16`,`Ingredient 17`,`Directions`,`Category`,`email`,`source_from` FROM `Recipes` WHERE `Recipe Number` = '$id'";[/code] and here is what I have for my output part now [code]<div align="center"><? echo 'Recipe Name'; ?></p> <p align="right">Submitted by<br> <?echo 'Submitted_by';?></p> <p align="left"> Ingredients:</p> <?while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo $row['Ingredient []'] ;?><br><? } ?><P><? echo 'Directions'; ?> <p align="left"> </p> </div>[/code]
-
I put that line in and it worked fine, so the query definitely worked.
-
I get [center]Recipe Name[/center] Submitted by Submitted_by Ingredients: Directions