Jump to content

masonite85

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by masonite85

  1. So I have a mysql database that is working and can display the results correctly. My next step is after it prints the "state" array in the code below for each result I want it to create a button or a link to display the full information of that record. I could make each record a separate link and page but I would rather be able to have it pass information based on the link clicked to a single page that can pull the information . Not sure exactly how to go about this or where to start looking. if($results) { while($array= mysql_fetch_assoc($results)){ echo '<br>'; print $array['School Name']; echo " "; print $array['City']; echo ","; print $array['State']; echo " "; } }
  2. This is code I am working on. It is suppose to take a file and check then transfer it to the server in a directory called uploads. It works as far as checking the valid image types and sizes but when it checks to see if the image got to the server it echos the error message that the image was not recieved. I didn't see any problems in the code. <?php $target = "uploads/"; $target = $target . basename($_FILES['uploaded']['name']); $ok=1; if($uplaoded_size < 150000) { if($uploaded_type == "image/png") { $ok =1; } elseif($uploaded_type == "image/gif") { $ok =1; } elseif($uploaded_type == "image/jpeg") { $ok =1; } } else { $ok =0; } // check if ok is 0. File not ready for uploading if($ok ==0) { echo "Upload failed. Please make sure your file is of type JPEG, PNG or GIF and is smaller than 150.0 KB!"; } else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The File was Uploaded: ". basename($_FILES['uploadedfile']['name']). "has been uploaded"; } else { echo "File failed to upload please try again or contact us."; } } ?>
×
×
  • 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.