Basically what i want is the action page to have "GET" information in it.
here is the code i got so far:

<html>
<head>
<link rel=stylesheet type=text/css href=style.css>
</head>
<body>
<?php include("header.php"); ?>
<center>
<h1>You are currently uploading an image in gallery: <?php
echo $_GET[gall];
 ?>
<br>
<br>
<br>
<br>
<br>
<br>
<div class=indexboxlarge>
<?php
$name =  $_GET['gall'];
echo '<form enctype="multipart/form-data" action="uploader.php?gall=
echo '$name"';
echo 'method="POST">';
echo '<input type="hidden" name="MAX_FILE_SIZE" value="100000" />';
echo '<input type="hidden" name="gall" value="echo "$name";" />';
?>
Choose an image to upload: <input name="uploadedfile" type="file" /><br /><br>
Enter some comments for the picture:<br>
<textarea cols="50" rows="4" name="tag"></textarea><br><br>
<input type="submit" value="Upload a image" />
</form>
</div>
</center>
</body>
<html>

Recommended Answers

All 5 Replies

Member Avatar for diafol

jakx: You've created quite a few new threads on the same type of theme. Your code is totally cracked - you've failed to properly escape your variables and your echoed bits of the open form tag will not be properly formed.

Please don't take this the wrong way, but have you opened a book on HTML/pHp or studied online tutorials? Please take some time to find some good quality resources before starting any more new threads on links/$_GET and forms/$_POST.

Please look at the "View Source" option in your browser and you will see where you have gone wrong.

ok thanks, i understand, but please just help me with this, how can i make a variable be shown in the url?

Member Avatar for diafol

OK...
I don't know if your script will work. Are you uploading a file and then wanting a message on upload to say which file is being uploaded? If so, I don't think you'll get it to work because the page won't refresh until the form has loaded and therefore the message won't show until after all the actions have been completed. If you want a message indicating that upload is in progress, you may have to go down the javascript or ajax route (e.g. 'busy' animation or progress bar).

Your h1 tag may show 'You are currently uploading an image in gallery ' as soon as the form page is loaded (before any image is uploaded).

If your form is being passed to a different page (uploader.php) and then sent back to the form page, the $_GET variable won't be valid, unless you have a header() command with the $_GET variable propagated through that. But, as I said, the message will be too late.

no all i want is the $name variable basically to be passed on to uploader.php thats it. Because that will tell what the content for the gallery field will be on the uploader.php file.

Member Avatar for diafol

You've already done this in the hidden file. Instead of echo $name, just do:

<input type ="hidden" .... value="<?=$name;?>" />

You can retrieve this in the $_POST variable in uploader.php No need for url parameters.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.