Jump to content

sjones

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Everything posted by sjones

  1. Hello, I am making a simple login script, and I can’t get the proper results from the query. I will post the code below. When I enter the username and password, I query the database for a match and it comes back that it does not match. I have gone to the phpmyadmin and changed the password several times to the same password that I am typing in. I have it in a password field in the database. I am wondering if the MySQL Collation has anything to do with it?? Could you please look at my code and see if you can find anything that may be interfering with positive results. I have redone this script several times, I have confirmed that the mysql_connect.php include is working. I have looked at the error logs and below is the only error in there: ERROR LOG PHP Notice: Undefined variable: logged_in_user in /home/virtual/site11/fst/var/www/html/new2009/properties/index.php on line 13, referer: http://www.bdrycleveland.com/new2009/properties/index.php I am suspecting the password field (Just a hunch) Here is the code: <?php session_start() ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <?php if ($username && $password) { if ($logged_in_user == $username) { echo $username. ", you are already logged in.<br><br>"; exit(); } require_once ('../connections/mysql_connect.php'); $result = mysql_query("SELECT * FROM user WHERE user_name = '".$username."' AND user_password = PASSWORD('".$password."')"); if (!$result) { echo "Sorry, there has been a technical hitch. We cannot enter your details."; exit(); } if (mysql_num_rows($result) >0 ) { $logged_in_user = $username; session_register("logged_in_user"); echo "Welcome, ".$logged_in_user.".<br><br>"; exit(); } else { echo "Invalid login, Please try again.<br><br>"; } } else if ($username || $password) { echo "Please fill in both fields<br><br>"; } ?> <form method="post" action="index.php"> <p>Username:<br><input name="username" type="text" size="12" maxlength="12"></p> <p>Password:<br><input name="password" type="password" size="12" maxlength="12"></p> <p><input name="submit" type="submit" value="Submit"></p> </form> </body> </html> The Database table is very simple also: Field Type Collation Attributes Null Default Extra Action user_id smallint(5) UNSIGNED ZEROFILL No auto_increment user_name varchar(12) latin7_general_cs No user_password varchar(12) latin7_general_cs No Thanks for any help.
  2. I have two tables one for products (product) and one for orders (orders) The product description is in the product table (product_short_desc). However the session_id is in the orders table (cart_session_id) this query below will return everything from the orders table (but no product description obviously) $query = "SELECT * FROM orders WHERE (cart_session_id = '".$sid."')"; ___________________________________________________ Then I tried this one and get "Zero" results $query = "SELECT orders.product_name, orders.cart_quantity, product.product_short_desc FROM orders, product WHERE orders.cart_session_id = '".$sid."' AND orders.product_name = product.product_name"; I'm just in building phase now so any suggestions on how I can achieve this will be helpfull - Thanks
  3. The other user had pointed out that I did not put the PHP in tags and that it was hard to read. So I marked the other one as solved and posted the topic with the PHP in tags. I did not see a way to edit the original post or I would have put the tags around the original. If you know a way of editing the original, I would be happy to put that in quotes.
  4. Hello, I am working on a site and I need some guidance please. I have a form that I would like to store two values in a session. All I need is the product and the quantity. Now I get the product from the form fields – size, color, logo, and voltage using a switch/case. And I get the quantity from the form field quantity. I would like to store these values in a session variable and be able to go back and add to, delete, or edit the variable. My goal is to be able to figure out what products and quantity the client needs. Then send email order to the warehouse for processing. I am having trouble storing the value and adding to it, whenever I go back and use the form the only output I get is the current values. It over writes the old data. If you want to visit what I have now you can see it at (http://www.rediheat.com/feb2008/order.php?f=single_pie) the only form working now is single_pie Any Help? here is my code: <?php include 'includes/header.inc'; ?> <table width="887" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><img src="images/spacer.gif" width="880" height="1"></td> <td rowspan="2"><img src="images/spacer.gif" width="7" height="466"></td> </tr> <tr> <!-- This is where the ordering form will be placed --> <td valign="top" class="product_article" style="background-image:url(images/order_page_bg.jpg); background-repeat:no-repeat; "> <div style="padding-left:14px; padding-top:10px; "> <!-- This area is where the include files will be --> <?php $allowed_inc = array('single_pie', 'multi_pie', 'food_service', 'element'); if (isset($_POST['single_pie_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE require_once ('connection/mysql_connect.php'); // Connect to the database. $error_message = ""; if ($size != "blank") { $size = $_POST['size']; } else { $error_message .= "<p>You forgot to enter a size</p> "; } if ($color != "blank") { $color = $_POST['color']; } else { $error_message .= "<p>You forgot to choose a color!</p> "; } if ($logo!= "blank") { $logo = $_POST['logo']; } else { $error_message .= "<p>You need to choose if you would like a logo on your bag </p> "; } if ($voltage!= "blank") { $voltage = $_POST['voltage']; } else { $error_message .= "<p>You did not choose the electrical voltage that you require </p>"; } if ($quantity != "") { $quantity = $_POST['quantity']; } else { $error_message .= "<p>You did not select a quantity </p>"; } if (strlen($error_message) > 1) { // IF THERE WAS AN ERROR echo $error_message . "<p>Click <a href='javascript:history.back()'>here</a> to go back</p>"; echo "</div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } else { // WE NEED TO PROCESS THE ORDER NOW if ($size && $color && $logo && $voltage && $quantity) { // IF ALL VARIABLES ARE TRUE ############################## ## SWITCH / CASE ### ############################## $product = $size . $color . $logo . $voltage; switch ($product) { case '16redno110'; $prod='HP101'; break; case '16redno220'; $prod='HP105'; break; case '16redyes110'; $prod='HP103'; break; case '16redyes220'; $prod='HP108'; break; case '16blackno110'; $prod='HP113'; break; case '16blackno220'; $prod='HP115'; break; case '16blackyes110'; $prod='HP114'; break; case '16blackyes220'; $prod='HP116'; break; case '16greenno110'; $prod='HP119'; break; case '16greenyes110'; $prod='HP120'; break; case '16greenno220'; $prod='HP000'; break; case '16greenyes220'; $prod='HP000'; break; case '18redno110'; $prod='HP102'; break; case '18redno220'; $prod='HP106'; break; case '18redyes110'; $prod='HP104'; break; case '18redyes220'; $prod='HP109'; break; case '18blackno110'; $prod='HP112'; break; case '18blackno220'; $prod='HP117'; break; case '18blackyes110'; $prod='HP110'; break; case '18blackyes220'; $prod='HP118'; break; case '18greenno110'; $prod='HP121'; break; case '18greenyes110'; $prod='HP122'; break; case '18greenno220'; $prod='HP000'; break; case '18greenyes220'; $prod='HP000'; break; } ############################## ## END OF SWITCH / CASE ## ############################## $cart_prod = $prod. "," .$quantity. "-" ; session_register('cart_prod'); echo $cart_prod; echo " </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } } } if (isset($_POST['multi_pie_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE echo "Multi pie submit button was set </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } if (isset($_POST['food_service_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE echo "Food service submit button was set </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } if (isset($_POST['element_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE echo "Element submit button was set </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } // page specified -> load content from relevant text file if (isset($_GET['f']) and in_array($_GET['f'], $allowed_inc)) { include("includes/" . $_GET['f'] . ".inc"); // no page specified -> load content from default.inc } else { include("includes/products_default.inc"); } ?> <!-- This area is the end of the include files --> </div> </td> </tr> </table> <?php include 'includes/footer.inc'; ?>
  5. Hello, I am working on a site and I need some guidance please. I have a form that I would like to store two values in a session. All I need is the product and the quantity. Now I get the product from the form fields – size, color, logo, and voltage using a switch/case. And I get the quantity from the form field quantity. I would like to store these values in a session variable and be able to go back and add to, delete, or edit the variable. My goal is to be able to figure out what products and quantity the client needs. Then send email order to the warehouse for processing. I am having trouble storing the value and adding to it, whenever I go back and use the form the only output I get is the current values. It over writes the old data. If you want to visit what I have now you can see it at (http://www.rediheat.com/feb2008/order.php?f=single_pie) the only form working now is single_pie Any Help? here is my code: <?php include 'includes/header.inc'; ?> <table width="887" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><img src="images/spacer.gif" width="880" height="1"></td> <td rowspan="2"><img src="images/spacer.gif" width="7" height="466"></td> </tr> <tr> <!-- This is where the ordering form will be placed --> <td valign="top" class="product_article" style="background-image:url(images/order_page_bg.jpg); background-repeat:no-repeat; "> <div style="padding-left:14px; padding-top:10px; "> <!-- This area is where the include files will be --> <?php $allowed_inc = array('single_pie', 'multi_pie', 'food_service', 'element'); if (isset($_POST['single_pie_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE require_once ('connection/mysql_connect.php'); // Connect to the database. $error_message = ""; if ($size != "blank") { $size = $_POST['size']; } else { $error_message .= "<p>You forgot to enter a size</p> "; } if ($color != "blank") { $color = $_POST['color']; } else { $error_message .= "<p>You forgot to choose a color!</p> "; } if ($logo!= "blank") { $logo = $_POST['logo']; } else { $error_message .= "<p>You need to choose if you would like a logo on your bag </p> "; } if ($voltage!= "blank") { $voltage = $_POST['voltage']; } else { $error_message .= "<p>You did not choose the electrical voltage that you require </p>"; } if ($quantity != "") { $quantity = $_POST['quantity']; } else { $error_message .= "<p>You did not select a quantity </p>"; } if (strlen($error_message) > 1) { // IF THERE WAS AN ERROR echo $error_message . "<p>Click <a href='javascript:history.back()'>here</a> to go back</p>"; echo "</div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } else { // WE NEED TO PROCESS THE ORDER NOW if ($size && $color && $logo && $voltage && $quantity) { // IF ALL VARIABLES ARE TRUE ############################## ## SWITCH / CASE ### ############################## $product = $size . $color . $logo . $voltage; switch ($product) { case '16redno110'; $prod='HP101'; break; case '16redno220'; $prod='HP105'; break; case '16redyes110'; $prod='HP103'; break; case '16redyes220'; $prod='HP108'; break; case '16blackno110'; $prod='HP113'; break; case '16blackno220'; $prod='HP115'; break; case '16blackyes110'; $prod='HP114'; break; case '16blackyes220'; $prod='HP116'; break; case '16greenno110'; $prod='HP119'; break; case '16greenyes110'; $prod='HP120'; break; case '16greenno220'; $prod='HP000'; break; case '16greenyes220'; $prod='HP000'; break; case '18redno110'; $prod='HP102'; break; case '18redno220'; $prod='HP106'; break; case '18redyes110'; $prod='HP104'; break; case '18redyes220'; $prod='HP109'; break; case '18blackno110'; $prod='HP112'; break; case '18blackno220'; $prod='HP117'; break; case '18blackyes110'; $prod='HP110'; break; case '18blackyes220'; $prod='HP118'; break; case '18greenno110'; $prod='HP121'; break; case '18greenyes110'; $prod='HP122'; break; case '18greenno220'; $prod='HP000'; break; case '18greenyes220'; $prod='HP000'; break; } ############################## ## END OF SWITCH / CASE ## ############################## $cart_prod = $prod. "," .$quantity. "-" ; session_register('cart_prod'); echo $cart_prod; echo " </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } } } if (isset($_POST['multi_pie_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE echo "Multi pie submit button was set </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } if (isset($_POST['food_service_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE echo "Food service submit button was set </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } if (isset($_POST['element_submit'])) { // THIS IS WHERE THE PRODUCTS WILL BE ADDED TO THE DATABASE echo "Element submit button was set </div> </td> </tr> </table>"; include 'includes/footer.inc'; exit(); } // page specified -> load content from relevant text file if (isset($_GET['f']) and in_array($_GET['f'], $allowed_inc)) { include("includes/" . $_GET['f'] . ".inc"); // no page specified -> load content from default.inc } else { include("includes/products_default.inc"); } ?> <!-- This area is the end of the include files --> </div> </td> </tr> </table> <?php include 'includes/footer.inc'; ?>
  6. Hello, I am working on a site for a small town newspaper. They have about 5 people that will FTP articles in .pdf format. Each article is between 500K and 2mg – approximately 30 pages, so 60mg max. I setup a user named “news” on the server, so everyone can access the same directory. I setup the FTP site “news” and the current issue is to be put in a folder called “current_issue”. However, I can not CHMOD this directory. (it is restricted) - with it being restricted I can’t call the .pdf file into the page with an include statement. I talked with tech support this morning and they said I could setup a “symbolic link” on the UNIX server to the "news/current_issue" directory and I’m not quite sure how that will work. The purpose of the FTP site was to allow them to just upload the current issue and always name the page "current_1.pdf", "current_2.pdf" and so on.... (for page one and two) and then the php script would look for current_1.pdf or whatever in the "news" FTP directory . Has anyone come across this or does anyone have any suggestions as to the path they would take.
  7. I have looked in the php.ini file and error reporting is ON. I still don't have any idea why this won't work. The following line of code was added. $result = mysql_query($query) or die ("Error in: $query" .mysql_error()); Not only did I get no errors, the script continued and did not die??? I am answering one of the above questions with the code below, Any thoughts? _____________________________ The variables are defined in this table. //////////THIS IS THE FORM THAT FEEDS THE TOP FORM THE INFO/////// if (isset($_GET['submit'])) { $article_id == $_GET['article_id']; if ($article_id < 1 ){ echo "<span class='nav_default'>You did not select an article.</span><br><br>"; echo "<span class='default'><a href='javascript:history.back()'><strong>Back</strong></a></span>"; include 'footer.inc'; exit(); }else{ include '../connections/mysql_connect.php'; $query = "SELECT * FROM news WHERE id ='".$article_id."';" ; $result = mysql_query($query); $record = mysql_fetch_assoc($result); echo "<form action='edit_news.php' method='post' name='article_select'> <p class='default'><strong>News Headline/Title: </strong><br> <input name='title' type='text' size='50' maxlength='120' value='".$record['title']."'> <br> <br> <strong>Author:</strong> <br> <input name='author' type='text' size='50' maxlength='120' value='".$record['author']."'> <br> <br> <strong>Do You want this article to appear on the Main Page?</strong> <br> <input name='main_page' type='checkbox' value='yes'>Yes <input name='main_page' type='checkbox' value='no'>No<br><br> <strong>Article Text:</strong><br> <textarea name='description' cols='50' rows='6'>".$record['description']."</textarea> <br> <br> </p> <p> <input name='submit' type='submit' value='Submit'> <input name='reset' type='reset'> </p> </form> <p style='width:480px; '><span class='nav_default'><strong>* </strong>If you would like to add an image to this article. You will need to use the 'Add Image to News Article' link in the Image section of the Main admin page. After you submit this article.</span></p>"; include 'footer.inc'; exit(); } }
  8. When I tried this fix from the firs reply. $result = mysql_query($query) or die ("Error in: $query" mysql_error()); My page won't even open and I get no error. Just a blank page. Any thoughts?
  9. Hello, I have worked many hours to troubleshoot why this won't work. I have read at least 15 post on UPDATE. I still can't get this to work. When I submit the form. It says that the udate took place, however it did not. I will put the form below, this is the section that is supposed to update the DB. I will also put the form below this one that feeds the info. Any help would be greatly appreciated. //UPDATE FORM///////// if ($title && $description && $main_page) { $news_id = $_POST['id']; $title = $_POST['title']; $description = $_POST['description']; $author = $_POST['author']; $main_page_display = $_POST['main_page']; include '../connections/mysql_connect.php'; $query = "UPDATE `news` SET `title` = '".$_POST['title']."', `description` ='".$_POST['description']."', `author` ='".$_POST['author']."' , `main_page` ='".$_POST['main_page_display']."' WHERE `id` ='".$_POST['id']."';" ; $result = mysql_query($query); if ($result) { if ($main_page_display == "yes") { $mpd = "This article will be displayed on the Main Page"; }else{ $mpd = "This article will not be displayed on the Main Page"; } echo "<span class='default'><strong>The following information has been changed in the database!</strong><br><br> <strong>Title:</strong> ".$title. "<br><strong>By:</strong> ".$author."<br><br> <strong>" .$mpd. "</strong><br><br> <strong>Description:</strong><br>".$description."<br><br> <a href='edit_news.php'>Click here to edit another article</a> <a href='index.php'>Click here to go to the main page</a> <a href='logout.php'>Click here to Logout</a>"; }else{ echo "No results where edited in the Database"; } } echo "<span class='default'><a href='javascript:history.back()'>Back</a></span>"; include 'footer.inc'; exit; } ////////// END OF TOP FORM ////////////////////// //////////THIS IS THE FORM THAT FEEDS THE TOP FORM THE INFO/////// if (isset($_GET['submit'])) { $article_id == $_GET['article_id']; if ($article_id < 1 ){ echo "<span class='nav_default'>You did not select an article.</span><br><br>"; echo "<span class='default'><a href='javascript:history.back()'><strong>Back</strong></a></span>"; include 'footer.inc'; exit(); }else{ include '../connections/mysql_connect.php'; $query = "SELECT * FROM news WHERE id ='".$article_id."';" ; $result = mysql_query($query); $record = mysql_fetch_assoc($result); echo "<form action='edit_news.php' method='post' name='article_select'> <p class='default'><strong>News Headline/Title: </strong><br> <input name='title' type='text' size='50' maxlength='120' value='".$record['title']."'> <br> <br> <strong>Author:</strong> <br> <input name='author' type='text' size='50' maxlength='120' value='".$record['author']."'> <br> <br> <strong>Do You want this article to appear on the Main Page?</strong> <br> <input name='main_page' type='checkbox' value='yes'>Yes <input name='main_page' type='checkbox' value='no'>No<br><br> <strong>Article Text:</strong><br> <textarea name='description' cols='50' rows='6'>".$record['description']."</textarea> <br> <br> </p> <p> <input name='submit' type='submit' value='Submit'> <input name='reset' type='reset'> </p> </form> <p style='width:480px; '><span class='nav_default'><strong>* </strong>If you would like to add an image to this article. You will need to use the 'Add Image to News Article' link in the Image section of the Main admin page. After you submit this article.</span></p>"; include 'footer.inc'; exit(); } }
  10. O.K I have solved it - This returns the the title and the URL - hopefully helpfull for the archive <marquee scrolldelay="160" width="594" direction="left"> <?php include 'connections/mysql_connect.php'; $sql = 'SELECT * FROM `events` ORDER BY `date_created` LIMIT 0, 30'; $result = mysql_query($sql); while ($record = mysql_fetch_assoc($result)){ echo "<a href=".$record['url'].">".$record['title']. "</a> " ; } ?> </marquee>
  11. That code above does not work for returning the url - its all just one big <a href> with the value of the last url returned. any help on how to return the title and url from the DB and scroll it in a marquee.??
  12. O.K so I have changed it to this <marquee scrolldelay="160" width="594" direction="left"> <?php include 'connections/mysql_connect.php'; $sql = 'SELECT * FROM `events` ORDER BY `date_created` LIMIT 0, 30'; $result = mysql_query($sql); while ($record = mysql_fetch_assoc($result)){ $text .= $record['title'].' '; } echo "<span class='default'>" .$text. " </span>"; ?> </marquee> ____________________________________________________________________ This ia returning the titles in one line. Now I have to work on the <a href> tag that will pull the URL for the article that goes with the headline that was returned. Will what I have below work? - using the $url <marquee scrolldelay="160" width="594" direction="left"> <?php include 'connections/mysql_connect.php'; $sql = 'SELECT * FROM `events` ORDER BY `date_created` LIMIT 0, 30'; $result = mysql_query($sql); while ($record = mysql_fetch_assoc($result)){ $url = $record['url']; $text .= $record['title'].' '; } echo "<span class='default'><a href=".$url.">" .$text. "</a> </span>"; ?> </marquee>
  13. Hello, I'm trying to return titles of events and scroll them in a <marquee> tag -but they are stacked on top of each other. Is there a way to have them one after another. Below is the code I am using. <? include 'connections/mysql_connect.php'; $sql = 'SELECT * FROM `events` ORDER BY `date_created` LIMIT 0, 30'; $result = mysql_query($sql); while ($record = mysql_fetch_assoc($result)){ $text = $record['title']; echo "<marquee scrolldelay='160' width='594' direction='left'><span class='default'><a href='news.php'>" .$record['title']. "</a></span></marquee>"; } ?>
  14. Hello, I am trying to have a form that gives a user 8 different choices. These would be with radio buttons. The user can select as many of those that they want, from 0-8. I then want to echo the results in the handle_form.php script. QUESTION: would I set up the form using something like: <input name="choice" type="checkbox" value="choice1"> <input name="choice" type="checkbox" value="choice2"> <input name="choice" type="checkbox" value="choice3"> or would I use <input name="choice1" type="checkbox" value="true"> <input name="choice2" type="checkbox" value="true"> <input name="choice3" type="checkbox" value="true"> And then I need to know how to get only the results that the user checked in the handle_form.php script. $choice = $_POST['choice']; for ($i =0; $i < count($choice); $i++) echo $choice[$i] . ", "; I know this may be very simple but my brain is not working correctly. when I use a similar code I only get the first letter of the value and if a user selects more that one choice I only get the first letter of the last choice.??? Any help would be appreciated
  15. O.K. - I'm using this code. $text = $record['description']; echo "<p><span class='eventsLocation2'>" .$record['title']. "</span><br><br><div align='right'>" . join(' ', array_slice (explode(' ', $text), 0, 12)) . " <a href='news.php'><span class='read_more'>....READ MORE</span></a></div></p><br>"; I'm running into a problem when the description that is typed in has any type of formatting such as <b></b> if the closing tag is not before the cutoff then all of the other entries are bold. You can view this example @ http://www.cwptechnologies.com/2007newsite/index.php - if you look at the right side of the page you will see the truncated events section and you will see that once the bold tag was used it was never closed. Any thoughts?
  16. Hey everyone thanks for the help. I used Alpine's method. It seemed to be a global fix to the issue. Thanks again! You guys are GREAT!
  17. Hello I'm trying to query the DB and retrieve the results for the description text area. I would then like to trim it down for a small preview and then I will use a link to get to the full description. My ? is, I'm trying to use the substr() function and would like the last character to be a SPACE " " as not to end in the middle of a word. So I was thinking of moving backwards until the last character = " " Does anyone know of how to achieve this? - Below is the code that will not produce any results. I can get results using numeric conditions in the substr($record['description'],0,35); but I was trying to compair what the 35th character was and if it is not = " " then I wanted to subtract from there. Any thoughts?? $sql = 'SELECT * FROM `events` WHERE `date_start` > \'2007-02-12\' ORDER BY `date_start` LIMIT 0, 30'; $result = mysql_query($sql); while ($record = mysql_fetch_assoc($result)){ $last_char = 35; if (substr($record['description'],0,$last_char) != " ") { $last_char = ($last_char--); }else{ $event_description = substr($record['description'],0,$last_char); } echo $event_description;
  18. Hello, I have a site at www.rediheat.com I am having an issue with a section of the page that lets certain affiliates obtain the products that are normally purchased. I would like to be able to type in an affiliate code and hit the enter button on the keyboard instead of the mouseover / click submit button. When I try this now, I get an error page but if I use the button to submit I go to the correct page. The login area is in the left column listed as "affiliate login" you can use the login name "user" and if you use your enter key on the keyboard to submit it may send you to the error page below. [b]We apologize for the inconvenience. However there has been a system error. Please try to place your order again. If you continue to have issues please call or contact us and we can enter your order manually.[/b] If you use the GO button it should take you to the test user login page. Any Thoughts?
  19. The problem I am having with $_SERVER['HTTP_REFERER'] is that if someone would refresh the page it creates the error, because they were not directed there from the main page. Could someone help me with the proper code to check for two different $_SERVER['HTTP_REFERER'] example: if ($_SERVER['HTTP_REFERER'] != "www.mysite.com/abc/" || "www.mysite.com/xyz/"){ echo "You have arrived here without loging in  Bla......" ; exit; } Any Thoughts ?
  20. I have a ecommerce site that has general products for everyone that visits. Also there is a wholesale client login. The script takes the user to a different category, with a seperate store for wholsale clients. Is it possible that when the wholesale category is opened, that we can make sure that it was the handle_login.php script that sent them there. If they have it bookmarked or opened from any other location besides the handle_login.php script. They would recieve a error message with the option to go to the login page.
  21. Can someone tell me the easiest way to have a form with a single text input field and a submit button. But you would be able to submit the form with the submit button or by hitting the enter key.
  22. Does anyone know of an easy script to allow a file to be uploaded and overwrite the existing file in the uploads directory? I have a customer that uploads images and every month these images will change to the new theme. Thanks for any help. This is the Upload script I am using. <?php // This file works to upload the image and store the location in the DataBase $uploadDir = '../uploads/'; // The uploads directory is in the root folder if(isset($_POST['upload'])) { if ($_POST['vendor_id'] == 0) { echo "<span class='content_blank'><H3>You did not select a Vendor! Please try again</H3></span>"; }else{ $fileName = $_FILES['userfile']['name']; $tmpName = $_FILES['userfile']['tmp_name']; $fileSize = $_FILES['userfile']['size']; $fileType = $_FILES['userfile']['type']; $filePath = $uploadDir . $fileName; $result = move_uploaded_file($tmpName, $filePath); if (!$result) { echo "Error uploading file"; exit; } include ('../connections/mysql_connect.php'); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $query = "INSERT INTO uploads (file_name, file_size, file_type, image_path, vendor_id ) ". "VALUES ('$fileName', '$fileSize', '$fileType', '$filePath', '".$_POST['vendor_id']."')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); echo "<br><span class='content_blank'><strong>File uploaded</strong></span><br>"; } } ?> <form method="post" enctype="multipart/form-data"> <table width="100%" border="0" cellpadding="1" cellspacing="1"> <tr> <td colspan="2" class="content_blank"><strong>Upload image...</strong><BR> You must select a vendor, then browse to their coupon image and upload the file<BR><BR> </td> </tr> <tr> <td valign="top" class="content_blank"> <?php include ('../connections/mysql_connect.php'); echo "<strong>Select Vendor.</strong><BR> <select name='vendor_id'> <option>- Please select one -</option>\n"; $vendor_query = mysql_query("SELECT * FROM vendors;"); while($rows = mysql_fetch_assoc($vendor_query)) { echo "<option value='".$rows['vendor_id']."'>".$rows['vendor_name']."</option>\n"; } echo "</select>"; ?> </td> <td width="246" class="content_blank" valign="top"> <strong>Browse to select file.</strong><BR> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <input name="userfile" type="file" id="userfile"><BR><BR> <input name="upload" type="submit" class="box" id="upload" value=" Upload "> </td> </tr> <tr> <td></td> </tr> </table> </form>
  23. OK, The data will come from a list menu. this is the code - you can view how it functions now by going to [a href=\"http://www.countrysavingsmagazine.com/master_coupon.php\" target=\"_blank\"]http://www.countrysavingsmagazine.com/master_coupon.php[/a] I'm not sure if there has to be something added to the <head> of the page?? <?php include ('connections/mysql_connect.php'); $row_query = mysql_query("SELECT * FROM categories;"); $row_number = mysql_num_rows($row_query); ?> <?php echo "<form name='form1' method='post' action='master_coupon.php'> <select name='cat_id' size='".$row_number."' onChange='MM_jumpMenu('parent',this,0)'>"; $qry = mysql_query("SELECT * FROM categories;"); while($rows = mysql_fetch_assoc($qry)) { echo "<option value='".$rows['cat_id']."'>".$rows['cat_name']."</option>\n"; } ?> </select><br> <br> <input name='submit' type='submit' value='Select Category'> </form>
  24. I would like to be able to select form data and send it to the next part of the script without using a submit button. I would like to just click or double click the selection in the menu list and then post that data to the next section of the script is this possible.
  25. [!--quoteo(post=358922:date=Mar 27 2006, 10:50 AM:name=shocker-z)--][div class=\'quotetop\']QUOTE(shocker-z @ Mar 27 2006, 10:50 AM) [snapback]358922[/snapback][/div][div class=\'quotemain\'][!--quotec--] needs to be & seperates all the diffrent url variables :) [/quote] [b]Thank You[/b] - That worked great -
×
×
  • 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.