Forum Moderators: coopster

Message Too Old, No Replies

suse apache php

php not being parsed?

         

Nixpeople

6:39 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



I am a relative newbie to the world of setting up a server machine...but that is what I am doing and intend to go commercial as soon as I have finished testing and gaining experience, my problem right now is that php seems to be maladjusted (seems a good word)
this is a script in the header of a file index.php
as seen by my browser (IE)

<script language="JavaScript">
<!--

s

?>location.replace('intro.php')function errorsuppressor(){
return true;
}
window.onerror=errorsuppressor;

function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}

function deleteuser(){
window.open('users.php?action=delete&person=&password=&bye=bye', 'Bye','toolbar=no,scrollbars=no,width=300,height=300');
}

//-->
</script>

)...but the actual script reads

<script language="JavaScript">
<!--

<?php

require ('required/config.php');

if ($password_system=="ip"){
$laip = getenv ("REMOTE_ADDR");
if (($password!= $laip) or ($person=="")){
echo "location.replace('intro.php')";
}
}else{
if (($person=="") or($password == "")) {
echo "location.replace('intro.php')";
}
}
if(eregi("win", $HTTP_USER_AGENT) and eregi("MSIE", $HTTP_USER_AGENT)){
$browser= "explorerwin";
}
else{
$browser= "";
}

?>
function errorsuppressor(){
return true;
}
window.onerror=errorsuppressor;

function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}

function deleteuser(){
window.open('users.php?action=delete&person=<?php echo $person;?>&password=<?php echo $password;?>&bye=bye','Bye','toolbar=no,scrollbars=no,width=300,height=300');
}

//-->
</script>

So it would seem that the php directive is being destroyed for some reason.

any info on this problem would be greatly appreciated.

[edited by: jatar_k at 6:52 pm (utc) on Dec. 4, 2003]
[edit reason] no personal urls thanks [/edit]

Timotheos

6:57 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Howdy Nixpeople and welcome to WebmasterWorld. You've found a great place for info so stick around and by all means read the TOS [webmasterworld.com].

As for your problem it looks to be in the config.php file.

Nixpeople

7:22 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



Thanks for your reply Timotheos, oops! on the links
Hi to everyone.

but it would seem the problem arises before it can enter the config file... below is the actual code

<?php

require ('required/config.php');

blah blah blah

but my browser sees this

s

?>

blah blah blah

Timotheos

7:32 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The scoop on require() and include() are here in the manual [php.net].

Are you aware that...
"When a file is included, parsing drops out of PHP mode and into HTML mode at the beginning of the target file, and resumes again at the end. For this reason, any code inside the target file which should be executed as PHP code must be enclosed within valid PHP start and end tags."

Nixpeople

7:43 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



Yeh...
if you look at the first post you will notice that the <?php?> php tags are inside a javascript and that it works fine..I am thinking that maybe when I compliled the makefile that maybe I should have included more options.?

Timotheos

7:52 pm on Dec 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm? I'm not sure I get you.

I'm still of the opinion that it's in your required file config.php which is not parsing correctly and that's why you get that "s?>".

Anybody else have any insights?

Nixpeople

9:07 pm on Dec 4, 2003 (gmt 0)

10+ Year Member



I have installed this chat script on my home pc winxppro am running apache php perl mysql etc..and works fine.

I also installed this app on a unix server running apache php etc etc (cannot get access to root) it works fine.

but alas on my unix server box does not see "<?php" properly obviously I have not configured something proper.

I am considering running "makefile" again

P.S. <? phpinfo()?> works fine.