voip03
Members-
Posts
693 -
Joined
-
Last visited
Everything posted by voip03
-
use $_GET['lang'] <?php function _language($term) { include('fr.php'); if(!empty($lang[$term])) {$lterm=$lang[$term];} else { $lterm = $term;} return $lterm; } echo language( $_GET['lang']); ?>
-
With out switch() statement it work fine, but just black image.
-
Best PHP editor for debugging
voip03 replied to eazyGen's topic in Editor Help (PhpStorm, VS Code, etc)
I am using Dreamweaver but it is not free. You can try netBeans http://netbeans.org/ -
Upload Script/ Dreamweaver
voip03 replied to batstanggt's topic in Editor Help (PhpStorm, VS Code, etc)
1 check the Dreamweaver setting 2.It could be hosting server problem due to maintain works, please check with them. -
Making PHP check a MySQL value and then acting upon it
voip03 replied to Freedom-n-Democrazy's topic in PHP Coding Help
Buy a good PHP text book , that will be your PHP bible for some time. eg. Practical PHP & MySQL -
Making PHP check a MySQL value and then acting upon it
voip03 replied to Freedom-n-Democrazy's topic in PHP Coding Help
About w3school http://w3fools.com/ -
Whatdo u mean by power?
-
query a string of dates selected from a datepicker calendar
voip03 replied to jvance38's topic in PHP Coding Help
Please post the code. -
Please read it and if you like please re arranges the logic. http://www.tizag.com/mysqlTutorial/mysqlwhere.php
-
I am able to comment as much as I can; it could be too much blah blah... Take the one you want <? function filename($extension) { $ran_name = ""; //This line assigns a random number to a variable. for($i=0; $i<5; $i++){ $ran_name .= mt_rand(38,50); } //This takes the random number you generated and adds a . on the end, so it is ready of the file extension to be appended. $ran_name = $ran_name."."; //This combines the directory, the random file name, and the extension $newfile_name = $ran_name.$extension; return $newfile_name; } //This function reads the extension of the file. It is used to determine if the file is an image by checking the extension. function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } /*** the upload directory ***/ // the path with the file name where the file will be stored, upload is the directory name. $upload_dir ="/uploads"; /*** numver of files to upload ***/ $num_uploads = 6; /*** maximum filesize allowed in bytes ***/ $max_file_size = 51200; /*** the maximum filesize from php.ini ***/ $ini_max = str_replace('M', '', ini_get('upload_max_filesize')); $upload_max = $ini_max * 1024; /*** a message for users ***/ $msg = 'Select pictures for upload'; /*** an array to hold messages ***/ $messages = array(); $c=0; /*** check if a file has been submitted ***/ if(isset($_FILES['userfile']['tmp_name'])) { $count = count($_FILES['userfile']['tmp_name']); /** loop through the array of files ***/ for($i=0; $i < count($_FILES['userfile']['tmp_name']);$i++) { $filename = stripslashes($_FILES['userfile']['name'][$i]); //get the extension of the file in a lower case format $extension = getExtension($filename); $extension = strtolower($extension); //if it is not a known extension, we will suppose it is an error and will not upload the file, $New_filename = filename($extension); // check if there is a file in the array if(!is_uploaded_file($_FILES['userfile']['tmp_name'][$i])) { $messages[] = 'No file uploaded'; $c++; } /*** check if the file is less then the max php.ini size ***/ /* elseif($_FILES['userfile']['size'][$i] > $upload_max) { $messages[] = "File size exceeds $upload_max php.ini limit"; } */ // check the file is less than the maximum file size elseif($_FILES['userfile']['size'][$i] > $max_file_size) { $messages[] = "File size exceeds $max_file_size limit"; } elseif (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { $messages[] ="Unknown extension! "; } else { // the path with the file name where the file will be stored, upload is the directory name. $add="uploads/$New_filename"; if(move_uploaded_file ($_FILES['userfile']['tmp_name'][$i],$add)) { $messages[] = $_FILES['userfile']['name'][$i].' uploaded'; } else { /*** an error message ***/ $messages[] = 'Uploading '.$_FILES['userfile']['name'][$i].' Failed'; } } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Image Upload.</title> <style type="text/css"> <!-- .style1 { font-family: Arial, Helvetica, sans-serif, Calibri; font-size: 12px; } .style2 { font-family: Arial, Helvetica, sans-serif, Calibri; font-size: 9px; } --> </style> </head> <body> <div align="center"> <table width="95%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <? echo "<h3>". $msg ."</h3>"; echo "<span class='style2'>For the best quality, use the pictures that are more than 500 pixels in hight or width.</span><br/><br/>"; ?> </td> </tr> <tr> <td align='left' valign='middle'> </td> </tr> <tr><td> </td></tr> <tr> <td> <? if(sizeof($messages) != 0) { foreach($messages as $err){ echo "<span class='style1'>".$err.'</span><br />'; } } ?> </p> </td> <tr> <tr><td> <form enctype="multipart/form-data" action="103.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $max_file_size; ?>" /> <input type="hidden" name="counter" value="<? echo $a; ?>" /> <?php $num = 0; $newNUm = $num_uploads - $a; while($num < $newNUm) { echo '<div><input name="userfile[]" type="file" /></div>'; $num++; } ?> <br/> <input type="submit" value="Upload" /> <input type=button value="Cancel" onClick="javascript:window.close();"> </form> </td> </tr> </td> <td width="100"> </td> </tr> </table> </body> </html>
-
http://www.phpfreaks.com/forums/index.php?topic=343514.msg1620818#msg1620818
-
Example ArrayTestFile.txt readArray.php <?php $file_handle = fopen("welcome.txt", "rb"); while (!feof($file_handle) ) { $line_of_text = fgets($file_handle); $parts = explode(';', $line_of_text); print $parts[0] ." ". $parts[1]." ". $parts[2]." ". $parts[3]." ". $parts[4]." ". $parts[5] ; } fclose($file_handle); ?> I hop that I have answerd your query.
-
Advise on Best Way To Enter A Birthday on a Form
voip03 replied to TecTao's topic in PHP Coding Help
It mainly depends on where the End User are. (Depend on what part of the world they are in) -
Compare the first and second numeric characters to... what? Why two? Why not just develop one secure method? I would really like to know one secure method.Please show me one secure method?
-
You need to use a combination of numeric and alphabet characters for session value. Validating the session Validate the first and second numeric characters or middle or last characters When you validate the user accessibility, you should at least develop two validation methods.
-
your method is fine. it's secure enough? no This article for you. http://www.phpfreaks.com/forums/index.php?topic=343457.msg1620477#msg1620477
-
Try explode http://www.homeandlearn.co.uk/php/php10p7.html
-
file_get_contents()-read the contents of a file into a string EXPLAIN output for your query?
-
This article for you. http://stackoverflow.com/questions/328/php-session-security http://www.sitepoint.com/notes-on-php-session-security/
-
getimagesize() "No such file or directory" - but the image is there!
voip03 replied to woolyg's topic in PHP Coding Help
1 check the location /path 2 you may need header('Content-Type: image/jpeg'); -
Why not? Please read the article http://psoug.org/definition/DISTINCT.htm
-
To upload multiple files, you can use an array for input naming and to move upload files, you can loop through the array of files.
-
You have already taken the steps. Now you need to write codes. Question & answer page http://www.configure-all.com/fusebox.php you can google it line by line.
-
1.Your code works fine 2 After 3 seconds...it will not make any different, make it at least 30sec. http://www.plus2net.com/php_tutorial/sleep.php