Re: Can't hide javascript with PHP :(
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sat, 05 Apr 2008 20:24:17 -0500
Xu, Qian wrote:
jh3an wrote:How are you ? I purchased godaddy web hosting service, and tried to
hide my javascript file with PHP.
But it does not work, I don't know what makes it wrong.
index page does not load javascript file, i guess.
Please help..!! what should I do ?
Here is my index.php, and script.php:
"index.php":
<?
session_start();
if(!session_is_registered('allow_script'))
{
session_register('allow_script');
$allow_script = true;
}
?>
<html>
<head>
<script language="JavaScript" src="script.php" ></script>
.
.
"script.php":
<?
session_start();
if($allow_script)
{
header("Content-type:text/javascript");
?>
alert("HIDE");
<?
$allow_script = false;
}
?>
Here is my php.ini contents:
register_globals = on
allow_url_fopen = on
expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=,fieldset="
I do not understand you question very well.
But some tips might be helpful:
1. Use '<?php' instead of '<?'
2. Use ob_start() when you generate /raw/ contents
There is no need to use ob_start() - and doing so slows down the delivery of pages and has a negative effect on the server.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- Can't hide javascript with PHP :(
- From: jh3an
- Re: Can't hide javascript with PHP :(
- From: Xu, Qian
- Can't hide javascript with PHP :(
- Prev by Date: Re: Can't hide javascript with PHP :(
- Next by Date: PHP Manual with Notes (chm)
- Previous by thread: Re: Can't hide javascript with PHP :(
- Next by thread: Re: Can't hide javascript with PHP :(
- Index(es):
Relevant Pages
|