Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. You really need that flush(); for the output without it your need a lot of messages to be posted to fill up the apache output buffer
  2. oops, $uploadedfile2 = uniqid(md5_file($uploadedfile2)).".".$path_part['extension']; should be $uploadedfile2 = uniqid(md5_file($_FILES['uploadedfile']['tmp_name'])).".".$path_part['extension'];
  3. really need to see the file, without it, it makes it harder to find the problem,
  4. Something like this $uploadedfile2 = $_FILES['uploadedfile']['name']; $path_part = pathinfo($uploadedfile2); $uploadedfile2 = uniqid(md5_file($uploadedfile2)).".".$path_part['extension']; should work, it really depends on what's being uploaded, MD5 will give the same result if the same file is used, the above will add some randomness to that, normally i would add the username/id or something else that's unique.
  5. You could use uniqid or md5_file
  6. So is the attachment being sent ? if so can you post the file that was received.
  7. Check your PHPinfo to find what the current time-out is, In any case, try this Let's say your have index.php in your public_html folder now first create a folder called "session" in the folder that contains "public_html" and make sure you have write access(777), i.e. root | |--public_html |----+index.php |--session Now in index.php //path to Session dir $sessdir = dirname(__FILE__).'/../session'; //Create folder is it doesn't exist if (!is_dir($sessdir)) { mkdir($sessdir, 0777); } //change save location to the sessions path session_save_path($sessdir)); ini_set('session.gc_probability', 1); //force on // 2*60*60 = 2 hours $sessionExpireTime=2*60*60; //Change Garbage Collection to new life time ini_set('session.gc_maxlifetime', $sessionExpireTime); //Set cookie life time session_set_cookie_params($sessionExpireTime); session_start(); //as normal //Update Cookie ExpireTime if (isset($_COOKIE[session_name()])){ setcookie(session_name(), $_COOKIE[session_name()], time() + $sessionExpireTime, "/"); } (please note theirs probably a ton of typos in the above but i hope it helps) -MadTechie
  8. $con should be $cid
  9. Personally i use an array in a file (which can be updated to be a database instead with minimum effort) ie uk.lang.php $lang = array( 'welcome' => 'welcome', 'logout' => 'You have been logged out', 'login' => 'Welcome to back', 'etc' => 'etc' ); //french fr.lang.php $lang = array( 'welcome' => 'Bienvenue', 'logout' => 'Vous avez été déconnecté', 'login' => 'Bienvenue à dos', 'etc' => 'etc' ); example 1 <?php $lang_code = 'uk'; require $lang_code'.lang.php'; echo $lang['welcome']; ?> example 2 <?php $lang_code = 'fr'; require $lang_code'.lang.php'; echo $lang['welcome']; ?> EDIT: as for using a database just query the database for the language and fetch the row as $lang (assuming all fields are the same as the keys)
  10. I'm not sure exactly what you mean and without the XML it would be guess work.. however here are a few things that may help $text = $status->text; //get XML text as a standard variable (for ease of use) //if $text contains "#fb" append "I" to it if(stripos($text, '#fb')) $text = "I ".$text; //if $text contains "#fb" replace with "I" $text = str_ireplace('#fb', 'I', $text); //Output print "<p><span class=\"twittertext\">$text</span><br />";
  11. I would do this foreach ($categories[1] as $cat) {echo "<li>".$cat."</li>";}; as its less code
  12. It would seam you haven't connected to the database, add the following code to the start (with the correct database details) $cid = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); }
  13. Before elm asks where to put that code, let me just explain what Pikachu2000 means by elm you are using $POST['sort'] which is NOT the same as $_POST['sort']; and from your code it looks like you mean $_POST['sort']
  14. mysql_db_query() is very out of date
  15. Close but no this is your array So you see quantity is in an array in 124 and 114 So your need to do this if ($productOptions['124']['quantity'] > 0){ echo "blah blah..." } so $X = $productOptions['124'] would return an array then $X['quantity'] would return 7 So in a loop foreach($productOptions as $X){ if ($X['quantity'] > 0){ echo "ID ".$X['optionId']." has ".$X['quantity']; } } Hope this helps
  16. Not 100% sure but Shouldn't session.php contain a header header('content-type: text/html'); check the addtype for shtml in your apache conf AddType text/htm .shtml
  17. Ahhhh! and you have learnt some new (the hard way)
  18. Where is the actual $mail->Send(); ? it seams you are setting up a email but not sending it
  19. Still having problems ?
  20. no natsort does the same as sort (except sort re-indexs the keys).. and as your script loops through your array via the keys ie 0,1,2,3,4.... the natsort seams to have no effect ... so i added a line to "re-index" them after natsort($this->files_arr); //Sort $this->files_arr= array_values($this->files_arr);//re-index
  21. EDIT: and you give us a list of names you have
  22. I was quoting the difference between sort and natsort!
  23. or 3 list ever record and have PHP compare both fields! Na.. that would be slow.. first option
  24. mdewyer idea but i would use natsort EDIT: Infact your using keys $this->files_arr[$curr - 1] So this maybe quicker natsort($this->files_arr); //Sort $this->files_arr= array_values($this->files_arr);//re-index
  25. If solved please click the "Mark Solved" button bottom left (save others reading the whole post just to find its ended!
×
×
  • 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.