php forum
php mysql forum
php mysql smarty
 
Topic Options
#104249 - 07/20/01 03:25 PM Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
My host told me to put

Code:
code:


in my header to access php4. Now would it look something like this?

Code:
code:


because I tried putting #!/usr/bin/php4 at the beggining of the document but it just printed it.

Another question...


I was reading a book and they had some code to work with session_register. But I tried that but it didn't work.

Here's the code:
Code:
code:



This is the error I get:

Code:
code:



Thanks in advance.

Top
#104250 - 07/20/01 06:08 PM Re: Couple PHP questions...
Sally Offline
Moderator / Fish

Registered: 01/03/99
Posts: 897
Loc: Cambridge, UK | Diem Aptenodyt...
the shebang should go at the beggining, just like perl, so
#!/usr/bin/php4
<?php
echo "whatever";
?>
_________________________
~Official 0wner of LK's ass~
if ($code eq 'error')
{$blame = 'cal';}
© Mark B

Top
#104251 - 07/20/01 06:14 PM Re: Couple PHP questions...
Sally Offline
Moderator / Fish

Registered: 01/03/99
Posts: 897
Loc: Cambridge, UK | Diem Aptenodyt...
as to your other problem.

odd, it doesn't seem to have session support enabled, and you seem to be using version 4 as well (wasn't in php3). I'd contact your host about that.
_________________________
~Official 0wner of LK's ass~
if ($code eq 'error')
{$blame = 'cal';}
© Mark B

Top
#104252 - 07/20/01 06:58 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
Well, I am sure it didnt work because I didn't have the right locaton of where php4 is. It says unless you call the php4 you will be using php3.

Top
#104253 - 07/20/01 07:01 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
Should the shebang line be shown.

http://www.stonecrick.com/main.php

Top
#104254 - 07/20/01 07:51 PM Re: Couple PHP questions...
Ell Offline
Member

Registered: 07/22/00
Posts: 1429
Loc: Surrey, UK | Resistance: Futil...
No, and if they had it set up in a semi-intelligent way, you shouldn't need it. Try without. shocked

Top
#104255 - 07/20/01 08:33 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
Well, for some retarded reason they have PHP 3.0.9 still on the server and its hooked up with apache. So if I try a php file it will use 3.0.9 instead of 4.something. I think that are messed up but hey.

Top
#104256 - 07/20/01 08:35 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
The only reason I want 4.something is because it can use the session_register and some other variables I would just love to use. And thats the only way I can use php4 is with the shebang line they said.

Top
#104257 - 07/21/01 05:15 AM Re: Couple PHP questions...
Sally Offline
Moderator / Fish

Registered: 01/03/99
Posts: 897
Loc: Cambridge, UK | Diem Aptenodyt...
I get the suspiscion they haven't actually installed that function O_o I suggest you have a word with your host and ask them to re-install it.

and I used to have a host that ran a really weird implementation of php, also had to have the shebang.
_________________________
~Official 0wner of LK's ass~
if ($code eq 'error')
{$blame = 'cal';}
© Mark B

Top
#104258 - 07/21/01 11:02 AM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
Thanks alot Sally. I will do that.

Top
#104259 - 07/21/01 07:59 PM Re: Couple PHP questions...
Sukotto Offline
Member

Registered: 09/30/00
Posts: 103
To sort having to put the full path to PHP ask them to enable short tags within php.ini

it looks like below

Code:
code:


This will mean you don't have to put the path to php.
_________________________
vBulletin Team
scott.macvicar@vbulletin.com

Top
#104260 - 07/21/01 11:07 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
But I have to call it because it is not installed into the Apache thing. So you need a shebang line they said.

<FONT COLOR="#000000" SIZE="1">[ July 21, 2001 11:10 PM: Message edited by: Tech-Ni-Kal ]</font>

Top
#104261 - 07/22/01 10:31 PM Re: Couple PHP questions...
The Donut Offline
Member

Registered: 03/17/00
Posts: 236
Loc: Amarillo, Texas
Well, the way f2s does it (yes, yes.. f2s), is they do that exact same thing. Though it's #!/usr/bin/php which is pretty close to the same thing. But that's if you want to run your php script outside of safe mode on f2s. You also have to rename the file extension to .cgi, not .php
_________________________
-Never Underestimate The Power Of Stupid People In Large Groups.

Top
#104262 - 07/24/01 09:18 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
Holy!!!! The Donut your are the best! That is exactly how to do it! And the script works!! laugh laugh laugh

Top
#104263 - 07/25/01 10:10 AM Re: Couple PHP questions...
JohnM Offline
Member

Registered: 03/02/00
Posts: 918
Loc: USA!
Agh, he beat me wink

See, .cgi files just run the script with whatever's in the shebang line. You can put PHP in there too wink

Top
#104264 - 07/25/01 12:28 PM Re: Couple PHP questions...
Tech-Ni-Kal Offline
Member

Registered: 05/23/01
Posts: 2685
Loc: » Ü § Å «
They installed php4 as a CGI binary. I didn't notice that. I also didn't know you could use .cgi to do php.

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks