Jump to content

mrjameer

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Everything posted by mrjameer

  1. hi, i have a table in which there are 2 fields 1.id 2.date. values 1 2005-07-28 15:07:52 the time is 3:07:52. here what i want to do is i want to add 8 hours to the above time (result should be like 2005-07-28 11:07:52 PM).if it exceeds the date just take next day's date.any of your help will be surely appreciated. thanks mrjameer
  2. hi i have changed the filename to lowercase but still not working thanks mrjameer
  3. hi iam getting just blank screen and the new image is not created. thanks mrjameer.
  4. hi when i run the following script for watermarking on windows it is working well but when i run the same script on linux server it is not working.please correct me where iam wrong. <?php function addTextToFile($infile, $outfile) { $image = imagecreatefromjpeg($infile); $font_size = 12; $color = imagecolorallocate($image, 205,205,255); $black =imagecolorallocate($image, 0,0,0); ImageTTFText ($image, $font_size, 0, 01, 10, $black, "ARIALBD.TTF","www.ap.com"); ImageTTFText ($image, $font_size, 0, 00, 9, $color, "ARIALBD.TTF","www.ap.com"); imagejpeg($image, $outfile, 100); // save to outfile imagedestroy($image); } $newfile="back_test.jpg"; $newfile1="back.jpg"; addTextToFile($newfile, $newfile1) ?> php on windows php 4.3.6 gd 2.0.22 php on linux php 4.4.4 gd 2.0.28 thanks mrjameer
  5. hi, when ever a user login, his information(name,login-time..etc) will be stored in sessions and also stored in users table. the table has following fields 1.userid 2.userlogin_time(session_created_time) 3.session_expiry_time.4.session_timeout. it's values are 1----10:10:10-----10:34:10----11:46:10 here session_expiry_time is 24 minutes more than the session_created_time.the session_timeout is 72 minutes more that session_created time.ok what i want to do is if a user login and does not do any thing for next 24 minutes i want to redirect the user to login page. how i can do this.any of your help will be appreciated thanks mrjameer.
  6. hi, when a user will upload files on my site,the file info will be stored in table.and it will also shows a link to the user to download or visit that file.when he visits the link,the counter in table will be incremented.on every day at a particular time i want to update the counter to zero.that's all my code is <?php $current_date=date('Y-m-d'); $current_time=date('H:i:s'); if($current_date && $current_time >= '23:59:00') { mysql_connect($dbServer, $dbUser,$dbPass); mysql_select_db($dbName); $sqlquery="UPDATE images SET count='0'"; $resultquery=mysql_query($sqlquery) or die (mysql_error()); } ?> thanks mrjameer
  7. hi, i want to update a record everyday at a particular time dynamically. how can i do this thanks mrjameer
  8. hi, how i can get the total number of times a particular link has been visited.for example:this is the link. www.abcd.com/upload.php?id=761786717.jpg. i want to display how many times this link has been visited thanks mrjameer
  9. hi, i have downloaded that class from phpclasses.org.this class is used to convert the .psd files in to jpeg's or gif's and display it.when i display a single .psd file using this class,it is displaying good but when i try to display an array of .psd files it is displaying the first one only. thanks mrjameer
  10. hi barand, what about the psd files.can i display the .psd files same as jpg and png's. for example if i use this code it is not displaying the .psd image <?php $files=array('free_site_s2.psd','abc.psd'); $arr1 = array($files); foreach ($arr1 as $file) { echo "<img src='classPhpPsdReader.php?file=$file'>"; } ?> and in the classPhpPsdReader.php i add this code <?php $file = $_GET['file']; header("Content-type: image/jpeg"); imagejpeg(imagecreatefrompsd($file)); ?> thanks mrjameer
  11. hi barand, thank you very much.the code works excellent.you caught me. thanks mrjameer
  12. hi, thanks for your reply.it works fantastic.here i have another problem.the code is adding the sitename to the image and displaying.ok. i want to add the site name to the image while uploading the image in to directory.here is my code <?php $uniq = substr( md5(uniqid (rand())), 0, 10 ); $ext = strtolower( substr($_FILES['uploadFile'. $a]['name'], -3)); $att_path="/uploads/"; for($a=0;$a<$uploadNeed;$a++) { if($ext==jpg) { $files=$_FILES['uploadFile'. $a]['name']; $arr1=array($files); foreach ($arr1 as $file) { $all="<img src='textonimage5.php?file=$file'>"; move_uploaded_file($all, $att_path."/".$uniq.".".$ext ); } } ?> this code is not adding the name to image while uploading into directory.please correct me where iam wrong. thanks mrjameer
  13. hi, i want to add the text to my images.here is my code but it is adding the text to only first image(horses.jpg) and displaying that image. this is my code.i want to add www.abc.com on both images. any of your idea will be appreciated.please find where iam wrong. <?php $arr1=array('horses.jpg','leop.jpg'); for($i=0; $i<count($arr1); $i++) { $image = imagecreatefromjpeg($arr1[$i]); $font_size = 12; $color = imagecolorallocate($image, 205,205,255); $black = imagecolorallocate($image, 0,0,0); ImageTTFText ($image, $font_size, 0, 01, 10, $black, "../fonts/ARIALBD.TTF","www.abcd.com"); ImageTTFText ($image, $font_size, 0, 00, 9, $color, "../fonts/ARIALBD.TTF","www.abcd.com"); header("Content-type: image/jpeg"); imagejpeg($image); imagedestroy($image); } ?> thanks mrjameer
  14. hi, how to display an array of images using php.iam storing the images in array as follows.but how can i print these images. $arr1=array('back_test.jpg','horses.jpg'); thanks mrjameer
  15. hi, can anybody tell me please how i can display the .psd file using php.i know that we canot use <img src=''>.for that one we need a separate class for handling the .psd files thanks mrjameer.
  16. hi, i want to print the file name with out extension.here is my code for getting the extension.but how i can get only file name without extension <?php $file = "welcome.txt"; $aFile = explode(".", $file); $ext = array_pop($aFile); echo $ext; ?> any of your idea will be appreciated. thanks mrjameer.
  17. hi, in my image upload site till now only one text box for one image/any file uploads.but i modified it so that the user if he enter 2 it will dynamically create 2 textboxes so that he can upload 2 files.if he enter 9 he can upload 9 files(maximum limit 9). when a user uploads the zip file and jpg file and bitmap or any other file,how can i display the file types which is uploaded by a user. this works but when i upload all images it will displays all images,if i upload all types of files except images it will displays last uploaded file repeatedly.problem is when i upload 1 image and 1 text file,it is taking the last file upload and displays that extension only upload_6.php <?php if( $_POST['submit']) { for($a=0;$a<$uploadNeed;$a++) { $ok_filetypes = explode("|",$att_filetypes); if (!$_FILES['uploadFile'. $a]['name'] && $_FILES['uploadFile'. $a]['name'] > $att_max_size*1024) { errform('<CENTER>Sorry, but the attached file is too large. Please reduce the size of it's contents.</CENTER><BR><BR>'); // #err $step = 1; } $filename = (!$_FILES['uploadFile'. $a]['name'] ? substr( basename($_FILES['uploadFile'. $a]['name']), -30 ) : ''); $x = strtolower( substr($_FILES['uploadFile'. $a]['name'], -3)); if($filename && !in_array($x, $ok_filetypes) ) { errform('<CENTER>Sorry, the filetype you have tried to upload is not allowed.</CENTER><BR><BR>'); $step = 1; } if(!$posterr) { if(!isset($_GET["ipaddress"]) || ($_GET["ipaddress"] == "")) { $ipaddress = $_SERVER['REMOTE_ADDR']; $local = 1; } else { $ipaddress = $_GET["ipaddress"]; $local = 0; } $uniq = substr( md5(uniqid (rand())), 0, 10 ); $ext = strtolower( substr($_FILES['uploadFile'. $a]['name'], -3)); move_uploaded_file($_FILES['uploadFile'. $a]['tmp_name'], $att_path."/".$uniq.".".$ext ); $strQuery = "INSERT INTO images SET "; $strQuery .= "filename='".$uniq.".".$ext."',"; $strQuery .= "ipaddress='{$ipaddress}',"; $strQuery .= "date='".time()."',"; $strQuery .= "pkey='{$uniq}',"; if($myuid) { $strQuery .= "user='{$myuid}',"; } $strQuery .= "status='1'"; $result = mysql_query($strQuery) or die( mysql_error() ); $aid = mysql_insert_id(); if($aid) { $filen[$a] = $siteurl."/".str_replace('./', '', $att_path)."/".$uniq.".".$ext; $filen[$a] = str_replace('http://','%%',$filen[$a]); $filen[$a] = str_replace('//','/',$filen[$a]); $filen[$a] = str_replace('%%','http://',$filen[$a]); $step = 2; } else { $step = 1; } } } } else{ $step = 1; } if($step == 1) { ?> <html> <head> </head> <body> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <div align=center> <form ENCTYPE="multipart/form-data" method="post" name="form1"> <p> <? // start of dynamic form $uploadNeed = $_POST['uploadNeed']; for($y=0;$y<$uploadNeed;$y++){ ?> <input name="uploadFile<? echo $y;?>" type="file" id="uploadFile<? echo $y;?>"> </p> <? // end of for loop } ?> <p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>"> <input type="submit" name="submit" value="&#1578;&#1581;&#1600;&#1600;&#1605;&#1610;&#1604;"> </form> </div> </td> </tr> </table></body> <? } else{ ?> <div align="center"><b>aa</b><br> <br> </div> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <?php for($a=0;$a<$uploadNeed;$a++) { $size = getimagesize("$filen[$a]"); $height = $size[1]; $width = $size[0]; if ($height > 250) { $height = 100; $percent = ($size[1] / $height); $width = ($size[0] / $percent); } else if ($width > 250) { $width = 200; $percent = ($size[0] / $width); $height = ($size[1] / $percent); } if($filen[$a] > 5) { echo "</BR>"; } if (($ext==gif) or ($ext==jpg) or ($ext==psd) or ($ext==png) or ($ext==bmp)) { echo "<img src='".$filen[$a]."' border='0' height='$height' width='$width'>"; } else { echo "you have uploaded the ". $filen[$a] . " file<br>"; } } ?> </div></td> </tr> ?> upload.php <form ENCTYPE="multipart/form-data" method="post" name="form1" action="upload_6.php"> <p>Enter the amount of boxes you will need below. Max = 9.</p> <p><input name="uploadNeed" type="text" id="uploadNeed" maxlength="1" size="30"> </p> <p><input type="submit" name="Submit" value="Submit"></p> </form> thanks mrjameer
  18. hi, whenever a user will upload the images on my site,i want to add my sitename dynamically on each and every image.any of your ideas will be appreciated thanks mrjameer
  19. hi, when a user will upload the image on my site i want to show an animated gif for indicating that the form is being validated any of your idea will be surely appreciated thanks mrjameer
  20. hi, i have a menu on web-page.it has 4 menu items 1.about 2.contact 3.privacy 4.help when i click 'about' it displays some info about the company. similarly contact,privacy,help.inside every page i have the links to move to the next menu item. what i want is when a user clicks on 'contact' link first,then it display the contact info and show the link for 'about'. if a user clicks on about menu item first.the links inside the pages should be like this about->contact->privacy->help. if a user clicks on contact menu item first.the links inside the pages should be like this contact->about->privacy->help. if a user clicks on privacy menu item first.the links inside the pages should be like this privacy->about->contact->help. if a user clicks on help menu item first.the links inside the pages should be like this help->about->contact->privacy->. how to do this.any of your help will be greatly appreciated thanks mrjameer
  21. hi i have a script for displaying the records from mysql table along with checkboxes to delete the multiple records from table.what i want is i want to put the code inside one class and one function.that's all.but when i put the code in class & function the record is not deleting but when i remove the class & function the record is deleting.any of your help will be appreciated. here is my code view.html.php [code=php:0] <?php //class viewclients_html //{ //function viewclients() //{ include 'db.php'; mysql_connect($host,$username,$password); mysql_select_db($db) or die("Unable to select database"); $sql="SELECT * FROM host ORDER BY date DESC"; $result=mysql_query($sql); $count=mysql_num_rows($result); ?> <center><table width="700" border="0" cellspacing="1" cellpadding="0"> <tr> <td><font color="navy"><form name="form1" method="post" action=""><br><center><b> <u><font color="magenta">CLIENTS</font></u></b></center><br><br> <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td bgcolor="lightgreen" align="center"><font color="navy">#</font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Id</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Name</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Email</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Phone</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Country</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>City</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Message</strong></font></td> <td bgcolor="lightgreen" align="center"><font color="navy"><strong>Date</strong></font></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <font color="navy"> <tr  class="odd" onmouseover="over(this);" onmouseout="out(this);"> <td align="center"><font color="navy"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></font></td> <td><font color="navy"><? echo $rows['id']; ?></font></td> <td><font color="navy"><? echo $rows['name']; ?></font></td> <td><font color="navy"><? echo $rows['email']; ?></font></td> <td><font color="navy"><? echo $rows['phone']; ?></font></td> <td><font color="navy"><? echo $rows['country']; ?></font></td> <td><font color="navy"><? echo $rows['city']; ?></font></td> <td><font color="navy"><? echo $rows['message']; ?></font></td> <td><font color="navy"><? echo $rows['date']; ?></font></td> </tr></font> <?php } ?> <tr> <td colspan="5" align="center" ><input name="delete" type="submit" id="delete" value="Delete"></font></td> </tr></table></center> <? // Check if delete button active, start this if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM host WHERE id='$del_id'"; $result = mysql_query($sql); } // if successful redirect to checkdelete1.php if($result){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=viewclients.php\">"; } } mysql_close(); //}} class & function close ?> </table> </form> </font></td> </tr> </table></center> <style type="text/css"> <!-- tr.odd{background-color:white;} tr.even{background-color:red;} --> </style> <script language="JavaScript" type="text/javascript"> <!-- function over(row) {     row.oldBackgroundColor = row.style.backgroundColor;     row.style.backgroundColor = 'pink'; } function out(row) {     row.style.backgroundColor = row.oldBackgroundColor; } //--> </script> [/code] iam accessing the function in another script as follows view.php <?php require_once( $mainframe->getPath( 'front_html' ) ); viewclients_HTML::viewclients(); ?>
  22. hi, i have put all the code in for loop so that the user can dynamically create the upload boxes and upload the images.everything is ok.but the problem is i want to display the uploaded images.how i can put them in a loop.any of your help will be appreciated.i have used following line for display but it is displaying same image many times instead of displaying uploaded images. <?php for($a=0;$a<$uploadNeed;$a++){ echo "<img src='".$filen."'>";}?> thanks mrjameer upload6.php [code=php:0] <?php if( $_POST['submit']) { //$uploads = count($_FILES['uploadFile'.$y]['name']); //$countUploads = count( $_FILES['uploadFile'. $x]['name']); for($a=0;$a<$uploadNeed;$a++) { $ok_filetypes = explode("|",$att_filetypes); if (!$_FILES['uploadFile'. $a]['name'] && $_FILES['uploadFile'. $a]['name'] > $att_max_size*1024) { errform('<CENTER>Sorry, but the attached file is too large. Please reduce the size of it\'s contents.</CENTER><BR><BR>'); // #err $step = 1; } $filename = (!$_FILES['uploadFile'. $a]['name'] ? substr( basename($_FILES['uploadFile'. $a]['name']), -30 ) : ''); $x = strtolower( substr($_FILES['uploadFile'. $a]['name'], -3)); if($filename && !in_array($x, $ok_filetypes) ) { errform('<CENTER>Sorry, the filetype you have tried to upload is not allowed.</CENTER><BR><BR>'); $step = 1; } if(!$posterr) { if(!isset($_GET["ipaddress"]) || ($_GET["ipaddress"] == "")) { $ipaddress = $_SERVER['REMOTE_ADDR']; $local = 1; } else { $ipaddress = $_GET["ipaddress"]; $local = 0; } $uniq = substr( md5(uniqid (rand())), 0, 10 ); $ext = strtolower( substr($_FILES['uploadFile'. $a]['name'], -3)); move_uploaded_file($_FILES['uploadFile'. $a]['tmp_name'], $att_path."/".$uniq.".".$ext );   //move_uploaded_file($_FILES['attached']['tmp_name'], $att_path."/".$uniq.".".$ext ); $strQuery  = "INSERT INTO images SET "; $strQuery .= "filename='".$uniq.".".$ext."',"; $strQuery .= "ipaddress='{$ipaddress}',"; $strQuery .= "date='".time()."',"; $strQuery .= "pkey='{$uniq}',"; if($myuid) { $strQuery .= "user='{$myuid}',"; } $strQuery .= "status='1'"; $result = mysql_query($strQuery) or die( mysql_error() ); $aid = mysql_insert_id(); if($aid) { $filen = $siteurl."/".str_replace('./', '', $att_path)."/".$uniq.".".$ext; $filen = str_replace('http://','%%',$filen); $filen = str_replace('//','/',$filen); $filen = str_replace('%%','http://',$filen); $step = 2; } else { $step = 1; } } } } else{ $step = 1; } if($step == 1) { ?> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <div align=center> <form ENCTYPE="multipart/form-data" method="post" name="form1"> <p>   <?   // start of dynamic form   $uploadNeed = $_POST['uploadNeed'];   for($y=0;$y<$uploadNeed;$y++){   ?>     <input name="uploadFile<? echo $y;?>" type="file" id="uploadFile<? echo $y;?>">   </p>   <?   // end of for loop   }   ?>   <p><input name="uploadNeed" type="hidden" value="<? echo $uploadNeed;?>"> <input type="submit" name="submit" value="submit"> </form> </div> </td> </tr> </table> <? }else{ ?> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <!--here i want to display all the images which are uploaded now--> <!--here i want to display all the images which are uploaded now--> <!--here i want to display all the images which are uploaded now--> <?php for($a=0;$a<$uploadNeed;$a++){ echo "<img src='".$filen."'>";}?> </div></td> </tr> <tr> <td> <textarea name="textarea" cols="100" wrap="soft" rows="3"> [url=http://<?=$siteurl?>][img]http://<?=$filen?>[/img][/url] </textarea> </div></td> </tr> <tr> <td>         <textarea name="textarea2" cols="100" rows="4"> <?=$filen?></textarea>       </div></td> </tr> <tr> <td> <textarea name="textarea3" cols="100" wrap="soft" rows="3"> <a href="<?=$siteurl?>" target="_blank"><img alt="Image Hosted by <?=$sitename?>" src="<?=$filen?>" /></a> </textarea> </div></td> </tr> <tr> <td>&nbsp;</td> </tr> </table> <? } ?> [/code] upload.php <body> <form name="form1" method="post" action="upload6.php">   <p>Enter the amount of boxes you will need below. Max = 9.</p>   <p>     <input name="uploadNeed" type="text" id="uploadNeed" maxlength="1">   </p>   <p>     <input type="submit" name="Submit" value="Submit">   </p> </form> </body>
  23. hi, i have the script that will upload 5 images in folder and also stores image path in mysql table.what happen if any body want to upload one image only or 2 images only.how can i handle it. [code=php:0] <?php $siteurl = "http://localhost/ahmup"; $adminemail = "[email protected]"; $att_max_size = '50000000000000'; $att_filetypes = "gif|jpg|png|zip|swf|txt|bmp";     $dbServer = "localhost"; $dbUser = ""; $dbPass = ""; $dbName = "ahmupco_up"; @mysql_connect($dbServer, $dbUser, $dbPass) or die("Couldn't connect to database server: " . mysql_error()); @mysql_select_db($dbName) or die("Couldn't connect to database: " . mysql_error()); if($_POST['submit'] && $_FILES['attached']['name'][0] && $_FILES['attached']['name'][1] && $_FILES['attached']['name'][2]) { $ok_filetypes = explode("|",$att_filetypes); if (!$_FILES['attached']['error'] && $_FILES['attached']['size'] > $att_max_size*1024){ echo "<CENTER>Sorry, but the attached file is too large. Please reduce the size of it\'s contents.</CENTER><BR><BR>"; // #err $step = 1; } $filename = (!$_FILES['attached']['error'] ? substr( basename($_FILES['attached']['name'][0]), -30 ) : ''); $filename1 = (!$_FILES['attached']['error'] ? substr( basename($_FILES['attached']['name'][1]), -30 ) : ''); $filename2 = (!$_FILES['attached']['error'] ? substr( basename($_FILES['attached']['name'][2]), -30 ) : ''); $x = strtolower( substr($_FILES['attached']['name'][0], -3)); $x1 = strtolower( substr($_FILES['attached']['name'][1], -3)); $x2 = strtolower( substr($_FILES['attached']['name'][2], -3)); if($filename && !in_array($x, $ok_filetypes) ){ echo "<CENTER>Sorry, the filetype you have tried to upload is not allowed.</CENTER><BR><BR>"; $step = 1; } if($filename1 && !in_array($x1, $ok_filetypes) ){ echo "<CENTER>Sorry, the filetype you have tried to upload is not allowed.</CENTER><BR><BR>"; $step = 1; } if($filename2 && !in_array($x2, $ok_filetypes) ){ echo "<CENTER>Sorry, the filetype you have tried to upload is not allowed.</CENTER><BR><BR>"; $step = 1; } if(!$posterr){ if(!isset($_GET["ipaddress"]) || ($_GET["ipaddress"] == "")) { $ipaddress = $_SERVER['REMOTE_ADDR']; $local = 1; } else { $ipaddress = $_GET["ipaddress"]; $local = 0; } $uniq = substr( md5(uniqid (rand())), 0, 10 ); $uniq1 = substr( md5(uniqid (rand())), 0, 10 ); $uniq2 = substr( md5(uniqid (rand())), 0, 10 ); $ext = strtolower( substr($_FILES['attached']['name'][0], -3)); $ext1 = strtolower( substr($_FILES['attached']['name'][1], -3)); $ext2 = strtolower( substr($_FILES['attached']['name'][2], -3)); move_uploaded_file($_FILES['attached']['tmp_name'][0], $att_path."/".$uniq.".".$ext ); move_uploaded_file($_FILES['attached']['tmp_name'][1], $att_path."/".$uniq1.".".$ext1 ); move_uploaded_file($_FILES['attached']['tmp_name'][2], $att_path."/".$uniq2.".".$ext2 ); $strQuery  = "INSERT INTO images SET "; $strQuery .= "filename='".$uniq.".".$ext."',"; $strQuery .= "ipaddress='{$ipaddress}',"; $strQuery .= "date='".time()."',"; $strQuery .= "pkey='{$uniq}',"; $strQuery1  = "INSERT INTO images SET "; $strQuery1 .= "filename='".$uniq1.".".$ext1."',"; $strQuery1 .= "ipaddress='{$ipaddress}',"; $strQuery1 .= "date='".time()."',"; $strQuery1 .= "pkey='{$uniq1}',"; $strQuery2  = "INSERT INTO images SET "; $strQuery2 .= "filename='".$uniq2.".".$ext2."',"; $strQuery2 .= "ipaddress='{$ipaddress}',"; $strQuery2 .= "date='".time()."',"; $strQuery2 .= "pkey='{$uniq2}',"; //$strQuery  = "INSERT INTO images(filename,ipaddress,date,pkey) VALUES($uniq.".".$ext,$ipaddress,'".time()."',$uniq)"; if($myuid){ $strQuery .= "user='{$myuid}',"; $strQuery1 .= "user='{$myuid}',"; $strQuery2 .= "user='{$myuid}',"; } $strQuery .= "status='1'"; $strQuery1 .= "status='1'"; $strQuery2 .= "status='1'"; $result = mysql_query($strQuery) or die( mysql_error() ); $result1 = mysql_query($strQuery1) or die( mysql_error() ); $result2 = mysql_query($strQuery2) or die( mysql_error() ); $aid = mysql_insert_id(); // $aid1 = mysql_insert_id(); if($aid){ $filen = $siteurl."/".str_replace('./', '', $att_path)."/".$uniq.".".$ext; $filen = str_replace('http://','%%',$filen); $filen = str_replace('//','/',$filen); $filen = str_replace('%%','http://',$filen); $filen1 = $siteurl."/".str_replace('./', '', $att_path)."/".$uniq1.".".$ext1; $filen1 = str_replace('http://','%%',$filen1); $filen1 = str_replace('//','/',$filen1); $filen1 = str_replace('%%','http://',$filen1); $filen2 = $siteurl."/".str_replace('./', '', $att_path)."/".$uniq2.".".$ext2; $filen2 = str_replace('http://','%%',$filen2); $filen2 = str_replace('//','/',$filen2); $filen2 = str_replace('%%','http://',$filen2); $step = 2; }else{ $step = 1; } } }else{ $step = 1; } if($step == 1){ ?> [/code] <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <div align=center> <form ENCTYPE="multipart/form-data" method="post" name="form1"> <INPUT NAME="attached[]" TYPE="file"  size="50"><br><br> <INPUT NAME="attached[]" TYPE="file"  size="50"><br><br> <INPUT NAME="attached[]" TYPE="file"  size="50"><br><br> <input type="submit" name="submit" value="submit"> </form> </div> </td> </tr> </table> <? }else{ ?> <div align="center">   <br> </div> <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><div align="center"> <img src="<?=$filen?>">&nbsp;<img src="<?=$filen1?>">&nbsp;<img src="<?=$filen2?>">&nbsp; </div></td> </tr> <tr> <td><div align="center"><br> <textarea name="textarea" cols="100" wrap="soft" rows="3"> [url=http://<?=$siteurl?>][img]http://<?=$filen?>[/img][/url] [url=http://<?=$siteurl?>][img]http://<?=$filen1?>[/img][/url] [url=http://<?=$siteurl?>][img]http://<?=$filen2?>[/img][/url] </textarea> </div></td> </tr> <tr> <td><div align="center"><br>         <textarea name="textarea2" cols="100" rows="4"><?=$filen?><?=$filen1?><?=$filen2?> </textarea>       </div></td> </tr> <tr> <td><div align="center"><br> <br> <textarea name="textarea3" cols="100" wrap="soft" rows="3"> <a href="<?=$siteurl?>" target="_blank"> <img alt="Image Hosted by <?=$sitename?>" src="<?=$filen?>" /></a> <a href="<?=$siteurl?>" target="_blank"> <img alt="Image Hosted by <?=$sitename?>" src="<?=$filen1?>" /></a> <a href="<?=$siteurl?>" target="_blank"> <img alt="Image Hosted by <?=$sitename?>" src="<?=$filen2?>" /></a> </textarea> </div></td> </tr> <tr> <td>&nbsp;</td> </tr> </table> <? } ?>
  24. the records for this bb table has been dumped from text file.the code for moving data from text file to table is <?php $conn4=mysql_connect("localhost","",""); mysql_select_db("mrj",$conn4); $fp = fopen("file.txt", "r"); if($fp) {   while( !feof($fp) )   {       $line = fgets($fp, 1024);       list($email) = explode(',', $line);       // do inserts here, i.e.       $query = "INSERT INTO bb (email) VALUES                 ('$email')";       $result=mysql_query($query,$conn4);   }     echo "ok"; } else {   echo 'unable to open file for read'; } ?> CREATE TABLE `bb` (   `email` text NOT NULL ) TYPE=MyISAM; # # Dumping data for table `bb` # INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); INSERT INTO `bb` VALUES ('[email protected]\r\n'); CREATE TABLE `cc` (   `email` text NOT NULL ) TYPE=MyISAM;
  25. hi, i executed it in phpmyadmin but it is showing all the rows.i have created a table with only id,email fields.inserted 5 records with some duplicates and executed to display the distinct records.it is working but when i transfer the this data in to some other it is not working. thanks mrjameer
×
×
  • 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.