Jump to content

uramagget

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Everything posted by uramagget

  1. <? //Error Reporting error_reporting (E_ALL); I'm fetching data directly from the forums and it updates when your profile is. Cool, right? $dbhost = "mysql_real_escape(localhost)"; $dbname = "mysql_real_escape(*********)"; $dbusername = "mysql_real_escape(***********)"; $dbpassword = "mysql_real_escape(*******)"; //Tables for data fetching $users = "mysql_real_escape(mybb_users)"; $fields = "mysql_real_escape(mybb_profilefields)"; //Connect $mysql = mysql_connect("$dbhost", "$dbusername", "$dbpassword"); mysql_select_db($dbname, $mysql); //Query MemberBase 1 $sql1 = "mysql_real_escape(SELECT * FROM $users WHERE loyalty='staff')"; $result1 = @mysql_query($sql1); //Query MemberBase 2 $sql2 = "mysql_real_escape(SELECT * FROM $fields)"; $result2 = @mysql_query($sql2); while ($rows1=@mysql_fetch_array($result1)){ ?> <h2><? echo $rows1['username']; ?></h2> <img src="<? echo $rows1['avatar']; ?>"><br> <b>Position:</b> <? echo $rows1['position']; ?><br> <b>Birthdate:</b> <? echo $rows1['birthday']; ?><br> <b>E-Mail:</b> <? echo $rows1['email']; ?><br> <b>MSN:</b> <? echo $rows1['msn']; ?><br> <b>AIM:</b> <? echo $rows1['aim']; ?><br> <b>YIM:</b> <? echo $rows1['yahoo']; ?><br> <b>ICQ:</b> <? echo $rows1['icq']; ?><br> <? while ($rows2=@mysql_fetch_array($result2)){ ?> <b>Sprite Submissions:</b> <? echo $rows2['5']; ?> <b>Gender:</b> <? echo $rows2['3']; ?><br> <b>Personal Quote:</b> <? echo $rows2['6']; ?><br> <b>Stuffs:</b> <? echo $rows2['2']; ?><br> <? }} mysql_close($mysql); ?> $rows2 does not show anything at all, not even the bolded indicators (ie Sprite Submissions). I want to know how I can make a page select data from different tables, while keeping the loop working. This code simply shows the number of staff depending if their loyalty is staff. Though, this code shows their profile. everything works, except for what's in the $rows2 array. Can anybody assist me in this if possible?
  2. My problem was solved! Thanks! But, I want to give more user friendliness to my form. How would I go to creating checkboxes, instead of having to use those drop downs? Here is my current PHP code, working: <? //Let's see what ya sent in there, buddy boy $Email = Trim(stripslashes($_POST['Email'])); $GameName = Trim(stripslashes($_POST['GameName'])); $GameURL = Trim(stripslashes($_POST['GameURL'])); $Description = Trim(stripslashes($_POST['Description'])); $ScreenshotURL = Trim(stripslashes($_POST['ScreenshotURL'])); $compatibility = Trim(stripslashes($_POST['compatibility'])); $development = Trim(stripslashes($_POST['development'])); //Subject and Where to send mail to $EmailTo = "spaceyoshix@hotmail.com"; $Subject = "Fan Game Submission"; // Validate so nothing is left empty. Absolutely nothing, except "other" $validationOK=true; if (Trim($EmailFrom)=="") {$validationOK=false; echo "<p>E-Mail Field Empty</p>";} if (Trim($GameName)=="") {$validationOK=false; echo "<p>Game Name Field Empty</p>";} if (Trim($GameURL)=="") {$validationOK=false; echo "<p>Game URL Field Empty</p>";} if (Trim($Description)=="") {$validationOK=false; echo "<p>Description Field Empty</p>";} if (Trim($ScreenshotURL)=="") {$validationOK=false; echo "<p>Screenshot URL Field Empty</p>";} if (Trim($compatibility)=="") {$validationOK=false; echo "<p>Compatibility Field Empty</p>";} if (Trim($development)=="") {$validationOK=false; echo "<p>Development Field Empty</p>"; exit;} //if (!$validationOK) { // print "<meta http-equiv=\"refresh\" content=\"0;URL=missing.htm\">"; // exit; //} // // Get ready to send an email! // //Game Name $Body .= "Game Name: "; $Body .= $GameName; $Body .= "\n"; //Game URL $Body .= "Game URL: "; $Body .= $GameURL; $Body .= "\n"; //Description $Body .= "Description: "; $Body .= $Description; $Body .= "\n"; //Screenshot URL $Body .= "Screenshot URL: "; $Body .= $ScreenshotURL; $Body .= "\n"; //Compatibility $Body .= "Compatibility: "; $Body .= $compatibility; $Body .= "\n"; //Development $Body .= "Development: "; $Body .= $development; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$Email>"); // redirect to success page if ($success){ echo "IMAH CHARGIN MAH INBOX. SHOOP DA WHOOP!\n"; echo "Game Submission sent succesfully. Please wait for a reply from the webmaster."; exit; } else{ echo "E-Mail could not be sent. Please send manually, or contact the webmaster regarding this mistake, courtesy of Faltzer"; exit; } ?>
  3. Yeah, exactly what does that have to do with my error?
  4. Okay, my problem right now is, that I'm having troubles with a mail form. Here is the problem. I make it so all fields are required. And if none are filled out, then you're flung into a "missing fields" page. But for my form, I've filled them all out, but can't get it to work right. Here's both my HTML and PHP Code, with everything explained: formscript.php <? //Let's see what ya sent in there, buddy boy $Email = Trim(stripslashes($_POST['Email'])); $GameName = Trim(stripslashes($_POST['GameName'])); $GameURL = Trim(stripslashes($_POST['GameURL'])); $Description = Trim(stripslashes($_POST['Description'])); $ScreenshotURL = Trim(stripslashes($_POST['ScreenshotURL'])); $rating = Trim(stripslashes($_POST['rating'])); $compatibility = Trim(stripslashes($_POST['compatibility'])); $development = Trim(stripslashes($_POST['development'])); //Subject and Where to send mail to $EmailTo = "spaceyoshix@hotmail.com"; $Subject = "Fan Game Submission"; // Validate so nothing is left empty. Absolutely nothing, except "other" $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (Trim($GameName)=="") $validationOK=false; if (Trim($GameURL)=="") $validationOK=false; if (Trim($Description)=="") $validationOK=false; if (Trim($ScreenshotURL)=="") $validationOK=false; if (Trim($Other)=="") $validationOK=false; if (Trim($compatibility)=="") $validationOK=false; if (Trim($rating)=="") $validationOK=false; if (Trim($development)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=missing.htm\">"; exit; } // // Get ready to send an email! // //Game Name $Body .= "Game Name: "; $Body .= $GameName; $Body .= "\n"; //Game URL $Body .= "Game URL: "; $Body .= $GameURL; $Body .= "\n"; //Description $Body .= "Description: "; $Body .= $Description; $Body .= "\n"; //Screenshot URL $Body .= "Screenshot URL: "; $Body .= $ScreenshotURL; $Body .= "\n"; //Rating $Body .= "Rating: "; $Body .= $rating; $Body .= "\n"; //Compatibility $Body .= "Compatibility: "; $Body .= $compatibility; $Body .= "\n"; //Development $Body .= "Development: "; $Body .= $development; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$Email>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=sent.htm\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> index.php <form method="POST" action="formscript.php"> <p>All Fields required.</p> <p>Email:* </p> <p><input type="text" name="EmailFrom"></p> <p>Game Name:* </p> <p><input type="text" name="GameName"></p> <p>Game URL:* </p> <p><input type="text" name="GameURL"></p> <p>Description:* </p> <input type="text" name="Description"> <p>Screenshot URL:* </p> <input type="text" name="ScreenshotURL"> <p>Rating:* </p> <select name="rating"> <option value="" selected>Rating</option> <option value="E">Everyone</option> <option value="T">Teen</option> </select> <p>Compatibility:*</p> <select name="compatibility"> <option value="" selected>Compatibility</option> <option value="Windows">Windows XP</option> <option value="Vista">Vista</option> <option value="Mac">Macintosh</option> </select> <p>Development:*</p> <select name="development"> <option value="" selected>Development</option> <option value="gm5">Game Maker 5-</option> <option value="gm6">Gane Maker 6+</option> <option value="turbopascel">Turbo Pascel</option> <option value="flash">Flash</option> </select> <p><input type="submit" name="submit" value="Submit"></p> </form> If you need an exact preview, here you go: http://www.sprites-unlimited.com/submit/
  5. Well, as for how an hour, you'd set the seconds to 3600, and for a day, it's 86400 seconds.
  6. I've been trying to have this solved even by the List Apart people, but it won't work, so I have no idea as to why this is happening, because I haven't touched the code for it to be fubared.
  7. I've done the article re-read three times already and it won't work.
  8. There's nothing more to read, and in the first post I said that the styleswitcher just broke by itself, it didn't break because I modified anything. It _just_broke_
  9. It'd make partially no sense to map PHP to work for HTML files, because then it'd add a little extra load to your server for every HTML file. I think it's just a good idea to let PHP map to it's proper extensions (phtml, php, php3, etc.)
  10. http://www.alistapart.com/articles/phpswitch/ According to that, styleswitch.php sets the cookie, though it won't set it...
  11. So I add exit(); inside of every part that checks for empty fields like this? if (Trim($email)==""){ echo "You forgot to fill in your E-Mail"; exit(); } like this? Also, why don't I use die, instead of exit?
  12. <? include "top.txt"; // get posted data into local variables $username = Trim(stripslashes($_POST['username'])); $email = Trim(stripslashes($_POST['email'])); $password = Trim(stripslashes($_POST['password'])); $subdomain = Trim(stripslashes($_POST['subdomain'])); $currenturl = Trim(stripslashes($_POST['currenturl'])); //Send to, and subject. $emailto = "rindiny@pokerindin.com"; $subject = "PokeRindin Hosting"; // Check if filled in/empty if (Trim($email)==""){ echo "You forgot to fill in your E-Mail"; } elseif (Trim($username)==""){ echo "You forgot to fill in your Username"; } elseif (Trim($password)==""){ echo "You forgot to fill in your Password"; } elseif (Trim($subdomain)==""){ echo "You forgot to fill in your Subdomain"; } // prepare email body text $Body = ""; $Body .= "Username: "; $Body .= $username; $Body .= "\n"; $Body .= "Password: "; $Body .= $password; $Body .= "\n"; $Body .= "Sub-domain: "; $Body .= $subdomain; $Body .= "\n"; $Body .= "Current URL: "; $Body .= $currenturl; $Body .= "\n"; // send email $success = mail($emailto, $subject, $Body, "From: <$email>"); // redirect to success page if ($success){ echo "Your application was sent to Rindiny, and is awaiting approval. Can you join our forum while you wait, please?"; } else{ echo "Eeek! the form couldn't go through right. Only one thing to do. Contact Rindiny(rindiny@pokerindin.com), or try the form again. D: "; } include "bottom.txt"; ?> I'm trying to write a form where it makes users require them to fill it in, though even with the if code, the form is submitted, so I can't find out why this doesn't work.
  13. Try not to leave a space for the $_GET data, and see if it works. Not sure if it makes a difference though.
  14. styleswitch.php <? setcookie('sitestyle', $_POST['set'], time()+31536000); header("Location: ".$_SERVER['HTTP_REFERER']); ?> index.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Sprites Unlimited // The Ultimate Resource</title> <link href="http://sprites-unlimited.com/favicon.ico" rel="shortcuticon" type="image/icon"> <base href="sprites-unlimited.com/"> <link rel="stylesheet" type="text/css" title="default" href="<?php echo (!$sitestyle)?'default':$sitestyle ?>.css" /> <link rel="alternate stylesheet" type="text/css" title="blue" href="blue.css"> <link rel="alternate stylesheet" type="text/css" title="orange" href="orange.css"> <meta name="keywords" content="Sprites,SPRITES,sprites,sprites unlimited,megaman,pokemon,kirby,sprites unlimited,unlimited sprites,game sprites"> <meta name="description" content="Rather Mediocre collection of sprites for NES,SNES,N64,GBA,GB,Genesis, & more!"> <meta name="robots" content="index,follow"> <meta name="revisit-after" content="1"> </head> <body> <div id="header"> </div> <div id="container"> <div id="content"> <div align="center"> <form action="styleswitch.php" method="post"> <select name="set"> <option value="default" selected>56K White</option> <option value="orange">Classic Orange</option> <option value="blue">Icicle Blue</option> </select> <input type="submit" value="Change Style"> </form> <a href="http://www.dino-productions.net/"><img src="http://www.drunkduck.com/Megaman_EXE/gfx/DP.PNG" border="0" alt="Dino Productions"></a><BR> <a href="http://www.drunkduck.com/Megaman_EXE/index.php"><img src="http://www.drunkduck.com/Megaman_EXE/gfx/EXE.PNG" border="0" alt="Megaman EXE"></a><BR> <a href="http://www.sprites-unlimited.com/forum/index.php"><img src="http://www.drunkduck.com/Megaman_EXE/gfx/DPNET.PNG" border="0" alt="DP NET"></a><BR> </div> <hr> <?php //Main Variables $misc = "misc.php"; $news = "cutenews/show_news.php"; $error = "404.php"; $ext = ".php"; //Include Misc stuff include $misc; //Include News, and use ?id= if(!isset($_GET['id'])){ include $news; } elseif($_GET['id'] == "main") { include $misc; include $news; } elseif(isset($_GET['id']) && file_exists($_GET['id'].$ext)){ include $_GET['id'].$ext; } //404 Error Page else{ include $error; } ?> </div> <div align="center"> <a href="http://www.drunkduck.com/Megaman_EXE/index.php" target="_blank"><img src="http://img79.imageshack.us/img79/7898/syxbh4.png" border="0" alt="By me"></a> </div> <div id="leftmenu"> <ul> <h1>Site</h1> <ul> <li><a href="/">Home</a></li> <li><a href="?id=Tutorial">Ripping tutorial</a></li> <li><a href="?id=staff">Staff</a></li> <li><a href="?id=Contact">Submit/Contact</a></li> <li><a href="?id=LinkUs">Link to Us</a></li> <li><a href="?id=Links">Links</a></li> <li><a href="?id=disclamer">Disclaimer</a></li> </ul> <h1>Games</h1> <ul> <li><a href="?id=Classic">Classic</a></li> <li><a href="?id=NES">NES</a></li> <li><a href="?id=SNES">SNES</a></li> <li><a href="?id=GBC">Game Boy</a></li> <li><a href="?id=GBA">GBA</a></li> <li><a href="?id=Genisis">Genesis</a></li> <li><a href="?id=DS">Nintendo DS</a></li> <li><a href="?id=PC">PC/Internet</a></li> <li><a href="?id=Custom">Custom</a></li> <li><a href="?id=map">Game Maps</a></li> </ul> <h1>Affiliates</h1> <ul> <li><a href="http://www.sprites-inc.co.uk/" target="_blank"><img src="http://img144.imageshack.us/img144/9117/inchs4.png" border="0" alt="Sprites Inc."></a></li> <li><a href="http://www.parahosting.net/" target="_blank"><img src="http://www.parahosting.net/images/button2.png" border="0" alt="Parasyte Hosting"></a></li> <li><a href="http://www.pokeuniverse.co.nr" target="_blank"><img src="http://i15.photobucket.com/albums/a396/ACTIONGAMER/affybuttons/affylink9cs.png" border="0" alt="Pokeuniverse"></a></li> <li><a href="http://www.bmestudioz.com/" target="_blank"><img src="http://i15.photobucket.com/albums/a396/ACTIONGAMER/affybuttons/bmestudioz.gif" border="0" alt="BME Studioz"></a></li> <li><a href="http://www.vglan.com/" target="_blank"><img src="images/VGlan.PNG" border="0" alt="Video Game LAN"></a></li> </ul> <h1>Topsites</h1> <ul> <a href="http://www.parahosting.net/topsites/index.php?a=in&u=spaceyoshix"><img src="http://www.parahosting.net/topsites/button.php?u=spaceyoshix" alt="Parasyte Top10 Hostees" border="0" /></a> <a href="http://www.bmestudioz.com/topsites/" target="_blank"><img src="http://www.bmestudioz.com/topsites/button.php?u=spaceyoshix" alt="BME StudioZ Topsites" border="0" /></a> </ul> <h1>Links</h1> <ul> <li><a href='http://tsgk.captainn.net/' target="_blank"><img src="http://tsgk.captainn.net/img/banner_88x31_tsgk-03.png" border=0 alt='The ShyGuy Kingdom'></a></li> </ul> <h1>Statistics</h1> <ul> <li><script type="text/javascript" language="javascript"> var sc_project=1751497; var sc_invisible=0; var sc_partition=16; var sc_security="7f833bfb"; var sc_text=2; </script> Hits:<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c17.statcounter.com/counter.php?sc_project=1751497&java=0&security=7f833bfb&invisible=0" alt="site stats" border="0"></a> </noscript></li> <li>Online:<script type="text/javascript" src="http://fastonlineusers.com/on3.php?d=www.sprites-unlimited.awardspace.com"></script></li> </ul> </ul> </div> </div> </div> </body> </html> I'm using PHP 5.2.3
  15. That doesn't work, it returns the same results. EDIT: I'm using PHP 5.2.3, if that helps.
  16. Why don't you just review the way phpBB's login works instead by looking through the code?
  17. Referer works, though the cookie is not set. I can't seem to find my problem, it came out of the nowhere. Here's my stylesheet declaration: <link rel="stylesheet" type="text/css" title="default" href="<?php echo (!$sitestyle)?'default':$sitestyle ?>.css" /> <link rel="alternate stylesheet" type="text/css" title="blue" href="blue.css"> <link rel="alternate stylesheet" type="text/css" title="orange" href="orange.css">
  18. The code doesn't work, even though it stops the blank page. If you could, please check my page source code: http://sprites-unlimited.com
  19. Hi, recently, before I moved hosts, my styleswitcher was working fine. Right now, I was trying to set the style, but it wouldn't work. Here's an example: http://www.sprites-unlimited.com/ The code in styleswitch.php is as follow: <?setcookie ('sitestyle', $set, time()+31536000, '/', 'sprites-unlimited.com', '0'); header("Location: $HTTP_REFERER"); ?> Yes, it's that A List Apart article, if you recognize this. It won't work. It returns a blank page for no reason. I made sure my style sheets existed.
  20. Hm? Wouldn't using mysql_real_escape protect, partially from malicious users?
  21. Wow, that worked like a charm! Thank you very much for your help, corillo181, and john. I got my form working.
  22. Alright, so now, if I want to make a field optional without showing a mySQL error if it's not filled in, what should I do now?
  23. Hi, I'm making a registration form, and I need help with the form fields. How can I make fields OPTIONAL, and how can I make it so users HAVE to fill in a certain field in order to register? Here's my current code: register.php <html> <head> <title>UniDex - Registration</title> <link rel="stylesheet" href="style.css" type="text/css"> <style type="text/css"> #content { border: 1px solid #006699; background:white; padding-top: 20px; text-align:center; } </style> </head> <body> <div id="content"> <form action="register2.php" method="post"> <table width="100%" align="center"> <h2>Registrater for UniDex</h2> <p>Fields marked with a Poke Ball are required.</p> <tr> <td><img src="images/pokeball.png" alt="Required Field">Username</td> <td><input name="uname" type="text"></td> </tr> <tr> <td><img src="images/pokeball.png" alt="Required Field">Password</td> <td><input name="pass" type="password"></td> </tr> <tr> <td><img src="images/pokeball.png" alt="Required Field">E-Mail</td> <td><input name="email" type="text"></td> </tr> <tr> <td><input name="submit" value="Register" type="submit"></td> </tr> </table> </form> </div> </body> </html> register2.php <? $pagename = "Registration"; include "session2.inc.php"; include "../config.inc.php"; include "top.txt"; //Connect to mySQL Database mysql_connect("$host", "$username", "$password")or die("Can't connect"); mysql_select_db("$db_name")or die("Can't connect"); // Get the information the user submitted for registration $uname=$_POST['uname']; $pass=$_POST['pass']; $email=$_POST['email']; // Encrypt the password using MD5, to safely store the password. $md5pass=md5($password); $tbl_name = "admins"; $sql = "INSERT INTO $tbl_name (`uname` , `pass` , `email`) VALUES ('$uname' , '$md5pass' , '$email')"; $result=mysql_query($sql) or die("Error: ". mysql_error(). " with query ". $sql); if($result){ echo "Thank you for registering, $uname. You may now <a href=\"index.php\">Login</a>"; } else { echo "There was a mistake processing your registration. Go <a href=\"register.php\">back</a> and try again. ^^;"; } mysql_close(); include "bottom.txt"; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.