gary_rip Posted October 24, 2007 Share Posted October 24, 2007 Im using the following... <form enctype="multipart/form-data" action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post"> <b>What kind of zip are you giving me? A...</b><input type="hidden" name="MAX_FILE_SIZE" value="2048000" /> <select name="folder"> <option>1/ <option>2/ <option>3/ </select><br /> <b>The file is...</b> <input name="userfile" type="file" /><br /> <input type="submit" value="Upload the zip!" /> </form> <?php if (@is_uploaded_file($_FILES["userfile"]["tmp_name"])) { copy($_FILES["userfile"]["tmp_name"], $_POST["folder"] . $_FILES["userfile"]["name"]); echo "www.testsite.com/files/" . $_POST["folder"] . $_FILES["userfile"]["name"]; } ?> But when it out puts... echo "www.testsite.com/files/" . $_POST["folder"] . $_FILES["userfile"]["name"]; (Which prints like www.testsite/files/1/test.zip) I wish to make this a hyperlink to the same file. Ive been trying... cho "<a href=http://www.testsite.com/files/" . $_POST["folder"] . $_FILES["userfile"]["name"]>"www.garyrip.com/files/" . $_POST["folder"] . $_FILES["userfile"]["name"]</a>"; with no luck... Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/74612-solved-hyperlink-php-output/ Share on other sites More sharing options...
enoyhs Posted October 24, 2007 Share Posted October 24, 2007 Try: echo "<a href='http://www.testsite.com/files/" . $_POST["folder"] . $_FILES["userfile"]["name"]'>"www.garyrip.com/files/" . $_POST["folder"] . $_FILES["userfile"]["name"]</a>"; To specify what I changed: I put single quotes around href. Quote Link to comment https://forums.phpfreaks.com/topic/74612-solved-hyperlink-php-output/#findComment-377148 Share on other sites More sharing options...
thebadbad Posted October 24, 2007 Share Posted October 24, 2007 Well, to keep up with the standards, only use double quotes in your HTML tags. I would do like this: <?php echo '<a href="http://www.testsite.com/files/'.$_POST['folder'].$_FILES['userfile']['name'].'">www.garyrip.com/files/'.$_POST['folder'].$_FILES['userfile']['name'].'</a>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/74612-solved-hyperlink-php-output/#findComment-377302 Share on other sites More sharing options...
gary_rip Posted October 25, 2007 Author Share Posted October 25, 2007 Thanks, thats sorted it, i just couldnt get my head round it... too many " ' / ??? Quote Link to comment https://forums.phpfreaks.com/topic/74612-solved-hyperlink-php-output/#findComment-377639 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.