Jump to content

tomjung09

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tomjung09's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You make a good point PFMaBiSmAd. It looks like it isn't the require once file but the function that is being called that is failing. This is the code I ran on it, the error!!! is never printed. Does that mean that the function get_distance is erroring out? <?php echo "test"; try{ $distance = zipcode_class::get_distance($zip1, $temp); } catch(Exception $e){ echo "error!!!"; } ?>
  2. Thanks for the reply. It's actually the zipcodefunctions that I am having issues with. I tried include("zipcodefunctions.php"); and include 'zipcodefunctions.php'; No luck with either one.
  3. Hi. I am trying to use the require_once function in php to include a file. It is working in Chrome, and Firefox but not in IE8 and I cannot figure out why. Main file (home.php) <?php require_once 'salvagedrides.php'; require_once 'zipcodefunctions.php'; ?> the two files are in the same directory, it has no problem with salvagedrides.php but fails when I try to include the zipcodefunctions.php Any ideas why? The website is http://www.salvagedrides.com/usa/home.php
  4. Man I am good, apparently having multiple ini_set('sendmail_from', 'postmaster@salvagedrides.com'); statements causes a problem. Peace, love, and good times!
  5. Okay, I can't figure this one out... I am sending 3 different emails from one page. I am trying to get the first two to work. This is the code for the first email sent: //send email to user that was outbid $to = $outbid_user; $from_header = "SalvagedRides.com"; $subject = "You have been outbid!"; $contents = "You have been outbid on the " . $title . "motorcyle. To bid on this bike again you can follow this link: http://www.salvagedrides.com/usa/home.php?innerframe=bike.php?id=" . $id . " \n\n Thank you for choosing SalvagedRides \n\n -The SalvagedRides Team"; ini_set('sendmail_from', 'postmaster@salvagedrides.com'); if(mail($to, $subject, $contents, $from_header)){echo "Mail sent to outbid user";} This email will send, the second one however, no dice: //send email to current high bidder $to_high = $userArray['email']; $from_header_high = "SalvagedRides.com"; $subject_high = "You have been outbid!"; $contents_high = "You are the current high bidder on the " . $title . "motorcyle. We will notify you if you are outbid. Meanwhile, to check on the status of this bike, you can follow this link: http://www.salvagedrides.com/usa/home.php?innerframe=bike.php?id=" . $id . " \n\n Thank you for choosing SalvagedRides \n\n -The SalvagedRides Team"; ini_set('sendmail_from', 'postmaster@salvagedrides.com'); if(mail($to_high, $subject_high, $contents_high, $from_header_high)){echo "Mail sent to highbid user";} It hangs up, since this code is before the header, nothing loads and the second email never sends. Any idea why? I have checked the $to_high it is filled correctly.
  6. Okay, $_file is not empty but ["tmp_name"] is empty. Still can't figure out why...
  7. Ok, this isn't making sense, I changed upload_tmp_dir to "/tmp" and it worked. I made a small edit in my code (the part that does the upload not the one that posts the information) and it did not work again. I rolled back to the previous version that worked and it still does not work. This is frustrating. >.<
  8. My $_File array is empty and therefore I cannot upload images. It just stopped working, I have no Idea what I did. This is the form tag: <form id="pleasework" name="pleasework" method="post" action="uploadbikesubmit.php" enctype="multipart/form-data"> <input type="file" name="txtimage1"/> And the code I am using to upload it is this: <?php require_once 'salvagedrides.php'; mysql_select_db($database_sr, $sr); session_start(); //$username = $_SESSION['$user_ID']; ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-color: #D7DFEC; } .style1 {color: #00757E} .style2 {font-size: 12px} .style3 {font-size: 18px} --> </style></head> <body> <table width="699" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="210" height="107"> </td> <td width="454"> </td> <td width="35"> </td> </tr> <tr> <td height="267"> </td> <td valign="top" bgcolor="#CC3300"><?php $model = $_POST['txtmodel']; $year = $_POST['txtyear']; $make = $_POST['txtmake']; $bid = $_POST['txtbid']; $location = $_POST['txtlocation']; $zipcode = $_POST['txtzipcode']; $enddate = $_POST['txtenddate']; $actualenddate = $_POST['txtactualenddate']; $comments = $_POST['txtcomments']; $vin = $_POST['txtvin']; $engine = $_POST['txtengine']; $title = $_POST['txttitle']; $milage = $_POST['txtmilage']; $status = $_POST['txtstatus']; $location = $_POST['txtlocation']; $category = $_POST['txtcategory']; $keys = $_POST['txtkeys']; $featured = $_POST['txtfeatured']; //make sure all required fields are filled if($model == ""){header("Location: uploadbike.php?msg=model" . $back);} /* elseif($year == ""){header("Location: uploadbike.php?msg=year" . $back);} elseif($make == ""){header("Location: uploadbike.php?msg=make" . $back);} elseif($bid == ""){header("Location: uploadbike.php?msg=bid" . $back);} elseif($location == ""){header("Location: uploadbike.php?msg=location" . $back);} elseif($zipcode == ""){header("Location: uploadbike.php?msg=zipcode" . $back);} elseif($enddate == ""){header("Location: uploadbike.php?msg=enddate" . $back);} elseif($actualenddate == ""){header("Location: uploadbike.php?msg=actual" . $back);} elseif($_FILES['txtimage1']['name'] == ""){header("Location: uploadbike.php?msg=image1" . $back);} elseif($_FILES['txtimage2']['name'] == ""){header("Location: uploadbike.php?msg=image2" . $back);} elseif($_FILES['txtimage3']['name'] == ""){header("Location: uploadbike.php?msg=image3" . $back);} elseif($_FILES['txtimage4']['name'] == ""){header("Location: uploadbike.php?msg=image4" . $back);} elseif($_FILES['txtimage5']['name'] == ""){header("Location: uploadbike.php?msg=image6" . $back);} elseif($_FILES['txtimage6']['name'] == ""){header("Location: uploadbike.php?msg=image7" . $back);} elseif($_FILES['txtimage7']['name'] == ""){header("Location: uploadbike.php?msg=image8" . $back);} elseif($_FILES['txtimage8']['name'] == ""){header("Location: uploadbike.php?msg=image9" . $back);}*/ else{ //check dates $enddate = substr($enddate, 0, 4) . substr($enddate, 5, 2) . substr($enddate, 8, 2) . substr($enddate, 11, 2) . substr($enddate, 14, 2); $actualenddate = substr($actualenddate, 0, 4) . substr($actualenddate, 5, 2) . substr($actualenddate, 8, 2) . substr($actualenddate, 11, 2) . substr($actualenddate, 14, 2); $date = date("YmdHis"); $str[0] = strtolower($_FILES['txtimage1']['name']); $str[1] = strtolower($_FILES['txtimage2']['name']); $str[2] = strtolower($_FILES['txtimage3']['name']); $str[3] = strtolower($_FILES['txtimage4']['name']); $str[4] = strtolower($_FILES['txtimage5']['name']); $str[5] = strtolower($_FILES['txtimage6']['name']); $str[6] = strtolower($_FILES['txtimage7']['name']); $str[7] = strtolower($_FILES['txtimage8']['name']); $str[8] = strtolower($_FILES['txtimage0']['name']); for($x = 0; $x < 9; $x += 1){ //not closed yet $i = strrpos($str[$x],"."); $l = strlen($str[$x]) - $i; $ext = substr($str[$x],$i+1,$l); echo "loop"; $path[$x] = "bike_images/" . $date . $x .".". $ext; } //end for loop $image_thumb = $path[8]; if ($_FILES["txtimage1"]["error"] > 0) { echo "Error: " . $_FILES["txtimage1"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["txtimage1"]["name"] . "<br />"; echo "Type: " . $_FILES["txtimage1"]["type"] . "<br />"; echo "Size: " . ($_FILES["txtimage1"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["txtimage1"]["tmp_name"]; } move_uploaded_file($_FILES["txtimage1"]["tmp_name"], $path[0]); move_uploaded_file($_FILES['txtimage2']['tmp_name'], $path[1]); move_uploaded_file($_FILES['txtimage3']['tmp_name'], $path[2]); move_uploaded_file($_FILES['txtimage4']['tmp_name'], $path[3]); move_uploaded_file($_FILES['txtimage5']['tmp_name'], $path[4]); move_uploaded_file($_FILES['txtimage6']['tmp_name'], $path[5]); move_uploaded_file($_FILES['txtimage7']['tmp_name'], $path[6]); move_uploaded_file($_FILES['txtimage8']['tmp_name'], $path[7]); move_uploaded_file($_FILES['txtimage0']['tmp_name'], $path[8]); } ?> </td> <td> </td> </tr> <tr> <td height="126"> </td> <td> </td> <td> </td> </tr> </table> </body> </html> I am getting an Error: 7 from the part that checks for errors for txtimage1 - I'm pretty sure that means that the $_file array is empty. I have checked my folder settings, its 777. And the only thing I'm not sure about is my upload_tmp_dir in my ini file. Its set to /tmp/ and I have a folder under my root site folder named tmp. Any ideas?
  9. So...I had the wrong name for the copy($_FILES['uploadedfile']['tmp_name'], $path) it should have been copy($_FILES['txtimage1']['tmp_name'], $path) I'm a little perplexed as to why copy() works but move_uploaded_file() does not. At any rate, I suppose I spent 5 hours looking for something right in front of me.... I've been at this too long.
  10. I'm trying to do a simple upload from client computer to a directory on my server. I have checked the folder settings and it is chmod 777. This is my code: $path = $date . $x .".". "jpg"; $image2[$x] = $path; if ($_FILES["txtimage1"]["error"] > 0) { echo "Error: " . $_FILES["txtimage1"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["txtimage1"]["name"] . "<br />"; echo "Type: " . $_FILES["txtimage1"]["type"] . "<br />"; echo "Size: " . ($_FILES["txtimage1"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["txtimage1"]["tmp_name"]; } if(copy($_FILES['uploadedfile']['tmp_name'], $path)){echo "uploaded \n";} It outputs: Upload: 13332118_1X.JPG Type: image/jpeg Size: 88.9501953125 Kb Stored in: c:\winnt\temp\php4\php1190.tmp success I have tried setting the path to <filename> .jpg and .jpeg neither works, I am to the point where I am just trying to get it to upload to the directory that the php file resides in. The file txtimage1 is being called from contains the form and file form: <form id="form1" name="form1" method="post" action="uploadbikesubmit.php" enctype="multipart/form-data"> <input type="file" name="txtimage1"/> Any ideas on what might be causing the problem or things I might try? I have also tried the move_uploaded_file() function, no luck there either.
  11. Wow this was a headache. I figured it out, you have to have: <form id="form1" name="form1" method="post" enctype="multipart/form-data" action="uploadbikesubmit.php"> enctype="multipart/form-data" in the form settings.
  12. I am using the form: <form id="form1" name="form1" method="post" action="uploadbikesubmit.php"> to submit
  13. It seems like nothing is going right for me here lol. I am trying to upload a file from the clients computer to the server. I have been testing my code for about 2 hours and I cannot figure out why this does not work: original file: <input type="file" name="txtimage1"/> Upload file: $test = $_POST['txtimage1']; echo "test " . $test . " \n"; if ($_FILES["txtimage1"]["error"] > 0) { echo "Error: " . $_FILES["txtimage1"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["txtimage1"]["name"] . "<br />"; echo "Type: " . $_FILES["txtimage1"]["type"] . "<br />"; echo "Size: " . ($_FILES["txtimage1"]["size"] / 1024) . " Kb<br />"; echo "Stored in: " . $_FILES["txtimage1"]["tmp_name"]; } test prints out the path that was inputed to txtimage1, but everything else outputs nothing. Could this be a server side issue or am I missing something?
  14. Thanks for the help, I decided just to put the function inside the original file and it works fine that way.
  15. well, I tried that and it didn't work and I tried parent.window.location = 'page.php'; that didn't work either I used some javascript to get the job done but I would rather use php in the case someone doesn't have java installed. Here is the code I used: <script type="text/javascript"> <!-- parent.window.location = "http://salvagedrides.com/usa/home.php?innerframe=account" //--> </script> Now here is another one, I need to change what is inside another iframe from a different iframe, both childs of the same parent. Any ideas on that one?
×
×
  • 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.