Hello! I have an file php who want direct access in that file nobody can have access,i dn't know if is possible to block....

<?php
header("location:/path/?id=".$_GET['id']);
?>

i put that in an embed page and run video avi.when i block direct access with htaccess video dont run.Is possible block direct access and the video who get from header run??.
Thank you in advance .

Recommended Answers

All 4 Replies

you can do it by using session. use session check. if session is empty redirect the user on other page.

Can i have an example for that please?Thank you .

<?php
if(isset($_POST['submit']))
{
//embedd video code here
}
else
{
?>
<form action="" Method="POST">
<input type="submit" value="submit" name="submit">
</form>
<?php 
?>

or using session

check if the session is set using same method but only difference is that for session you have to start session using session_start() and it must be the first code of your line...
For more refer here or here

Hope this is useful for you...
PS-If your problem is solved mark the thread as solved....

Thanks tomato.pgn but i thing you dont understand that i need..


this is my header.php

1.
      <?php
   2.
      header("location:/path/?id=".$_GET['id']);
   3.
      ?>

and this is my embed.php code

<param name="Src" value="stream.php?id=<?php echo urlencode(base64_encode("http://mywebsite.com/header.php?id=$id&")); ?>" />

i need when click http://mywebsite.com/header.php?id=myid get no access ,but when i embed in my page that video run.Thats all.
Thank you anyway for your time.

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.