Jump to content

frc

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

frc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Woah dude you absolutely rock!!!! Thank you soooo much!!! It's making a lot more sense to me now.
  2. Thanks for your response. Can you give me an example I can look at and expand on? I'm not all that familiar with arrays yet but have been working on one for user management this week. Great idea! JE
  3. Thanks, I still don't have any validation or error handling inserted (still have to figure out how) but did clean up the query and removed the header and other messages. It got me to the point where when i hit submit I can see the files uploading in the status bar then at 99% it takes me to the same error page and doesn't submit... I wish i was in the matrix and could just download php guru to my brain!.. sure wish I didn't have to demo this tomorrow...
  4. Hi there, I have a form submitting to a mysql database. It was requested that I put a multiple file upload option on it. So I added the fields to the form and the database and added the upload script to the form processing file (and of course created the folder on the server with proper permissions to upload to). It should upload the file(s) to the folder on the server and insert the filename into the database. I keep getting: HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. This leads me to believe the upload script isn't working properly. If someone could take a look at it I would be a very happy guy. This is the upload script: (insert.php) <?php $con = mysql_connect("server","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $con); $dateSubmitted = date("Y-m-d"); $target = "attachments/"; $target = $target . basename( $_FILES['doc1']['name']); $target = $target . basename( $_FILES['doc2']['name']); $target = $target . basename( $_FILES['doc3']['name']); $target = $target . basename( $_FILES['doc4']['name']); $target = $target . basename( $_FILES['doc5']['name']); $sql="INSERT INTO investments (active, project, inv_amount, account_type, prefix, first_name, last_name, address1, address2, city, province, postal_code, country, phone, email, referral_fee, ref_agent, ship_name, ship_address, ship_city, ship_province, ship_postal, ship_country, notes, dateSubmitted, doc1, doc2, doc3, doc4, doc5) VALUES ('$_POST[active]','$_POST[account_type]','$_POST[project]','$_POST[inv_amount]','$_POST[prefix]','$_POST[prefix]','$_POST[first_name]','$_POST[last_name]','$_POST[address1]', '$_POST[address2]','$_POST[city]','$_POST[province]','$_POST[postal_code]','$_POST[country]','$_POST[phone]','$_POST[email]','$_POST[referral_fee]','$_POST[ref_agent]','$_POST[ship_name]','$_POST[ship_address]','$_POST[ship_city]','$_POST[ship_province]','$_POST[ship_postal]','$_POST[ship_country]','$_POST[notes]','$_POST[dateSubmitted]',$_FILES['doc1']['name'],$_FILES['doc2']['name'],$_FILES['doc3']['name'],$_FILES['doc4']['name'],$_FILES['doc5']['name'])"; //Writes the photo to the server if(move_uploaded_file($_FILES['doc1']['tmp_name'], $target)) if(move_uploaded_file($_FILES['doc2']['tmp_name'], $target)) if(move_uploaded_file($_FILES['doc3']['tmp_name'], $target)) if(move_uploaded_file($_FILES['doc4']['tmp_name'], $target)) if(move_uploaded_file($_FILES['doc5']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } //echo "1 record added"; header("Location: ../forms.php"); mysql_close($con) ?> Thanks in advance. JE
  5. Thanks for the reply. That's a really good idea! It's probably going to take me a few to figure it out but yay! Jason
  6. I'm not totally new to php but I'm no guru either. I'm building an intranet and have three seperate user roles, user - manager - admin. There are some menu items I don't want to allow simple users to see. This will expand later to give them different views of a page as well (some can view/others can edit). As it stands the login validation is holding they're user level in $SESSION. To give you an idea take a look at what I'm trying to do: function usermenu($usermenu) { if($user_level=0) echo ("<ul id="gooeymenu2" class="solidblockmenu"> <li><a href="main.php">Home</a></li> <li><a href="forms.php">Forms</a></li> <li><a href="/support/index.php" target="_new">Support</a></li> <li><a href="documents.php">Documents</a></li> <li><a href="admin/index.php">Admin</a></li> <li><a href="logout.php">Logout</a></li> </ul> <script> gooeymenu.setup({id:'gooeymenu2', selectitem:1, fx:'swing'}) </script>" "); else($user_level=1,2) echo ("<ul id="gooeymenu2" class="solidblockmenu"> <li><a href="main.php">Home</a></li> <li><a href="forms.php">Forms</a></li> <li><a href="/support/index.php" target="_new">Support</a></li> <li><a href="documents.php">Documents</a></li> <li><a href="new.php">New Adviser</a></li> <li><a href="admin/index.php">Admin</a></li> <li><a href="logout.php">Logout</a></li> </ul> <script> gooeymenu.setup({id:'gooeymenu2', selectitem:1, fx:'swing'}) </script>" "); Any help would be great, thanks in advance. Jason
×
×
  • 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.