Well in future could you please post the error. But assuming that it's the error I think it is then you will need to do the following. First of all make sure the page starts with <?php instead of <? for compatibility reasons. Also make sure the header() function has a lower 'h'. Then most importantley of all make sure there is no html or browser output before the header function. The header function is one of the few special functions that can not be used after an echo or print statement due to the way php is designed. Hope that solves it.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
The code you have submitted contains the base64_encode() function which turns the string into an encrypted result. Then you have encoded it for url variable/$_GET[] input. So as that code stands it is very unreadable without the help of php to decode it. And that would be why a number 7 may occur on the displayed string. Also if it is after it is decoded you see the number 7 than that is what $id contains at time of encode.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
To hide it you could just delete that line or use css to hide it. For example:
<span style="display:none;"><?php echo 'http://mysite.com/header.php?id='.$id; ?></span>
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
Thank you for your time ,i mean to encrypt that link like before
urlencode(base64_encode
is impossible?
Well that turns the link into a way that it cannot be clicked or read. I think what you are after is the apache mod rewrite. This will allow you to have all sorts of crazy url's using a .htaccess file. But it all depends how do you want the link to be displayed as?
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
Is this code a javascript redirect or something because I need to see what context the link is used in for relevant encoding.
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
Well you could encode it with base64_encode then in your java or flash applet, edit the java/flash source so that it decodes the string upon receiving. So below is the php code but I'm not sure what the java or flash code would be.
echo '<param name="MRL" value="'
echo base64_encode('http://mysite.com/header.php?id='.$id);
echo '">';
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
As far as I can see the T_ECHO isn't comming from the piece of code you have posted. the error normally means there is a missing ; symbol near an echo statement.
Also if you don't want people to willing nilling to view abc.php then use the following code:
<?php session_start(); //line 1
$_SESSION['securityid']=dechex(microtime());
?><object id="vlc" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab#Version=0,8,6,0" classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" width="500" height="400" events="True">
<param name="AutoLoop" value="-1">
<param name="AutoPlay" value="-1">
<param name="ExtentWidth" value="11641">
<param name="ExtentHeight" value="10371">
<param name="MRL" value="<?php echo 'http://mysite.com/abc.php?id='.$id.'&sec='.$_SESSION['securityid']; ?>">
<param name="Visible" value="0">
<param name="Volume" value="90">
<param name="StartTime" value="0">
<param name="vlc2.jpg">
<param name="BaseURL" value="http://www.mysite.com">
<embed pluginspage="#" type="application/x-vlc-plugin" progid="VideoLAN.VLCPlugin.2" name="vlc" width="500" height="400" target="<?php echo 'http://mysite.com/abc.php?id='.$id.'&sec='.$_SESSION['securityid']; ?>" autoplay="true" loop="yes" volume="90"></embed>
</object>
Then in abc.php place the following at the very top:
session_start();
if (!isset($_SESSION['securityid']) || !isset($_GET['sec']) || $_GET['sec']!==$_SESSION['securityid']) {
exit ('No hackers allowed. sorry :)');
}
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
<?php
header("location:/path/?id=".$_GET['id']);
?>
happytogether
Junior Poster in Training
84 posts since Mar 2011
Reputation Points: 16
Solved Threads: 14