Jump to content

unidox

Members
  • Posts

    557
  • Joined

  • Last visited

    Never

Everything posted by unidox

  1. Use this: $q = mysql_query("SELECT * FROM `table` WHERE group = '1'"); $r = mysql_fetch_array($q); if($r['group'] == COOKIE/SESSION) { echo "Has access to the page"; } else { echo "Sorry, you do not have access to this page"; } Change the COOKIE/SESSION to whatever you use to store the users level who is browsing the page.
  2. Less is always better. Make a sql.inc.php page and include it on all the pages that use a query. More organized.
  3. Just do: $var1 = "blah"; $var2 = "blah2"; MYSQL_QUERY("INSERT INTO `table` (var1,var2) VALUES ('$var1', '$var2')");
  4. Use this: <? if (isset($_POST['AddToCart'])) { $qty = 1; foreach ($_POST["Component_ID"] as $type => $component) { // mysql_select_db($database_DM_database, $DM_database) or die(mysql_error()); mysql_query("INSERT INTO `tblshoppingcart` (Cookie_ID, Product_ID, Component_ID, qty) VALUES ('" . GetCartId() . ", " . intval($ProductID) . ", " . intval($component) . ", " . $qty . ")") or die (mysql_error()); } //header("Location: cart.php"); $ihateyou = $_POST['AddToCart']; } else { } ?> If that doesnt work, its something to do with the info being sent.
  5. Use $_SERVER['PHP_SELF'] It goes to the previous viewed page.
  6. It looks like its a server problem parsing the images.
  7. Use This to gen a random alphanum string: // Generates Random String $allow = "abcdefghijkmnpqrstuvwxyz23456789"; srand((double)microtime()*1000000); for($i=0; $i<8; $i++) { // Change $i<8; to a number of digits you want. I like 8. $activation .= $allow[rand()%strlen($allow)]; }
  8. Here u go: <?php if (isset($_POST['AddToCart'])) { $qty = "1"; foreach ($_POST["Component_ID"] as $type => $component) { // mysql_select_db($database_DM_database, $DM_database) or die(mysql_error()); mysql_query("INSERT INTO `tblshoppingcart` (Cookie_ID, Product_ID, Component_ID, qty) VALUES (" . GetCartId() . ", " . intval($ProductID) . ", " . intval($component) . ", " . intval($qty) . ")") or die (mysql_error()); } //header("Location: cart.php"); } else { $ihateyou = "I HATE YOU"; } ?>
  9. Here: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Welcome! - Powered By: Pure cP</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="incs/Style.css" rel="stylesheet" type="text/css" /> </head> <body bgcolor="#FFFFFF" style="margin:0px;"> <table id="Table_01" style="width: 1001; height: 1201;" border="0" cellpadding="0" cellspacing="0"> <tr> <td rowspan="41" style="background-image:url(images/demo_01.gif)" width="72"></td> <td colspan="3" rowspan="8"> <img src="images/demo_02.gif" width="180" height="66" alt="" /></td> <td colspan="6"> <img src="images/demo_03.gif" width="136" height="4" alt="" /></td> <td rowspan="3"> <img src="images/demo_04.gif" width="55" height="21" alt="" /></td> <td rowspan="8"> <img src="images/demo_05.gif" width="129" height="66" alt="" /></td> <td colspan="6" rowspan="2"> <img src="images/demo_06.gif" width="345" height="10" alt="" /></td> <td rowspan="8"> <img src="images/demo_07.gif" width="11" height="66" alt="" /></td> <td rowspan="41"> <img src="images/demo_08.gif" width="72" height="1200" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="4" alt="" /></td> </tr> <tr> <td colspan="5" rowspan="5"> <img src="images/demo_09.gif" width="50" height="40" alt="" /></td> <td rowspan="2"> <img src="images/demo_10.gif" width="86" height="17" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="6" alt="" /></td> </tr> <tr> <td colspan="6" rowspan="5"> <img src="images/demo_11.gif" width="345" height="47" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="11" alt="" /></td> </tr> <tr> <td> <img src="images/demo_12.gif" width="86" height="6" alt="" /></td> <td rowspan="2"> <img src="images/demo_13.gif" width="55" height="21" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="6" alt="" /></td> </tr> <tr> <td rowspan="2"> <img src="images/demo_14.gif" width="86" height="17" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="15" alt="" /></td> </tr> <tr> <td rowspan="3"> <img src="images/demo_15.gif" width="55" height="24" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="2" alt="" /></td> </tr> <tr> <td colspan="6" rowspan="2"> <img src="images/demo_16.gif" width="136" height="22" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="13" alt="" /></td> </tr> <tr> <td colspan="6"> <img src="images/demo_17.gif" width="345" height="9" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="9" alt="" /></td> </tr> <tr> <td colspan="18"> <img src="images/demo_18.gif" width="856" height="159" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="159" alt="" /></td> </tr> <tr> <td colspan="18"> <img src="images/demo_19.gif" width="856" height="60" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="60" alt="" /></td> </tr> <tr> <td colspan="5" rowspan="30" height="100%" style="background-image:url(images/demo_67.gif)" valign="top"> </td> <td rowspan="30"> <img src="images/demo_21.gif" width="1" height="878" alt="" /></td> <td colspan="9"> <img src="images/demo_22.gif" width="422" height="25" alt="" /></td> <td rowspan="30"> <img src="images/demo_23.gif" width="1" height="878" alt="" /></td> <td colspan="2" rowspan="30" style="background-image:url(images/demo_67.gif)" valign="top"> </td> <td> <img src="images/spacer.gif" width="1" height="25" alt="" /></td> </tr> <tr> <td colspan="9" rowspan="29" style="background-image:url(images/demo_65.gif)" valign="top"> <table><tr><td> </td><td> <div align="center" style="width:100%; display:block;"> <table align="center"> <tr> <td colspan="3"> <div align='center'>Welcome to the user section Pat Herlihy!</div></td> </tr> <tr> <td> <img border="0" src="http://www.pure-cp.com/beta/images/icons/profile.gif" width="100" height="89" /></td> <td> <img border="0" src="http://www.pure-cp.com/beta/images/icons/demos.gif" width="100" height="89" /></td> <td> <img border="0" src="http://www.pure-cp.com/beta/images/icons/downloads.gif" width="100" height="89" /></td> </tr> <tr> <td> <img border="0" src="http://www.pure-cp.com/beta/images/icons/gallery.gif" width="100" height="89" /></td> <td> <img border="0" src="http://www.pure-cp.com/beta/images/icons/media.gif" width="100" height="89" /></td> <td> <img border="0" src="http://www.pure-cp.com/beta/images/icons/servers.gif" width="100" height="89" /></td> </tr> <tr> <td colspan="3"> <div align="center"><br />You have logged in as an admin. To edit the site, please click below.</div></td> </tr> <tr> <td colspan="3"> <div align="center"> <img border="0" src="http://www.pure-cp.com/beta/images/icons/admin.gif" width="100" height="89" /></div></td> </tr> </table> </div> </td><td> </td></tr></table></td> <td> <img src="images/spacer.gif" width="1" height="14" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="7" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="69" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="3" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="5" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="9" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="2" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="23" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="2" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="92" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="16" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="25" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="26" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="20" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="7" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="25" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="30" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="25" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="39" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="40" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="18" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="57" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="1" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="36" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="1" height="190" alt="" /></td> </tr> <tr> <td colspan="18"> <map name="FPMap0"> <area href="" shape="rect" coords="779, 0, 855, 36"> </map> <img src="images/demo_68.gif" width="856" height="37" alt="" usemap="#FPMap0" border="0" /></td> <td> <img src="images/spacer.gif" width="1" height="37" alt="" /></td> </tr> <tr> <td> <img src="images/spacer.gif" width="72" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="6" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="50" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="124" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="29" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="7" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="3" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="86" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="55" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="129" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="49" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="70" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="10" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="1" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="205" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="11" height="1" alt="" /></td> <td> <img src="images/spacer.gif" width="72" height="1" alt="" /></td> <td></td> </tr> </table> </body> </html>
  10. Try this: if ($check_cookie == 1) { if ($_COOKIE['auth'] != "") { header("Location: " . $homepage_url . ""); exit(); } else $errstr = $cookie_warn_str;
  11. The source is: <table><tr><td> </td><td> <div align="center" style="width:100%; display:block;"> <table align="center"> <tr> <td colspan="3"> <div align='center'>Welcome to the user section...ect
  12. I only want some centered, not every page.
  13. still nothing. On my index.php where I am including it, this is the code: <table><tr><td> </td><td> <? if ($_GET['p']){ include("incs/files.inc.php"); } else { include("" . $site_url . "incs/files.inc.php?p=news"); } ?></td><td> </td></tr></table>
  14. Thorpe is right, I use apache,mysql,and php on my home machine for local testing. Google on setting up apache and then you can view locally. Otherwise you have to upload to a web server.
  15. This is my code: <div align="center"> <table align="center"> <tr> <td colspan="3"> <div align='center'>Welcome to the user section <? echo $r['name']; ?>!</div></td> </tr> <tr> <td> <img border="0" src="<? echo $site_url; ?>images/icons/profile.gif" width="100" height="89" /></td> <td> <img border="0" src="<? echo $site_url; ?>images/icons/demos.gif" width="100" height="89" /></td> <td> <img border="0" src="<? echo $site_url; ?>images/icons/downloads.gif" width="100" height="89" /></td> </tr> <tr> <td> <img border="0" src="<? echo $site_url; ?>images/icons/gallery.gif" width="100" height="89" /></td> <td> <img border="0" src="<? echo $site_url; ?>images/icons/media.gif" width="100" height="89" /></td> <td> <img border="0" src="<? echo $site_url; ?>images/icons/servers.gif" width="100" height="89" /></td> </tr> <? if($_SESSION['admin'] == 1) { ?> <tr> <td colspan="3"> <div align="center"><br />You have logged in as an admin. To edit the site, please click below.</div></td> </tr> <tr> <td colspan="3"> <div align="center"> <img border="0" src="<? echo $site_url; ?>images/icons/admin.gif" width="100" height="89" /></div></td> </tr> <? } ?> </table> </div> The text and images align, but not the table, so the table is to the left, but I am trying to get the table in the middle. Whats wrong? Thanks
  16. This is my code: // Variables $name = $_POST['name']; $dname = $_POST['display_name']; $username = $_POST['username']; $password = md5($_POST['password']); $email = $_POST['email']; $age = $_POST['age']; $dob = $_POST['dob']; $country = $_POST['country']; $location = $_POST['location']; $website = $_POST['website']; $aim = $_POST['aim']; $msn = $_POST['msn']; $yim = $_POST['yim']; $icq = $_POST['icq']; $info = $_POST['info']; $games = $_POST['games']; $interests = $_POST['interests']; // Query $q = mysql_query("SELECT * FROM `pcp_users` WHERE username = '$username' || email = '$email'"); $r = mysql_fetch_array($q); if(($r['username'] == $username) || ($r['email'] == $email)) { header("Location: " . $site_url . "index.php?p=register&e=1"); } if(($name == "") || ($dname == "") || ($username == "") || ($password == "") || ($email == "")) { header("Location: " . $site_url . "index.php?p=register&e=2"); } mysql_query("INSERT INTO `pcp_users` (username,password,email,display,name,description,age,dob,country,location,interest,website,aim,msn,icq,yim,games) VALUES ('$username','$password','$email','$dname','$name','$info','$age','$dob','$country','$location','$interests','$website','$aim','$msn','$icq','$yim','$games')") or die (mysql_error()); header("Location: " . $site_url . "index.php?p=login&e=4"); Now using that code, the header header("Location: " . $site_url . "index.php?p=login&e=4"); messes up the code, but if I comment that line out, then the code works fine. If I use it it forwards to " . $site_url . "index.php?p=login&e=4 when I am leaving form fields blank, but if I comment it out the, it corretly forwards it to " . $site_url . "index.php?p=register&e=2. Whats wrong? Thanks
  17. Thanks, I fixed it, I spelled a column wrong lol
  18. I made a register form and here is the code: // Variables $name = $_POST['name']; $dname = $_POST['display_name']; $username = $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; $age = $_POST['age']; $dob = $_POST['dob']; $country = $_POST['country']; $location = $_POST['location']; $website = $_POST['website']; $aim = $_POST['aim']; $msn = $_POST['msn']; $yim = $_POST['yim']; $icq = $_POST['icq']; $info = $_POST['info']; $games = $_POST['games']; $interests = $_POST['interests']; // Query $q = mysql_query("SELECT * FROM `pcp_users` WHERE username = '$username' || email = '$email'"); $r = mysql_fetch_array($q); if(($r['username'] == $username) || ($r['email'] == $email)) { header("Location: " . $site_url . "index.php?p=register&e=1"); } if(($name == "") || ($dname == "") || ($username == "") || ($password == "") || ($email == "")) { header("Location: " . $site_url . "index.php?p=register&e=2"); } mysql_query("INSERT INTO `pcp_users` (username,password,email,display,name,description,age,dob,country,location,interests,website,aim,msn,icq,yim,games) VALUES ('$username','$password','$email','$dname','$name','$info','$age','$dob','$country','$location','$interests','$website','$aim','$msn','$icq','$yim','$games')"); The problem is, when I try to register, nothing goes into the db. What am I doing wrong? Thanks
  19. That wouldnt work, cause in mt files.inc.php I have this: $request = $_REQUEST['p']; include("incs/conf.inc.php"); /*************************************************************** ******************* START HOME ********************************* ****************************************************************/ if($request == "admin_home") {
×
×
  • 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.