Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. I don't see anything that empties the basket once an order was placed. A user may be bookmarking or refreshing the page and revisiting it again.
  2. You can try using full <?php tags versus short <? tags, some servers not configured for it. Should also ask your host why only upgraded to 5.2 when it's now at 5.6.1 Add this to the top of your script and see if there is any errors <?php error_reporting(E_ALL); ini_set("display_errors", 1); ?>
  3. Welcome Christina
  4. You have a typo $amp_20_parts_id = $part_number = $discription = $location = $quantity = "";//<- daisy chaining all to blank huh $discription = mysqli_real_escape_string($con, $_POST['description']); $sql="INSERT INTO amp_20 (amp_20_parts_id, part_number, description, location, quantity) VALUES ('$amp_20_parts_id', '$part_number', '$description', '$location', '$quantity')";
  5. The form values are held in $_POST which is an associative array. to see these values: print_r($_POST); The example code only determines if was checkmarked and not the actual values. You can style it in the same script, add some css and style whatever need to.
  6. We don't usually help with school work. To me this seems a bit complex being is not a normal php class. I created a simple form and a function to handle the number sets for you. You can use it, integrate whatever else need. <form method="POST" action=""> <p><strong>Select your ticket(s):</strong><br> <label for="Lotto6">Six sets of LOTTO 6/49 numbers</label> <input type="checkbox" id="Lotto6" name="six" value="Lotto 6/49"><br /> <label for="Lotto7">Six sets of LOTTO MAX (7/49)</label> <input type="checkbox" id="Lotto7" name="seven" value="Lotto Max"><br /> <p><input type="submit" value="submit"/></p> </form> <?php function lotteryNumbers($min_number, $max_number, $amount_of_numbers) { $range = range($min_number, $max_number); shuffle($range); $numbers_array = array_slice($range, 0, $amount_of_numbers); natsort($numbers_array); return array_values($numbers_array); } if (isset($_POST['six'])) { echo "<h2>LOTTO 6/49</h2>"; $number_set = array(); for ($i = 1; $i <= 6; $i++) { $number_set = lotteryNumbers(1, 49, 6); echo implode(",", $number_set) . "<br />"; } } if (isset($_POST['seven'])) { echo "<h2>LOTTO MAX</h2>"; $number_set = array(); for ($i = 1; $i <= 6; $i++) { $number_set = lotteryNumbers(1, 49, 7); echo implode(",", $number_set) . "<br />"; } } ?>
  7. I can see making a new folder like cache_files. You can look for cached files existing in that folder first. Keep file names the same. If the cached file exists then use it. If the cached version does not exist...run your script to transform them for initial display....make the new cache file for next time. Up to you about setting expire times on them or just always keep them for the future. I forgot to mention if this data changes in the file, you can just replace the cached file.
  8. It would be better and simpler to use _ in them. Otherwise can use urlencode() and urldecode() on them back and forth. Or a str_replace $encodedcardname = str_replace(" ","%20",trim($cardname));
  9. change this while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) $cardname = $row['Name']; $url = "http://mtgimage.com/card/$cardname.jpg"; { to this while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) { $cardname = $row['Name']; $url = "http://mtgimage.com/card/$cardname.jpg";
  10. Now that you have a variable $message, that's what you should be using and check for the sql insert. remove $msg = $_POST['message']; //Do check and only insert if is a good message. if($message != 'Invalid Submission' || $message != 'Empty Submission' || $message != 'Access denied'){ //should be making inserts safe $message = mysql_real_escape_string($message); $sqli = "INSERT INTO StringyChat (StringyChat_ip, StringyChat_name, StringyChat_message, StringyChat_time, mxit_id) VALUES ('$ip', '$name', '$message', '$time', '$mxitid')"; $result = mysql_query($sqli, $conn) or trigger_error("SQL", E_USER_ERROR); }
  11. I would change this area if(!isset($_POST['message'], $_POST['form_token'], $_SESSION['form_token'])) { $message = 'Invalid Submission'; } /*** check the form tokens match ***/ elseif($_POST['form_token'] != $_SESSION['form_token']) { $message = 'Access denied'; } to something like $message = 'Invalid Submission'; if(isset($_POST['message']) && isset($_POST['form_token']) && isset($_SESSION['form_token'])) { if($_POST['form_token'] == $_SESSION['form_token']){ if(trim($_POST['message']) != ''){ $message = trim($_POST['message']); }else{ $message = 'Empty Submission'; } }else{ $message = 'Access denied'; } }
  12. Besides what Ch0cu3r wrote, also use the single quotes for a hyperlink. $cardname = $row['Name']; $url = "http://mtgimage.com/card/" . $cardname . ".jpg"; echo "<a href='" . $url . "'>" . $cardname . "</a>"; I also noticed this. echo '<table align="center" id="mytable" cellspacing="0" class="table" >'; change to echo "<table align='center' id='mytable' cellspacing='0' class='table' >"; An easy way to do it is to use all single quotes within and wrapped with double quotes, can wrap variables with curly braces or concatenate
  13. More information what the purpose of all this is may help. Going by what you are doing I would just do a timestamp-array_value.txt md5() will help for storing safe filenames, but would have to save the hash somewhere to know the reverse. May even be easier to create folders of the array values and timestamp.txt within. At least that way you can target each folder if was to be many of them or multiple timestamped files to compare, or even types Like I said, more information would probably help.
  14. <td align="left|right|center|justify|char"> The left|right|center|justify|char are options...pick one!!! Use full <?php tags and not short <? tags in your code, some servers not set up for it.
  15. Since this is a css style issue, you should post your styles.css file here.
  16. The css code was not commented out properly
  17. Try this code instead: <?php include('header.php');?> <style type="text/css"> body { margin:0; padding:0; font:.75em/1.5 sans-serif; } h4 { font-size: 1em; } .column-in { margin:0; padding:10px; } .cleaner { clear:both; height:1px; font-size:1px; border:none; margin:0; padding:0; background:transparent; display:none; } #container { width: 80%; padding:0; display: table; border: 1px solid black; } #row { display: table-row; } #left { width:150px; padding:0; background: #EEF; display: table-cell; background:yellow url("red.gif") top left repeat-y; } #middle { padding: 10px; background:white; display: table-cell; font-family:bookman old style; font-size:8px; } </style> </head> <body> <div id="header"><div class="column-in"> <p><a href="http://www.snook.ca/archives/000177.html">Return to article</a></p> </div></div> <div id="container"><div id="row"> <div id="left"><div class="column-in"> <h4>Categories</h4> <p id="lccont"> Menu Items List List List List List List List List List List List List List </p> </div></div> <div id="middle"><div class="column-in"> <h4>Middle Col</h4> <p id="mccont"> <table border="0" width="67%" height="177"> <tr> <td width="100%" height="109"><img src="http://www.tqlkg.com/image-7653886-11189232?imgurl=http%3A%2F%2Flitbimg.rightinthebox.com%2Fimages%2Fl %2F201407%2Fwqvg1406510417968.jpg"> <br></td> <td width="70%" height="171" rowspan="2"> </td> <td width="130%" height="109"><img src="http://www.lduhtrp.net/image-7653886-10677699?imgurl=http%3A%2F%2Flitbimg.rightinthebox.com%2Fimages%2Fl %2F201403%2Fvrkkti1396257446087.jpg"></td> <td width="100%" height="171" rowspan="2"> </td> <td width="100%" height="109"><img src="http://www.awltovhc.com/image-7653886-10677699?imgurl=http%3A%2F%2Flitbimg.rightinthebox.com%2Fimages%2Fl %2F201408%2Frpriff1409044325841.jpg"></td> </tr> <tr> <td width="101%" height="62"> <p align="center">Name of Item<br>$149.99<br><title="All the description would go here so people can get a quick description of an item">Quick Info</p> <p align="center"><img border="0" src="images/button.png" width="120" height="44"></p><div class="srtgs" id="rt_linen"></div> </td> <td width="133%" height="62"> <p align="center">Name of Item<br>$149.99<br>Quick Info</p> <p align="center"><img border="0" src="images/button.png" width="120" height="44"></p><div class="srtgs" id="rt_linen"></div> </td> <td width="102%" height="62"> <p align="center">Name of Item<br>$149.99<br>Quick Info</p> <p align="center"><img border="0" src="images/button.png" width="120" height="44"></p><div class="srtgs" id="rt_linen"></div> </td> </tr> </table> <table border="0" width="67%" height="177"> <tr> <td width="100%" height="109"><img src="http://www.tqlkg.com/image-7653886-11189232?imgurl=http%3A%2F%2Flitbimg.rightinthebox.com%2Fimages%2Fl %2F201407%2Fwqvg1406510417968.jpg"> <br></td> <td width="70%" height="171" rowspan="2"> </td> <td width="130%" height="109"><img src="http://www.lduhtrp.net/image-7653886-10677699?imgurl=http%3A%2F%2Flitbimg.rightinthebox.com%2Fimages%2Fl %2F201403%2Fvrkkti1396257446087.jpg"></td> <td width="100%" height="171" rowspan="2"> </td> <td width="100%" height="109"><img src="http://www.awltovhc.com/image-7653886-10677699?imgurl=http%3A%2F%2Flitbimg.rightinthebox.com%2Fimages%2Fl %2F201408%2Frpriff1409044325841.jpg"></td> </tr> <tr> <td width="101%" height="62"> <p align="center">Name of Item<br>$149.99<br><title="All the description would go here so people can get a quick description of an item">Quick Info</p> <p align="center"><img border="0" src="images/button.png" width="120" height="44"></p><div class="srtgs" id="rt_linen"></div> </td> <td width="133%" height="62"> <p align="center">Name of Item<br>$149.99<br>Quick Info</p> <p align="center"><img border="0" src="images/button.png" width="120" height="44"></p><div class="srtgs" id="rt_linen"></div> </td> <td width="102%" height="62"> <p align="center">Name of Item<br>$149.99<br>Quick Info</p> <p align="center"><img border="0" src="images/button.png" width="120" height="44"></p><div class="srtgs" id="rt_linen"></div> </td> </tr> </table> </p> </div></div> <div class="cleaner"> </div> </div></div> <?php include('footer.php');?>
  18. $query = "SELECT aquaticCenterName FROM reviews WHERE aquaticCenterName LIKE '%".$e."%' OR town LIKE '%".$e."%' OR county LIKE '%".$e."%' OR country LIKE '%".$e."%' OR rating LIKE '%".$e."%'";
  19. My first instinct is that php is not on the server or not configured. Could be that you need to add a line in .htaccess or in the apache configuration file to handle php with php pages Something like: AddType application/x-httpd-php .php .phtml .htm .html or AddType application/x-httpd-php5 .php .phtml .htm .html or even possibly add the php version AddType application/x-httpd-php53 .php .phtml .htm .html Now if you actually just make a php file named phpinfo.php in the root folder and use only this code......what do you see when visit http://www.loadsofads.com/phpinfo.php <?php phpinfo();?> Did you ever consider trying to use a template engine like twig or smarty , maybe even install a premade cms and modify it like wordpress , joomla etc? Additional observation on all pages was that there is no opening html or doctype declaration shown Sample html5 layout: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Title</title> <meta name="description" content="My meta description"> <meta name="keywords" content="all,my,keywords"> <link rel="stylesheet" href="style.css"> </head> <body> Body content </body> </html>
  20. Ok, well what I suggested was not actually required those instances, worth a shot. So what is different from those pages from the other pages that do work? Is the page a .php file or is it a .html,.htm or other file extension? Mind pasting header.php with footer.php and also tell us the name of the file and it's exact location. You can show us code directly using the forums code tags by clicking <>
  21. A person doesn't need an original idea to make a website, although it could help. OP only asked for guidance how to make something similar.
  22. You forgot to add a semicolon at the end of each php line, wrap them as well <?php include'header.php'?> to <?php include('header.php');?> and <?php include'footer.php'?> to <?php include('footer.php');?>
  23. Why not make one? Those sites are not the OP's. Sometimes people do make it better, maybe cheaper, existing sites close. Why did facebook make yet another social site? Why is there multiple browsers and search engines? Why is there multiple programming languages? Don't let comments stop your ideas or goals OP.
  24. I wrote what I did so maybe you would do things different, modify as you needed. That's going to be a very large plugin by the time you get to 7 tiers, or even get them to work. I don't see why you can't make the 3rd or any other tier after work similar as in the 2nd tier if that works using similar code. Anyway, my suggestion would be to make everything into one function versus making each tier it's own function.
×
×
  • 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.