Jump to content

How to Upload first and do Query after?


Mudsaf
 Share

Recommended Posts

Wondering how to make this page working. (Don't have experience about upload forms.)Example

<center><form action="test2.php" method="post" enctype="multipart/form-data" name="form1"><h2>Add game for your website</h2>  <p>    <label for="gamename">Gamename:</label>    <input type="text" name="gamename" id="gamename">    <label for="width">Width:</label>    <input type="text" name="width" id="width">    <label for="height">Height: </label>    <input type="text" name="height" id="height">    <label for="author">Author: </label>    <input type="text" name="author" id="author">  </p>  <p>    <label for="description">Description<br>    </label>    <textarea name="description" id="description" cols="70" rows="7"></textarea>  </p>  <p>    <label for="image">Image: </label>    <input type="file" name="image" id="image">    <label for="swf_file">Swf File: </label>    <input type="file" name="swf_file" id="swf_file"> </p>  <p>    <input type="submit" name="submit" id="submit" value="Submit">  </p></form> </center>

The image should go to folder with name "games/img/" and the flash file should go to folder with name "games/swf". After that it should make query with "INSERT INTO games Columns (Name, Description, Width, Height, Author, Src, Logo) VALUES ('{$_POST/$_GET['gamename']}' ... blablabla untill comes Src & Logo. How do i get them to query like Src should get "games/swf/$FILENAME.swf"?

Link to comment
Share on other sites

Wondering how to make this page working. (Don't have experience about upload forms.) Example
<center><form action="test2.php" method="post" enctype="multipart/form-data" name="form1"><h2>Add game for your website</h2>  <p>	<label for="gamename">Gamename:</label>	<input type="text" name="gamename" id="gamename">	<label for="width">Width:</label>	<input type="text" name="width" id="width">	<label for="height">Height: </label>	<input type="text" name="height" id="height">	<label for="author">Author: </label>	<input type="text" name="author" id="author">  </p>  <p>	<label for="description">Description<br>	</label>	<textarea name="description" id="description" cols="70" rows="7"></textarea>  </p>  <p>	<label for="image">Image: </label>	<input type="file" name="image" id="image">	<label for="swf_file">Swf File: </label>	<input type="file" name="swf_file" id="swf_file"></p>  <p>	<input type="submit" name="submit" id="submit" value="Submit">  </p> </form></center>

The image should go to folder with name "games/img/" and the flash file should go to folder with name "games/swf". After that it should make query with "INSERT INTO games Columns (Name, Description, Width, Height, Author, Src, Logo) VALUES ('{$_POST/$_GET['gamename']}' ... blablabla untill comes Src & Logo. How do i get them to query like Src should get "games/swf/$FILENAME.swf"?

are those files in the directory?and show your php code, so we can help you better "not me im a newbie to php still"
Link to comment
Share on other sites

what do you come up so far? any codes?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...