Jump to content

jakebur01

Members
  • Posts

    885
  • Joined

  • Last visited

Everything posted by jakebur01

  1. It is updating the first row of callbacks table columns A1-A6 and that is all it is updating. For some reason it is not storing B1-E7 in the array and it is not looping through the other rows. foreach ($zips as $key => $value) { $result = mysql_query("SELECT Dealer, Address, City, State, Zip, Phone FROM extreme WHERE Zip = '$key' AND Type='store' AND `InStore` <> 'NO' LIMIT 5", $db); while($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { $myrow[] = $row; } mysql_query("UPDATE callbacks SET `A1`='{$myrow[0]['Dealer']}', `A2`='{$myrow[0]['Address']}', `A3`='{$myrow[0]['City']}', `A4`='{$myrow[0]['State']}', `A5`='{$myrow[0]['Zip']}', `A6`='{$myrow[0]['Phone']}', `B1`='{$myrow[1]['Dealer']}', `B2`='{$myrow[1]['Address']}', `B3`='{$myrow[1]['City']}', `B4`='{$myrow[1]['State']}', `B5`='{$myrow[1]['Zip']}', `B6`='{$myrow[1]['Phone']}', `C1`='{$myrow[2]['Dealer']}', `C2`='{$myrow[2]['Address']}', `C3`='{$myrow[2]['City']}', `C4`='{$myrow[2]['State']}', `C5`='{$myrow[2]['Zip']}', `C6`='{$myrow[2]['Phone']}', `D1`='{$myrow[3]['Dealer']}', `D2`='{$myrow[3]['Address']}', `D3`='{$myrow[3]['City']}', `D4`='{$myrow[3]['State']}', `D5`='{$myrow[3]['Zip']}', `D6`='{$myrow[3]['Phone']}', `E1`='{$myrow[4]['Dealer']}', `E2`='{$myrow[4]['Address']}', `E3`='{$myrow[4]['City']}', `E4`='{$myrow[4]['State']}', `E5`='{$myrow[4]['Zip']}', `E6`='{$myrow[4]['Phone']}' WHERE `id`='$callid'", $db); }
  2. I really would like to do something like this: UPDATE TABLE SET `A1`=$myrow["0"][0], `A2`=$myrow["0"][1], `A3`=$myrow["0"][2], `A4`=$myrow["0"][3], `A5`=$myrow["0"][4], `A6`=$myrow["0"][5], `A7`=$myrow["0"][6], `B1`=$myrow["1"][0], `B2`=$myrow["1"][1], `B3`=$myrow["1"][2], `B4`=$myrow["1"][3], `B5`=$myrow["1"][4], `B6`=$myrow["1"][5], `B7`=$myrow["1"][6], etc...... WHERE `id`='$rowid' Is this possible?
  3. I am pulling 5 addresses and I am wanting to store these 5 addresses in columns in a separate table. On the query string I put LIMIT 5. How can I store the results of each of the 5 loops into columns in a separate table? The columns are A1(for name), A2(for address), A3 (for city), A4 (for state), A5 (for zip), A6 (for phone), A7 (for miles), .... then I also have B1-B7, C1-C7, D1-D7, and E1-E7. I am basically wanting to store up to 5 addresses in an array and then update them into a mysql table. foreach ($zips as $key => $value) { $result = mysql_query("SELECT State FROM extreme WHERE Zip = '$key' AND Type='store' AND `InStore` <> 'NO' LIMIT 5", $db); $num_rows = mysql_num_rows($result); while($myrow = mysql_fetch_array ($result)) { $Dealer=$myrow['Dealer']; $Address=$myrow['Address']; $City=$myrow['City']; $State=$myrow['State']; $Zip=$myrow['Zip']; $Phone=$myrow['Phone']; $Miles = $value; } }
  4. Anyone have any ideas? Thanks, Jake
  5. How can I limit the number of messages returned to 25 and sort them by date? $result = imap_search($mbox,"FROM $customer_email"); echo"<table width=100% border=1>"; foreach ($result as $value) { $mailHeader = @imap_headerinfo($mbox, $value); $from = $mailHeader->fromaddress; $subject = strip_tags($mailHeader->subject); $date = $mailHeader->date; echo "<tr><td>$from</td><td><a href=\"imap_email.php?what=read&eid=$value\" target=\"_blank\">$subject</a></td><td>$date</td><tr>"; } echo"</table>"; imap_close($mbox);
  6. I am trying to link up our e-mails with our little customer communication program I built. So when you pull up a customers account, it will do a imap_search on our employees mailboxes and list all the e-mails pertaining to the customer.
  7. Something like this? foreach($result as $msgno) { $headers = imap_fetchheader($mbox, $msgno); }
  8. I have a connection to my imap account and I would like to use imap_search. I have googled several different things and found stuff that would return the message id or numbers, but I do not know how to return the headers. How can I return headers after using this? $result = imap_search($mbox, 'FROM "chris@testmail.com"');
  9. Hi, I could not find a board for this. So, I figured I would just post it here. I have been using pipeline data since 2007. They keep going up on their fees on top of their yearly fee and yearly $250 PCI compliance fee, and monthly fees. I have the api working great for me in php though. I hate to change. Does anyone have in comments about who would be a good credit card processing company to go with? Thanks, Jake
  10. when i try to do -2, -3, -4 and so on... it works but if i just try -1 it shows the current month echo date('m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));
  11. I have an error on the gif resizer: Fatal error: Class 'Imagick' not found
  12. Does anyone have any ideas on what might be causing this?
  13. Now it is not resizing the original image. I have $max_image_width=400; $max_image_height=300; set in the config file.
  14. Got it~ Thank you much! $img1_size=$_FILES['img1_name']['size']; $img1_name=$_FILES['img1_name']['name']; $img1_type=$_FILES['img1_name']['type']; $img1=$_FILES['img1_name']['tmp_name']; $img1_error=$_FILES['img1_name']['error'];
  15. I tried this: $img1_name=$_FILES['img1_name']['size']; $img1_name.=$_FILES['img1_name']['name']; $img1_name.=$_FILES['img1_name']['type']; $img1_name.=$_FILES['img1_name']['tmp_name']; $img1_name.=$_FILES['img1_name']['error']; But,.... I get this: Error: .jpg or .gif File Types Only Please
  16. This is what I was looking for. How can I store all of these into the $img1_name variable?
  17. I have tried all three extensions. I think the problem may be that I am not properly posting the file to the page. I am currently using: $img1_name = $_FILES['img1_name'];
  18. I doubt that. The jpeg I was trying to upload is 8kb.
  19. Hello, I just moved my image uploader script from a windows server to linux. Somehow I guess php was grabbing the post variables automatically on the windows server. Any way, my problem is that it is not reading the file on the upload page. It throws the error "Error: No File Specified". I tried putting $img1_name=$_FILES['img1_name']; then I was getting a file extension error. form <FORM ACTION="/imageuploader/image_receiver.php" METHOD="POST" NAME="udata" ENCTYPE="multipart/form-data"> <FONT SIZE=-1> <p class="m_text">Your post may not contain any foul content! <br />Your ip address is <?php echo $ip; ?> and will be stored for our records.</p> <p><B>Enter Photo Upload Code:</B> <INPUT TYPE="password" NAME="pass" SIZE=10> <img src="images/secretcode.jpg" alt="secret code" width="150" height="45"></p> <p><B>Enter File Name:</B> <INPUT TYPE="file" NAME="img1_name" id="img1_name" SIZE="30"> </p> <p><B>Name:</B> <label> <input name="name" type="text" id="name" value="" size="30" maxlength="30"> </label> </p> <p><B>Description:</B> <label> <input name="description" type="text" id="description" value="" size="50" maxlength="80"> </label> </p> <p> <INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Upload File"> </p> </FORM> image upload page <?php $name = $_POST['name']; $description = $_POST['description']; $pass = $_POST['pass']; ////////////////// Image Uploader Receiver /////////////////// // Copyright (c) 2003 CarTest Software, All Rights Reserved // ////////////////////////////////////////////////////////////// include "image_receiver_header.html"; require "image_config.php"; // check password if($require_password_to_upload && $pass != $password) die("Invalid Password Entered"); // file specified? if($img1_name == "") die("Error: No File Specified"); // allowed file types $ext1=".jpg"; $ext2=".gif"; $ext=strtolower(substr($img1_name, strlen($img1_name)-4)); $imageType=0; if($ext == $ext1) { $imageType=1; } elseif ($ext == $ext2) { $imageType=2; } else { die("Error: $ext1 or $ext2 File Types Only Please"); } $ran = rand () ; $img1_name = $ran.date(MDY)."$ext"; $db = new mysqli('localhost', 'tuser', 'user', 'table'); if (mysqli_connect_errno()) { echo 'Error: Could not connect to database. Please try again later.'; exit; } $ip=$_SERVER['REMOTE_ADDR']; $url= "http://www.mysite.com/imageuploader/uploads/$img1_name"; $query = "insert into extremephoto values ('0', '$url', '$name', '$description', '$ip', 'no')"; $result = $db->query($query) or die(mysqli_error()); if ($result) echo $db->affected_rows.' message inserted into database. '; $db->close(); // file size limit if($file_size_limit >= 0 && $img1_size > $file_size_limit) die ("File Size Exceeds $file_size_limit Byte Limit"); // replace certain characters with _ $img1_name=strtr($img1_name," ","_"); $img1_name=strtr($img1_name,"#","_"); $img1_name=strtr($img1_name,"/","_"); $img1_name=strtr($img1_name,"\\","_"); // need to escape the backslash character $img1_name=strtr($img1_name,"%","_"); // check if file already exists $fullpath_to_image=$path_to_images.$img1_name; if(file_exists($fullpath_to_image)) { die("Error: File Already Exists"); } // check for banned ip if(strlen($banned_ip_list_file_name) > 0) { $fo=fopen($banned_ip_list_file_name,"rt"); if($fo != 0) { while(!feof($fo)) { $ipaddr=fgets($fo); $ipaddr=substr($ipaddr, 0, strlen($ipaddr)-1); // strip \n character at end automatically read in $l=strlen($ipaddr); if($l > 0 && substr($REMOTE_ADDR, 0, $l) == $ipaddr) die("Uploader Closed"); } $fc=fclose($fo); } } // full paths to thumbnails if(strlen($path_to_thumbnails) > 0 && $thumbnail_width > 0 && $thumbnail_height > 0) { $fullpath_to_thumbnail=$path_to_thumbnails.$img1_name; $thumbs=true; } else { $thumbs=false; } // save image, @ symbol means ignore errors generated copy($img1 , $fullpath_to_image) or die("Error: Couldn't Upload Your File"); // add file name, ip address, and timestamp to log file // open, lock the file, seek file pointer to end, write record, close (unlocks) if(strlen($upload_log_file_name) > 0) { $fo=fopen($upload_log_file_name,"a+t"); $fl=flock($fo,LOCK_EX); $fs=fseek($fo, 0, SEEK_END); $fw=fputs($fo,$img1_name." ".$REMOTE_ADDR." ".date("M d Y, H:i")."\n"); $fc=fclose($fo); } // resize? if($max_image_width > 0 && $max_image_height > 0) { $resize=true; } else { $resize=false; } // resize image to (maxwidth x maxheight) preserving existing aspect ratio (unless already smaller) and resave with fixed compression level // and create thumbnail .jpeg only if($imageType == 1) { // create images if($thumbs) $imgthumb=@imageCreateTrueColor($thumbnail_width, $thumbnail_height) or die ("Error: Cannot Create Thumbnail Image"); // need an image resource for resizing, do this even if not resizing to check for valid jpeg format file $im=@imageCreateFromJpeg($fullpath_to_image); if($im === false) { @unlink($fullpath_to_image) or die("Error: Improper Jpeg Image, Couldn't Delete File"); die ("Error: Improper Jpeg Image, Image Deleted"); } // original image size $sx=imageSx($im); $sy=imageSy($im); if($thumbs) { // use Resampled rather than Resize otherwise thumbnail is terrible @imageCopyResampled($imgthumb, $im, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $sx, $sy) or die("Error: Error Resizing for Thumbnail"); // write to subdirectory with same name as large file @imageJpeg($imgthumb, $fullpath_to_thumbnail, $image_quality) or die("Error: Couldn't Save Jpeg Thumbnail"); } if($resize) { // delete initial image @unlink($fullpath_to_image) or die("Error: Couldn't Delete Original Image"); // resize original image if($sx > $max_image_width || $sy > $max_image_height) { $rx=round($max_image_width); $ry=round($rx/($sx/$sy)); if($ry > $max_image_height) { $ry=round($max_image_height); $rx=round($ry*($sx/$sy)); } $imresized=@imageCreateTrueColor($rx, $ry) or die ("Error: Cannot Create Resized Image"); @imageCopyResampled($imresized, $im, 0, 0, 0, 0, $rx, $ry, $sx, $sy) or die("Error: Error Resizing Image"); @imageJpeg($imresized, $fullpath_to_image, $image_quality) or die("Error: Couldn't Save Resampled/Resized Jpeg"); } else { @imageJpeg($im, $fullpath_to_image, $image_quality) or die("Error: Couldn't Save Resampled Jpeg"); } } } else { // image size only for .gif $as = Array(); $as=getImageSize($fullpath_to_image); $sx=$as[0]; // image width $sy=$as[1]; // image height } echo "<BR><BR><BR>"; echo "<H1>File Upload Successful!</H1>"; //echo "<P>Successfully Sent: $img1_name, a $img1_size byte, $sx x $sy (original size) file with the extension type of $img1_type"; echo "<BR>"; if($resize && $imageType == 1) { $newsize=filesize($fullpath_to_image); if($sx > $max_image_width || $sy > $max_image_height) { // echo "<P>Image was resized to $rx x $ry and recompressed to $newsize bytes<BR>"; } else { //echo "<P>Image was recompressed to a file size of $newsize bytes<BR>"; } }
  20. I was missing quotes on all the other ones. Thank you for your help.
  21. got it working now: <select name="Store"> <option value="Academy"<?php if($myrow['Store']=="Academy") {echo' selected="selected"';}?>>Academy</option> <option value="B & R"<?php if($myrow['Store']=="B & R") {echo' selected="selected"';}?>>B & R</option> <option value="Brookshire"<?php if($myrow['Store']=="Brookshire") {echo' selected="selected"';}?>>Brookshire</option> <option value="Bass Pro"<?php if($myrow['Store']=="Bass Pro") {echo' selected="selected"';}?>>Bass Pro</option> <option value="Extreme"<?php if($myrow['Store']=="Extreme") {echo' selected="selected"';}?>>Extreme</option> <option value="prospect"<?php if($myrow['Store']=="prospect") {echo' selected="selected"';}?>>prospect</option> </select>
  22. <select name="Store"> <option value="Academy"<?php if($myrow['Store']==Academy) {echo' selected="selected"';}?>>Academy</option> <option value="B & R"<?php if($myrow['Store']=="B %26 R") {echo' selected="selected"';}?>>B & R</option> <option value="Brookshire"<?php if($myrow['Store']==Brookshire) {echo' selected="selected"';}?>>Brookshire</option> <option value="Bass Pro"<?php if($myrow['Store']==Bass Pro) {echo' selected="selected"';}?>>Bass Pro</option> <option value="Extreme"<?php if($myrow['Store']==Extreme) {echo' selected="selected"';}?>>Extreme</option> <option value="prospect"<?php if($myrow['Store']==prospect) {echo' selected="selected"';}?>>prospect</option> </select>
  23. I also tried this: <option value="B & R"<?php if($myrow['Store']=="B %26 R") {echo' selected="selected"';}?>>B & R</option>
×
×
  • 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.