Re: Need more help please!

From: Date: Fri, 18 May 2001 16:25:42 +0000
Subject: Re: Need more help please!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53446@lists.php.net to get a copy of this message
Taline, You cannot have ANY OUTPUT before sending a header. Strip out every blank line and try again. Tighten it up. A space at the top of the page before "<?" is considered output by the browser. Trust me, I've been there. Check the PHP manual on how functions are defined... function_name( arg1, arg2, arg_n) { statement; statement;
    to;
    end;
    of;
    function;
} There's an article in the devshed archives , written by Rasmus Lerdorf on doing exactly what you are trying. (I think it's devshed.) In any case, there are lots of them around. Regards - Miles Thompson At 10:47 AM 5/18/01 -0400, Taline Makssabo wrote:
Thanks for the reply but now i have problems with my pop up! Here is the message in getting. Whats the problem now???? Warning: Supplied argument is not a valid MySQL result resource in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 29 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/ppcu/home/httpd/html/php2/login.php:29) in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 9 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/ppcu/home/httpd/html/php2/login.php:29) in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 10 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/ppcu/home/httpd/html/php2/login.php:29) in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 4 Warning: Cannot add header information - headers already sent by (output started at /home/virtual/ppcu/home/httpd/html/php2/login.php:29) in /home/virtual/ppcu/home/httpd/html/php2/login.php on line 5 <?php function access_denied() Header("WWW-Authenticate: Basic realm=\"$title\""); Header("HTTP/1.0 401 Unauthorized"); } function auth_headers($title) Header("WWW-Authenticate: Basic realm=\"$title\""); Header("HTTP/1.0 401 Unauthorized"); } if(!isset($PHP_AUTH_USER)) auth_headers("Members Area"); access_denied(); exit; } else $db_hostname = "localhost"; // database host, usually "localhost" $db_username = "contact"; // username for the database $db_password = "cdi986"; // password that cooresponds to DB USERNAME $db_database = "contact"; // what database is your member info stored in? $query = "SELECT username,password FROM contact_informations WHERE username='$PHP_AUTH_USER' AND password='$PHP_AUTH_PW'"; $link = mysql_connect($db_hostname, $db_username, $db_password) or die("Unable to connect to database server"); if (mysql_num_rows(mysql_db_query($db_database, $query)) == 0) auth_headers("Members Area"); access_denied(); exit; } mysql_close($link); } ?> <? SetLogging(1); Function AccessHit() {
        $NL = "\n";
        $H = getLastHost();
        $R = getLastRef();
        $To = "taline@prepresshelp.com";
        $Sub = "Page Accessed";
        $D = Date("D d M y h:ia",time());
        $Msg = $H + $NL + $R + $NL + $D;
        mail($To,$Sub,$Msg);
} ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#53446) next »