Jump to content

xuniter

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by xuniter

  1. thanks, probably will use that upload script!
  2. Hi, i have in my script the following : $pid = mysql_insert_id(); //place image in the folder $newname = "$pid.jpg"; move_uploaded_file($_FILES['fileField']['tmp_name'],"../inventory_images/$newname"); header("location: inventory_list.php"); exit(); but i can't figure out how to upload more than one image. Thanks!
  3. [EDIT]: same...pages don't show anything ok i will fix that...hope that is the problem. Thanks
  4. Hi, so....i have these 2 pages, but they don't show up in browser....can't find the error so will ask your help guys index.php <?php session_start(); if(!isset($_SESSION["manager"])){ header("Location: admin_login.php"); exit(); } //Be sure to check that manager SESSION value is in database $managerID = preg_replace('#[^0-9]#i',",$_SESSION["id"]); // Filter everything but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["manager"]); //Filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["password"]); //Filter everything but numbers and letters //Run MySQL query to be sure that this person is an admin and that their password session var equals the database //Connect to the MySQL Database include("../storescripts/connect_to_mysql.php"); $sql = mysql_query("SELECT * FROM admin WHERE id='$managerID AND username='$manager' AND password='$password' LIMIT 1"); //search user $existsCount = mysql_num_rows($sql); //count the row numbers if ($existsCount == 0){ //evaluate the count header("Location: ../index.php"); exit(); } ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MyOnlineStore | Admin Area</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen"/> </head> <body> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php");?> <p><br /> <br /> </p> <p> </p> <p><br /> </p> <div id="pageContent"> <div id="admin" align="left"> <h3>Hello what you want to do?</h3> <p><a href="#">Manage Inventory</a><br /> <a href="#">Manage afggagdfag</a></p> </div> </div> <?php include_once("../template_footer.php");?> </div> <p> </p> <p> </p> <p> </p> </body> </html> admin_login.php <?php session_start(); if(!isset($_SESSION["manager"])){ header("Location: admin_login.php"); exit(); } //Be sure to check that manager SESSION value is in database $managerID = preg_replace('#[^0-9]#i',",$_SESSION["id"]); // Filter everything but numbers and letters $manager = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["manager"]); //Filter everything but numbers and letters $password = preg_replace('#[^A-Za-z0-9]#i',",$_SESSION["password"]); //Filter everything but numbers and letters //Run MySQL query to be sure that this person is an admin and that their password session var equals the database //Connect to the MySQL Database include("../storescripts/connect_to_mysql.php"); $sql = mysql_query("SELECT * FROM admin WHERE id='$managerID AND username='$manager' AND password='$password' LIMIT 1"); //search user $existsCount = mysql_num_rows($sql); //count the row numbers if ($existsCount == 0){ //evaluate the count header("Location: ../index.php"); exit(); } ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MyOnlineStore | Admin Area</title> <link rel="stylesheet" href="../style/style.css" type="text/css" media="screen"/> </head> <body> <div align="center" id="mainWrapper"> <?php include_once("../template_header.php");?> <p><br /> <br /> </p> <p> </p> <p><br /> </p> <div id="pageContent"> <div id="admin" align="left"> <h3>Hello what you want to do?</h3> <p><a href="#">Manage Inventory</a><br /> <a href="#">Manage afggagdfag</a></p> </div> </div> <?php include_once("../template_footer.php");?> </div> <p> </p> <p> </p> <p> </p> </body> </html>
  5. the problem was in server not in the script . The server had installed PHP4, when i changed to PHP5 it worked..... Grrr
  6. Hi, i am getting the following error message, but everything seems ok in script... Parse error: syntax error, unexpected ';' in /www/zxq.net/htdocs/admin/includes/functions.php on line 27 This is the code snippet: function addCat($cName, $cDesc) { $query = mysql_query("INSERT INTO categories VALUES(null,'$cName','$cDesc')") or die(mysql_error()); }
  7. WOW!!! Thank you so much, i was sitting all night trying to find the problem, and didn't saw that end tag! thanks!
  8. i have the following code which should redirect the user to the index.php page, but instead it shows error 404 page not found....Please if anyone see the problem help me login.php <?php session_start(); ?> <html> <head> <title>Basic CMS | Admin area Login</title> </head> <body> <?php if (isset($_SESSION['user'])) { header("Location: index.php"); } else { ?> <form action="dologin.php method="post"> <table> <tr> <td><span>Username:</span></td> <td><input type="text" name="username" /></td> </tr> <tr> <td><span>Password:</span></td> <td><input type="password" name="password" /></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="login" value="Login"/></td> </tr> </table> </form> <?php } ?> </body> </html> dologin.php <?php session_start(); ?> <html> <head> <title>Basic CMS | Admin area Login</title> </head> <body> <?php if (isset($_SESSION['user'])) { header("Location: index.php"); } else { ?> <form action="dologin.php method="post"> <table> <tr> <td><span>Username:</span></td> <td><input type="text" name="username" /></td> </tr> <tr> <td><span>Password:</span></td> <td><input type="password" name="password" /></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="login" value="Login"/></td> </tr> </table> </form> <?php } ?> </body> </html> index.php <?php session_start(); if(isset($_SESSION['user'])) { ?> <html> <head> <title>Basic CMS | Admin area</title> </head> <body> </body> </html> <?php } else { header("Location: login.php"); } ?>
  9. what is wrong? i have setup a site and still the same.... If i create a new page i can add a database. [attachment deleted by admin]
  10. thanks litebearer & thorpe, finally i got the whole idea and can proceed with
  11. ok now i will ask correctly sry about previous post, so how to make that the page will show different information using variables, example : www.domain.com/product.php?productid=42333 www.domain.com/product.php?productid=56326 It's the same page but it shows different info. Where can i read something about it or how it is called so i could search it Thank you very much
  12. thanks, but i want to know how to write the script so it could generate a .php with css...
  13. Hi, can someone help me to understand this? What i want to do is to write some information in a form and after i submit the form that data will be in a new php page. Thanks in advance
×
×
  • 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.