Search found 16 matches

by St8ic
Wed Aug 25, 2010 5:52 pm
Forum: PHP - Code
Topic: How do I get the name of the current subdirectory?
Replies: 8
Views: 2107

Re: How do I get the name of the current subdirectory?

Thanks for your reply and for future readers, this is the expression I ended up using :)

Code: Select all

dirname($_SERVER['PHP_SELF']) . "/"
by St8ic
Wed Aug 25, 2010 12:54 am
Forum: PHP - Code
Topic: How do I get the name of the current subdirectory?
Replies: 8
Views: 2107

Re: How do I get the name of the current subdirectory?

thanks for your repy Yacahuma. It looks like it may work, but does anyone have anything a little more elegant?
by St8ic
Tue Aug 24, 2010 7:48 pm
Forum: PHP - Code
Topic: How do I get the name of the current subdirectory?
Replies: 8
Views: 2107

How do I get the name of the current subdirectory?

I need an expression to figure out what the current subdirectory is in this fashion:

http://www.mysite.com/ <--- /
http://www.mysite.com/folder/ <--- /folder/
http://www.mysite.com/folder/index.php <--- /folder/

Anyone have any ideas?
by St8ic
Fri Jul 16, 2010 5:51 pm
Forum: PHP - Code
Topic: __autoload not being acknowledged on live server?
Replies: 1
Views: 158

Re: __autoload not being acknowledged on live server?

resolved - server was running in PHP3 mode instead of PHP5
by St8ic
Fri Jul 16, 2010 12:59 am
Forum: PHP - Code
Topic: __autoload not being acknowledged on live server?
Replies: 1
Views: 158

__autoload not being acknowledged on live server?

For some reason, my hosted site does not recognize my __autoload function in php. This is obviously causing issues. I tried to var_dump(spl_autoload_functions()) to get a list of registered autoload functions, but this was undefined. It all works fine in my dev environment. PHP versions are similar....
by St8ic
Thu Feb 25, 2010 12:05 pm
Forum: PHP - Code
Topic: Session variables not working for CAPTCHA function?
Replies: 3
Views: 437

Re: Session variables not working for CAPTCHA function?

Thanks! The session was fine, it was just the silly little slip-up of using GET instead of POST to retrieve the input.
by St8ic
Thu Feb 25, 2010 11:13 am
Forum: PHP - Code
Topic: Session variables not working for CAPTCHA function?
Replies: 3
Views: 437

Session variables not working for CAPTCHA function?

Hi all, I need a little help. I have a little form with a captcha image to prevent abuse. It's not working properly. The password is generated just fine, and the captcha image is displayed just fine, but when I go to check the password against the response there is nothing in the $_SESSION["pas...
by St8ic
Sat Sep 02, 2006 7:05 pm
Forum: PHP - Code
Topic: How do sessions work?
Replies: 19
Views: 1402

Sorry for making so many posts, but I think Ihave it figured out except for this one thing Parse error: parse error, unexpected $ in /htdocs/site/terminal.php on line 35 Line 35 is blank. I read up on this on the internet and apparently this is due to a file corruption on upload. I'm uploading it vi...
by St8ic
Fri Sep 01, 2006 9:15 pm
Forum: PHP - Code
Topic: How do sessions work?
Replies: 19
Views: 1402

Thanks for the tips! It's greatly appreciated.

So aside from the header redirect problem, the code is fundamentally correct? I don't understand why it's not working!
by St8ic
Fri Sep 01, 2006 10:49 am
Forum: PHP - Code
Topic: How do sessions work?
Replies: 19
Views: 1402

How do sessions work?

Before I start rambling, I'm running an OpenBSD web server using Apache and PHP 4. All I want is a login system where the users type in any name they want and a pre-specified password in "index.php" and it takes them to "terminal.php" and uses their user name that they specified ...
by St8ic
Sun Dec 12, 2004 11:03 pm
Forum: PHP - Code
Topic: Code gives blank page
Replies: 5
Views: 346

I had display_errors off. I turned it on, fixed the error, but I still have one problem.

I can't make directories (it says permission denied). Is there an option in php.ini that I could change, or do I have to chmod the directory?
by St8ic
Sun Dec 12, 2004 9:46 pm
Forum: PHP - Code
Topic: Code gives blank page
Replies: 5
Views: 346

That code (the echo test) worked just like it should.

The strangest thing is that "error_reporting = E_ALL"!

Thanks for the replies, and sorry for being to general.
by St8ic
Sun Dec 12, 2004 8:53 pm
Forum: PHP - Code
Topic: Code gives blank page
Replies: 5
Views: 346

Code gives blank page

Apache
PHP5 (and 4)
Trustix Linux (and OpenBSD)
Safemod off
phpinfo(); works perfectly

I've tried three different PHP scripts on two different versions of PHP and two different operating systems. No matter what, my PHP scripts return a blank page. Do you have any ideas?
by St8ic
Fri Dec 10, 2004 7:26 pm
Forum: Installation and Configuration
Topic: -> Apache not Php'ing <-
Replies: 4
Views: 2892

Safe mode is off, the log file shows "favicon.ico" doesn't exist over and over, and phpinfo(); works perfectly. Strange!
by St8ic
Fri Dec 10, 2004 5:30 pm
Forum: Installation and Configuration
Topic: -> Apache not Php'ing <-
Replies: 4
Views: 2892

It's completely blank. But when I go to "view source", it says: <html><body></body></html> When it should say: <?php system("uptime"); system("uname -a"); <BR> system("free -m"); <BR> system("df -h"); <BR> system("cat /proc/cpuinfo | grep \"...