Jump to content

Problem with file download


xsubs

Recommended Posts

I made some security code, which thanks god works well.

I have only one problem.

I want that if the user succeed and entered the right security code,

he will be redirect to Download.php?id=SOMEID.

Download.php literally downloads a file,

and it works fine,

but when i redirect the user from the security code to DOWNLOAD.PHP,

it requires POPUP BLOCKER something.

 

Here is my code:

<?php
if (!$_SESSION['AiSC'] <= 5) {
unset($_SESSION['AiSC']);
?>
<br>
<form action="" method="post" name="SecurityCodeForm" enctype="multipart/form-data">
<div align="center" style="font-family:arial;font-weight:bold;font-size:12px;color:black;direction:rtl;display:none;" class="Security" id="div1">
הקלד בבקשה את הטקסט שבתיבה, ולאחר מכן לחץ על "הורד תרגום".<br>
<table border="0" celspacing="0" style="height:45;">
  <tr>
    <td>
<img src="<?=createImage();?>">
    </td>
    <td>
<input type="text" name="code" value="<?=$ValuAiSC;?>" style="font-family:arialbd;font-size:20px;font-color:black;width:150px;height:45px;direction:ltr;vertical-align:baseline;">
    </td>
  </tr>
  <tr>
    <td colspan="2" align="center">
<input type="submit" name="Verify" style="font-family:arialbd;font-size:12px;font-color:black;height:25px;direction:ltr;vertical-align:baseline;" class="InputButton" value="(הורד תרגום (לחץ לחיצה עם העכבר">
</table>
</form>
</div>
<br>
<?
}
if (isset($_POST['Verify'])) {
	if ($_POST['code'] == $AiSC || $_SESSION['AiSC']) {
unlink("pictures/".$_SESSION['AiSC']);
$_SESSION['AiSC'] = 1;
header("Location: Download.php?id=1");
	} else {
		echo "<script language=\"JavaScript\">alert(\"קוד האבטחה שהקשת אינו זהה לקוד המקורי.\");</script>";
	}
}
?>

 

 

The broblematic line is: " header("Location: Download.php?id=1");        "

 

Thanks.

Link to comment
Share on other sites

Ok, i didn't explain my self well.

When you enter to DOWNLOAD.PHP,

it asks you if you want to download the certain file.

(Download page, which means, downloads file)

That page works fine,

but when i try to redirect the security code page to download.php,

it requires to block off the POPUPs blocker,

 

I'm asking how can i redirect to security code page to download.php,

and it will open my the OPEN or SAVE DIALOG without shutting off the popups blocker.

 

Understant?

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.