Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by HDFilmMaker2112

  1. Is the code you posted contained in the page "http://mucove.com/?os=changepass"? Just as an example (you do NOT have to change the code to what I have, just checking I'm understanding you correctly), here's the way I have a site set-up. if($_GET['page']=="aboutus"){ include 'aboutus.php'; $section="- About Us"; } elseif($_GET['page']=="contactus"){ include 'contactus.php'; $section="- Contact Us"; } In my contactus.php page I have: if($_GET['do']=="showform"){ include 'contactform.php'; $section="- Contact Form"; } ect... else{ } Now I can get an URL of www.domainname.ext/index.php?page=contactus&do=showform
  2. works perfectly like that... just removed the echos and now it's absolutely perfect. Thanks.
  3. It displays this: /home/zyquo/public_html/ghosthuntersportal.com
  4. Still no luck. Any other ways to accomplish this without glob()?
  5. correct... I just copied what was there and altered it slightly. Didn't look to see if everything was correct.
  6. $home = ""; $how = ""; $signup = ""; $offers = ""; $friends = ""; $login = ""; $register = ""; if ($_GET['page'] == "home") { include "page_name.ext"; } else if ($_GET['page'] == "how") { include "page_name.ext"; } ect.
  7. my full path to the folder is public_html/ghosthuntersportal.com/sub-folders the code is contained in func.php which is in the includes sub-folder. If I do: glob("*.php"); Wouldn't it assume I'm looking for php files in the sub-folder the script is contained in? and not the main folder.
  8. $files1[] = glob("./ghosthuntersportal.com/*.php"); $files2[] = glob("./ghosthuntersportal.com/includes/*.php"); $files3[] = glob("./ghosthuntersportal.com/images/*"); $files[]=array_merge($files1, $files2, $files3); if(is_array($files) && count($files) > 0) { foreach($files as $file) { $filetime[]=filemtime($file); } } $filetime=max($filetime); $lastupdated="Last Updated: ".date ("F j, Y", $filetime); This returns the below: Warning: filemtime() [function.filemtime]: stat failed for Array in /home/zyquo/public_html/ghosthuntersportal.com/includes/func.php on line 27
  9. Added the [] results in this: Warning: max() [function.max]: Array must contain at least one element in /home/zyquo/public_html/ghosthuntersportal.com/includes/func.php on line 33 The $files Array seems to be blank.
  10. I tried this just to check, error: Warning: shell_exec() has been disabled for security reasons in /home/zyquo/public_html/ghosthuntersportal.com/includes/func.php on line 34
  11. I came up with this: $files1 = glob("./ghosthuntersportal.com/*.php"); $files2 = glob("./ghosthuntersportal.com/includes/*.php"); $files3 = glob("./ghosthuntersportal.com/images/*"); $files=array_merge($files1, $files2, $files3); if(is_array($files) && count($files) > 0) { foreach($files as $file) { $filetime=filemtime($file); } } $filetime=max($filetime); $lastupdated="Last Updated: ".date ("F j, Y", filemtime($filetime)); But I get this error: Warning: Wrong parameter count for max() in /home/zyquo/public_html/ghosthuntersportal.com/includes/func.php on line 32 It returns a date of Last Updated: December 31, 1969.
  12. Find the glob() function, but don't know if it's what I'm looking for...
  13. Is there anyway to write a script that will find the file with the most recent file modified/uploaded date and return it? I know I can use filemtime() to return the time from the specific file, but I need a way to find the last modified file.
  14. I basically need something like this: mysql_fetch_array(mysql_query("SELECT COUNT(product_id) AS num FROM products WHERE product_cat=(SELECT product_cat FROM products WITH LEAST SUM(product_id))"));
  15. I'm looking to know how to tweak this query so it finds the one category with the fewest products in it. mysql_fetch_array(mysql_query("SELECT COUNT(product_id) AS num FROM products"));
  16. function_exists is looking for a string so it needs to be this: function_exists('get_magic_quotes_gpc')
  17. Narrowed down the issue to this: function_exists(get_magic_quotes_gpc()) it returns false... any ideas why? When I use get_magic_quotes_gpc() by itself it returns true.
  18. I just checked to see when the slashes are added and they're placed in there prior to mysql_real_escape_string, which makes no sense.... the function is not called prior to that at all. This is the form: <form action="./product_process.php?do=add" method="post"> <p><label>Product Name:</label> <input type="text" name="product_name" size="30" /> <label>Product Price:</label> <input type="text" name="product_price" size="5" /> </p> <p><label>Product Code:</label> <input type="text" name="product_code" size="30" /></p> <p><label>Product Category:</label> <input type="text" name="product_category" size="30" /></p> <p><label>Product Link:</label><br /> <textarea name="product_link" rows="5" cols="30"></textarea> </p> <p><label>Product Image:</label> <input type="text" name="product_image" size="30" /></p> <p><label>Product Tag:</label> <input type="text" name="product_tag" size="30" /></p> <p><label>Product Keywords:</label> <input type="text" name="keyword" size="30" /></p> <p><label>Product Hightlights:</label><br /> <textarea name="product_highlights" rows="10" cols="60"></textarea> </p> <p><label>Product Features:</label><br /> <textarea name="product_features" rows="10" cols="60"></textarea> </p> <p><label>Product Pros:</label><br /> <textarea name="product_pros" rows="5" cols="30"></textarea> </p> <p><label>Product Cons:</label><br /> <textarea name="product_cons" rows="5" cols="30"></textarea> </p> <p><label>Product Description:</label><br /> <textarea name="product_description" rows="10" cols="60"></textarea> </p> <p><label>Product Notes:</label><br /> <textarea name="product_notes" rows="5" cols="30"></textarea> </p> <p><label>Product Specifications:</label><br /> <textarea name="product_specifications" rows="10" cols="60"></textarea> </p> <p><input type="submit" value="Submit" name="Submit" /></p> </form>
  19. When I submit a product using my admin panel, the PayPal button has slashes added to escape the double quotes in the paypal button. It's also adding slashes to my apostrophes. I didn't think it was suppose to add slashes, or they should atleast be pulled out on insert into the database? function sanitize($formValue){ if(function_exists(get_magic_quotes_gpc()) && get_magic_quotes_gpc()) { $formValue = stripslashes($formValue); } $formValue = mysql_real_escape_string($formValue); return $formValue; } $product_link=sanitize($_POST['product_link']); http://ghosthuntersportal.com/store.php?product=13#overview
  20. hmm... I made some changes to the code when I posted the thread, didn't think I changed anything to make it work; but most of. Solved.
  21. I'm having an issue with this function: function copyyear($setyear){ $year = date('Y'); $copyrightdate="© ".$setyear; if($year!=$setyear){ $copyrightdate.=" - ".$year.""; } return $copyrightdate; } I'm echoing out the function here: <?php echo copyyear("2011"); ?> Ghost Hunter's Portal, L.L.C. This is resulting in: "Ghost Hunter's Portal, L.L.C." with no date in front of it.
  22. I'm looking for some good MySQL/MySQLi and PHP5.3 and PHP6 books to really delve into MySQL and the newer versions of PHP. Any suggestions?
  23. Alright, come to this result: SELECT $tbl_name.product_id , AVG($tbl_name3.review_product_rating) AS avg_rating FROM $tbl_name LEFT OUTER JOIN $tbl_name3 ON $tbl_name3.product_id = $tbl_name.product_id WHERE $tbl_name.product_category = '$cat' GROUP BY $tbl_name.product_id ORDER BY avg_rating The above works perfectly for the basic product_category view. But when it comes to my search page it shows no results. Here's the search mysql query: $likeValues = "$tbl_name2.keyword LIKE '%" . implode("%' OR $tbl_name2.keyword LIKE '%", $keywords) . "%'"; $sql10000= "SELECT * FROM $tbl_name JOIN $tbl_name2 USING(product_id) WHERE $likeValues GROUP BY product_id ORDER BY $sort_by_selected2 LIMIT $start, $limit";
  24. Would there be a way to simplify the following, so it's not got the while loop in it? $sql_average_rating="SELECT product_id, (SUM(review_product_rating)/(COUNT(review_product_rating)-1)) AS review_product_rating FROM $tbl_name3 GROUP BY product_id"; $results_average_rating=mysql_query($sql_average_rating); while($row_average_rating=mysql_fetch_array($results_average_rating)){ extract($row_average_rating); $sql_insert_rating="UPDATE $tbl_name product_rating_average='$review_product_rating' WHERE product_id='$product_id'"; mysql_query($sql_insert_rating); }
  25. I may need a sub-query. Basically I have a reviews table ($tbl_name3) which has product_id and review_product_rating. So there maybe 5 reviews for product_id "1", and 3 reviews for product_id "2"... I need to Average together the 5 reviews for product_id "1" and average together the 3 reviews for product_id "2" but not average together product_id "1" and product_id "2". So I need to average together the product's reviews independently of each other, and then ORDER the main query be those average values.
  • 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.