Jump to content

murdocsvan

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

About murdocsvan

  • Birthday 12/01/1989

Contact Methods

  • Website URL
    http://www.tomsfolio.me

Profile Information

  • Gender
    Male
  • Location
    UK

murdocsvan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. In the second script, in the sql statment var, try changing '$_POST[dropdown]' to '$_POST["dropdown"]'
  2. Sorry, my code actually worked fine. The only problem was i forgot to upload the connection include *FACEPALM*. Thanks anyway guys.
  3. $id = $_GET['id']; $query = "SELECT * FROM $tbl_name WHERE site_id='$id'"; Think there might be something wrong with my SQL statement as i get the following error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link Any ideas?
  4. Thanks for clearing that up, I keep getting confused between the functionality of empty() and isset(). So empty() is for checking if a variable != NULL and isset() checks that a $_POST or $_GET or similar has been set in the previous form?
  5. if((!$username) || (!$password)){ echo "Please enter ALL of the information! <br />"; include 'login_form.html'; exit(); } Try changing the first line in this 'if then else' statement on line 10 to: if(!isset($username) || !isset($password))
  6. Thanks for that, very helpful
  7. Here is my code: $site_image = "D:\Hosting\html\" . $_POST['image']; I get the following error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING The problem: For some reason, PHP doesn't likle me putting "\" at the end of the string, but doesn't mind if it's in the middle. Is there a way around this?
  8. I'm going to recommend to you www.w3schools.org to learn PHP as that's where i started. I know it's not helpful to what you want to know, but what you think you might need to start with may not necessarily be a GOOD place to start. The first things you should learn is basic syntax, such as the echo command, how variables work and the if..then...else statement. Then move on to using arrays, looping statements etc. I'd only recommend learning how to use database integration and MySQL after you've covered the basics of the PHP language. I'd also recommend learning to code in SQL as that is the language you would need to learn to create a connection between PHP and MySQL
  9. Well it turned out Godaddy don't allow anyone to access the tmp PHP directory, but thanks for your help anyway.
  10. Hey thanks that helped But now i think there's a problem with my hosting. i got the following error: Warning: move_uploaded_file(214047) [function.move-uploaded-file]: failed to open stream: Permission denied in [LOCATION OF MY SCRIPT ON THE SERVER] on line 34 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'D:\Temp\php\php7C77.tmp' to '214047' in [LOCATION OF MY SCRIPT ON THE SERVER] on line 34 I'm guessing this has something to do with my hosting? I'm calling them atm to see if they can resolve it, because it doesn't look like an error with the PHP to me.
  11. This is my code: //Manage image upload and put into directory: if(($_FILES["image"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/jpeg")) { if ($_FILES["image"]["error"] > 0) { echo "Return Code: " . $_FILES["image"]["error"] . "<br />"; } else { if(file_exists("../images/" . $_FILES['image']['name'])) { echo 'Error: File already exists'; } else { move_uploaded_file($_FILES["image"]["tmp_name"], "../images/" . $_FILES["image"]["name"]); echo "Stored in: " . "../images/" . $_FILES["image"]["name"]; } } } else { echo 'Invalid file type'; } When i upload a file using a form, that's the right file type, it always returns invalid file type. I think the problem is with; if(($_FILES["image"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/jpeg"))
  12. No problem, but you may want to use > and < symbols to determine a larger range of numbers.
  13. I think this is too complex a solution to post on a forum, but i'll break the logic down how i see it: 1. In the member database create too columns, for lens and for camera body 2. Create a form for members to register their different types of camera body and lens 2.1. On submission, store the registered items in arrays 2.2. Commit array of items to database by using the serialize() function 3. When member uploads photograph, use unserialize() function to make the array readable again 4. Use the foreach() function to create a new list item for each camera body and lens stored in the array Honestly i wouldn't consider making a solution like this for someone without getting paid Hope what i said helps anyway.
  14. if($total => 5 && =<6) { do this } elseif($total => 10 && =<12) { do this } elseif($total => 13 && =<15 { do this } As for the second part? I'm not sure, where are you retrieving the file path for the image from? a database? or are you typing it yourself? usually you would do: <img href="<?php echo "/directory/image.png" ?>" />
×
×
  • 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.