Jump to content

_SESSION and form


zauberkuh

Recommended Posts

I am in the progress of creating a script to upload images with, but I have now come to a problem while wanting to add some data to the database.

The form start looks like this:

<form action='upload.php' method='post' enctype='multipart/form-data'>

 

When I am uploading pictures from gallery.php it is supposed to check if the user has the level required to upload images. So when it sends the data to upload.php it should make a mysql query to check whether the level is high enough or not. The problem, now, is that when you log in your user id is stored in $_SESSION["uid"] which is used in the mysql query, but it does not receive the uid on upload.php. Is there any way in which I can make upload.php receive the $_SESSION["uid"]? In a secure way, not being by inserting the uid in a $_POST or in the link.

 

I have made a session_start(); in upload.php and required the functions.php (which created the $_SESSION["uid"]) file in upload.php also. None of it makes upload.php get the $_SESSION["uid"].

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.