Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. try changing $pos = strrpos($mystring, '(')-1; to $pos = strrpos($mystring, '(');
  2. change this block of code // Adding the new data to cscart_users $update2 = mysql_query("INSERT INTO cscart_users (user_type, user_login, timestamp, password, firstname, lastname, company, email, phone, fax) VALUES ('C', '$email', '$time', '$password', '$firstname', '$lastname', '$company', '$email', '$phone', '$fax') SELECT user_login FROM cscart_users WHERE user_login = '$email'"); // If the query fails let us know if (!$update2) { die('<p>Error performing update2 query: ' . mysql_error( ) . '</p>'); } // Adding the new data to cscart_user_profiles $update3 = mysql_query("INSERT INTO cscart_user_profiles (user_id, b_firstname, b_lastname, b_address, b_address_2, b_city, b_state, b_country, b_zipcode, s_firstname, s_lastname, s_address, s_address_2, s_city, s_state, s_country, s_zipcode, profile_name) VALUES (last_insert_id(), '$firstname', '$lastname', '$address1', '$address2', '$city', '$stateabr', '$country', '$zip', '$firstname', '$lastname', '$address1', '$address2', '$city', '$stateabr', '$country', '$zip', 'Main')"); // If the query fails let us know if (!$update3) { die('<p>Error performing update3 query: ' . mysql_error( ) . '</p>'); } $count1 = mysql_query("SELECT user_login FROM cscart_users WHERE user_login = '$email' "); $num1 = mysql_num_rows($count1); if($num1 == 0) { //****ADDED above // Adding the new data to cscart_users $update2 = mysql_query("INSERT INTO cscart_users (user_type, user_login, timestamp, password, firstname, lastname, company, email, phone, fax) VALUES ('C', '$email', '$time', '$password', '$firstname', '$lastname', '$company', '$email', '$phone', '$fax')"); //****UPDATED // If the query fails let us know if (!$update2) { die('<p>Error performing update2 query: ' . mysql_error( ) . '</p>'); } //****ADDED BELOW } $count2 = mysql_query("SELECT cscart_user_profiles FROM cscart_users WHERE user_login = '$email' "); $num2 = mysql_num_rows($count2); if($num2 == 0) { //****ADDED ABOVE // Adding the new data to cscart_user_profiles $update3 = mysql_query("INSERT INTO cscart_user_profiles (user_id, b_firstname, b_lastname, b_address, b_address_2, b_city, b_state, b_country, b_zipcode, s_firstname, s_lastname, s_address, s_address_2, s_city, s_state, s_country, s_zipcode, profile_name) VALUES (last_insert_id(), '$firstname', '$lastname', '$address1', '$address2', '$city', '$stateabr', '$country', '$zip', '$firstname', '$lastname', '$address1', '$address2', '$city', '$stateabr', '$country', '$zip', 'Main')"); // If the query fails let us know if (!$update3) { die('<p>Error performing update3 query: ' . mysql_error( ) . '</p>'); } }//****ADDED this is untested but i think your get the idea
  3. okay lets try something more debugging based test 1 //change $MM_restrictGoTo = "../login.php?lang={$_GET['lang']}"; //to $MM_restrictGoTo = "../login.php?TEST=1234&lang={$_GET['lang']}"; post the URL assuming that has TEST=1234 in it test 2 //change $MM_restrictGoTo = "../login.php?lang={$_GET['lang']}"; //to $MM_restrictGoTo = "../login.php?TEST=1234&lang={$_GET['lang']}"; echo "Testing:~<pre>"; var_dump($_GET); var_dump($_SESSION); die("KILLED"); post from Testing:~ to KILLED
  4. what part do you not understand ?
  5. try this <?php $mystring = 'hello (world) how are (you today)'; $pos = strrpos($mystring, '(')-1; $mystring = substr($mystring, 0, $pos); echo $mystring; ?> check each function out on php.net to make sure you understand what they do.. (this code is untested)
  6. LOL, na.. i am not going to write it for you.. read my first post.. it explains about creating another table..
  7. ahh yes, move $lang = $_GET['lang']; above $MM_restrictGoTo = "../login.php?lang=$lang"; in eth isAuthorized function $lang = $_GET['lang']; //here $MM_restrictGoTo = "../login.php?lang=$lang"; or even //change $MM_restrictGoTo = "../login.php?lang=$lang"; //to $MM_restrictGoTo = "../login.php?lang={$_GET['lang']}";
  8. hope this makes sense //this defines the width of the thumbnail /*existing code below*/ define('THUMBNAIL_WIDTH', 100); //FullImage Width //Add line below define('FullImage_WIDTH', 500); // resize FullImage //ADD line below $result = createThumbnail($uploadDir . $imagePath, $uploadDir . $imagePath, FullImage_WIDTH); // create thumbnail/*existing code below*/ $thumbnailPath = md5(rand() * time()) . ".$ext"; $result = createThumbnail($uploadDir . $imagePath, $uploadDir . 'thumbnail/' . $thumbnailPath, THUMBNAIL_WIDTH); to lower case filename //change $imagePath = md5(rand() * time()) . ".$ext"; //to $imagePath = strtolower(md5(rand() * time()) . ".$ext"); and //change $thumbnailPath=md5(rand() * time()) . ".$ext"; //to $thumbnailPath=strtolower(md5(rand() * time()) . ".$ext"); EDIT:&#160; seams to appear everywhere
  9. try this SELECT DISTINCT(video.id, games.id), video.groups,video.randname,games.consoles,video.timestamp FROM video, games WHERE video.groups LIKE "%12345%" AND games.consoles LIKE "%123%" LIMIT 3
  10. add an extra field with a time&date stamp in the UserActivity table
  11. in the isAuthorized function you are using $QUERY_STRING change these to $_SERVER['QUERY_STRING']; that should fix the problem
  12. you could create another table called UserActivity and have fields UserID, activity and insert a new records on activites from that you can count the total of number of records we're call that TotalActivity and then count the records where UserID equals the users id we're call that UserActivity then echo "$UserName %".($UserActivity / $TotalActivity)* 100;
  13. okay. whats the exact problem ? are sessions being used? as $_SESSION['sessFirst']; $_SESSION['sessLast']; isn't doing anything usful also the form is incomplete.. really need more complete data and a better understanding of the problem
  14. ahh very true kenrbnsn , (i really need to read all the code, lol) kenrbnsn code is faster.. but looping works better if you need to filter the data..
  15. or trim it //Array which separates each file name with a comma, and then creates a single string foreach ($files as $f => $value) { $str_files_db .= $f . ","; } $str_files_db = trim($str_files_db, ",");
  16. lol, i noticed thats but without the class couldn't make the connection lol
  17. that won't work.. okay current image is 5 i have 10 images (from 1 to 10) using the above selects next would be 6 BUT prevous would be 1. as i suggested before do some reseach on pagination, here some info http://www.tonymarston.net/php-mysql/pagination.html you could also search this forum.. when it comes to $rows_per_page just use 1
  18. this was written on the fly but should work. <?php $str="http://maps.google.co.uk/maps?utm_campaign=en&utm_source=en-ha-emea-uk-goog-gm&utm_medium=ha&utm_term=google%20map"; $newstr = preg_replace_callback("/(https?:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]){0}/si","dot",$str); echo "<p>String is: $newstr</p>"; function dot($url) { $len=40; return substr($url, $len)."..."; } ?>
  19. While i agree i would also like to pointout that is not technically true.. it depends on the mime handler.. but 99% of php servers have that setup.. the strange thing is jjacquay712 doesn't seam to know what his running ! :S
  20. on the script that builds the form you have can you comment out that line and test..
  21. is it a php server ? do you have the mime setup correctly ? any useful information ie where is the server ?
  22. Erm..... well is logged_in and isAdmin are missing.. but i guess $session->isAdmin() is a function
  23. not really.. infact read up on "php pagination".. should give you a better understanding
  24. instead of doing next by adding 1 to the number.. you could try the following please note this was written on the fly and probably had a ton of bugs, but i hope it gives you the idea <?php $start = (int)$_GET['img']; $sql = "SELECT * FROM imagetable LIMIT ".($start-1).", 3"; //this get 3 images $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } $n = 0; while ($row = mysql_fetch_assoc($result)) { $n++; switch($n) { case 1; echo "<a href=\"?img={$row['id']}\">prev</a>"; break; case 2; echo "<img src=\"{$row['imgpath']}\"><br><a href=\"?img={$row['id']}\">Full</a>"; break; case 3; echo "<a href=\"?img={$row['id']}\">Next</a>"; break; } } ?>
  25. After include ($path."main/include/cons/head.php"); add var_dump($_SESSION); to check the session values.. is logged_in missing or isAdmin or both ?
×
×
  • 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.