-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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
-
oops, $uploadedfile2 = uniqid(md5_file($uploadedfile2)).".".$path_part['extension']; should be $uploadedfile2 = uniqid(md5_file($_FILES['uploadedfile']['tmp_name'])).".".$path_part['extension'];
-
really need to see the file, without it, it makes it harder to find the problem,
-
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.
-
You could use uniqid or md5_file
-
So is the attachment being sent ? if so can you post the file that was received.
-
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
-
$con should be $cid
-
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)
-
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 />";
-
I would do this foreach ($categories[1] as $cat) {echo "<li>".$cat."</li>";}; as its less code
-
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()); }
-
Generating table based on form input order by bug...
MadTechie replied to elm's topic in PHP Coding Help
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'] -
mysql_db_query() is very out of date
-
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
-
PHP as virtual include (.shtml) displays 0
MadTechie replied to BlueSkyIS's topic in PHP Coding Help
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 -
Gallery reading from directory *Random placement*
MadTechie replied to jkewlo's topic in PHP Coding Help
Ahhhh! and you have learnt some new (the hard way) -
New server causing phpmailer to not work ?
MadTechie replied to swatisonee's topic in PHP Coding Help
Where is the actual $mail->Send(); ? it seams you are setting up a email but not sending it -
Gallery reading from directory *Random placement*
MadTechie replied to jkewlo's topic in PHP Coding Help
Still having problems ? -
Gallery reading from directory *Random placement*
MadTechie replied to jkewlo's topic in PHP Coding Help
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 -
Gallery reading from directory *Random placement*
MadTechie replied to jkewlo's topic in PHP Coding Help
EDIT: and you give us a list of names you have -
Gallery reading from directory *Random placement*
MadTechie replied to jkewlo's topic in PHP Coding Help
I was quoting the difference between sort and natsort! -
or 3 list ever record and have PHP compare both fields! Na.. that would be slow.. first option
-
Gallery reading from directory *Random placement*
MadTechie replied to jkewlo's topic in PHP Coding Help
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 -
If solved please click the "Mark Solved" button bottom left (save others reading the whole post just to find its ended!