RE: [PHP] Group By problems

2005-07-03 Thread yangshiqi
If your action of sending email to the users is not very often, you can
select email from comment into a tmp table, then make the users data table
joining the temp one, and this should be more efficacious.

 
Best regards,
Shiqi Yang 
 
 
 
-Original Message-
From: W Luke [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 04, 2005 12:18 AM
To: PHP Lists
Subject: [PHP] Group By problems

Hi,

I used to have problems with this in Cold Fusion - and I'm still
struggling this time in PHP!

Very basic.  Looping over 2 tables - an email table, and a data-table.
 I'm using * just for ease for the time being:

SELECT * FROM f_c_users,f_comments WHERE fcEmail=cemail GROUP by fcEmail

If there are more than one records in the data table *per* email, then
I want to group them into one email per user.  Instead of sending
10/20/100 emails per person for each record in the data-table.  So I
just want to collate everyone's data into one email.

Any thoughts welcome!

Cheers

-- 
Will   
-- The Corridor of Uncertainty --
-- http://www.cricket.mailliw.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] about the absolutely path

2005-06-06 Thread yangshiqi
I have a php application (let's call it app A) which is developed separated
in a test domain name, like http://testa.xxx.com http://testa.xxx.com/ /.

But now I have to move it to another app (called B) using
http://testb.xxx.com http://testb.xxx.com/ /, and the app A becomes just a
subsystem of app B.

The access url is changed to http://testb.xxx.com/a/.

Then I meet a problem that the app A 's links, the path and other elements
in it are set like '/Main.php', '/art/logo.gif' by an absolutely path.

The app A is very independent and I do not want to disperse it to app B.

So how can I get this effect: when the user input the url, '
http://testb.xxx.com/a/ ', the app A will work fine?

Can I just modify some configuration about yapache to fit this requirement?

 

 

 

 

 

 

 

Best regards,

Yang Shiqi

 

 

 

 



RE: [PHP] Session time out

2005-03-16 Thread yangshiqi
In your php.ini, session.gc_maxlifetime=1440;

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Jacques [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 17, 2005 1:48 PM
To: php-general@lists.php.net
Subject: [PHP] Session time out

What is the life time of a PHP session object (variable)?  Which conditional

test can I perform to check if the session object has timed out?

Jacques 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] which class it is?

2005-03-06 Thread yangshiqi
Sorry for that all my friends, I just came from a vocation during the
weekend, so I can't read your threads. Thanks for all your help.

The debug_backtrace() is powerful to debug, but when I construct my classes
with simpleTest or other opensource applications, it contains lots of info
that I don't concern on in my application. So I decide to write or find
something a little bit simpler.

I just want to trace my application with the debughelper, when I want to see
what happened in it. Then I can get sth like this:

2005-03-07 11:41:15.355297 soapclient: SOAP message length: 455 contents
2005-03-07 11:41:15.355583 soapclient: transporting via HTTP
2005-03-07 11:41:15.356393 soapclient: sending message, length: 455
2005-03-07 11:41:15.355823 soap_transport_http: scheme = http
2005-03-07 11:41:15.355961 soap_transport_http: host = 172.24.107.244
2005-03-07 11:41:15.356092 soap_transport_http: path =
/BSSRemoteWebService/CustomerService.asmx

The style is $this-getMicroTime().' '.get_class($this).: $string \nbr;
When I inheritlize my new class from debughelper.
Well, I use php4. Sorry I forgot to declare it. If I use v5, exception is a
good choice.

Best regards,
Yang Shiqi
 
 
 
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 11:10 PM
To: Jason Barnett
Cc: php-general@lists.php.net
Subject: Re: [PHP] which class it is?

Jason Barnett wrote:
 Yangshiqi wrote:
 
And I do not want all my classes to inherit the debughelper.

 
Best regards,
Yang Shiqi
 
 
 
 Yikes!  I swear, some of these mailreader programs that people use... I
 thought this was an actual answer to someone's question... anywho...
 
 Have you checked out debug_backtrace() and set_error_handler()
 http://php.net/manual/en/function.debug-backtrace.php
 http://php.net/manual/en/function.set-error-handler.php


I have given up on this thread - the logic is all of a sudden lost on me!
I think we gave Yang some good stuff to chew on - last I read he was going
to
dig into exceptions! :-)

hey Yang, if you get stuck with Exceptions somewhere please post to a new
thread :-)

 
 Exceptions in PHP5
 http://php.net/exceptions
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] which class it is?

2005-03-04 Thread yangshiqi
class DebugHelper
{
var $_str;
function do($string)
(
//here I want to know which class called this function do to
trace the bug.
$this-_str .= $string;
)
function show()
{
return $this-_str;
}
}

class B
{
 function B()
 {
  $debug = new DebugHelper;
  $debug-do('here');
...
 }
}

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 4:43 PM
To: yangshiqi
Cc: php-general@lists.php.net
Subject: Re: [PHP] which class it is?

yangshiqi wrote:
 I have a question that how to get the class name, which is initialized by
 other class or function.
 

...

  
 
 How can I get class b's name in a?
 

you have the get_class() function,
you have the __CLASS__ constant

can you give an example of a situation where you are having
trouble of retrieving the className of a subclassed object (or class)?

  
 
  
 
 Best regards,
 
 Yang Shiqi
 
  
 
  
 
  
 
  
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] which class it is?

2005-03-04 Thread yangshiqi
And I do not want all my classes to inherit the debughelper.

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: yangshiqi [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 5:41 PM
To: 'Jochem Maas'
Cc: 'php-general@lists.php.net'
Subject: RE: [PHP] which class it is?

class DebugHelper
{
var $_str;
function do($string)
(
//here I want to know which class called this function do to
trace the bug.
$this-_str .= $string;
)
function show()
{
return $this-_str;
}
}

class B
{
 function B()
 {
  $debug = new DebugHelper;
  $debug-do('here');
...
 }
}

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 4:43 PM
To: yangshiqi
Cc: php-general@lists.php.net
Subject: Re: [PHP] which class it is?

yangshiqi wrote:
 I have a question that how to get the class name, which is initialized by
 other class or function.
 

...

  
 
 How can I get class b's name in a?
 

you have the get_class() function,
you have the __CLASS__ constant

can you give an example of a situation where you are having
trouble of retrieving the className of a subclassed object (or class)?

  
 
  
 
 Best regards,
 
 Yang Shiqi
 
  
 
  
 
  
 
  
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] which class it is?

2005-03-03 Thread yangshiqi
I have a question that how to get the class name, which is initialized by
other class or function.

For example:

Class a

{

 Function a(){}

}

 

Class b

{

 Function b()

 {

  $a= new a;

  ...

 }

}

 

How can I get class b's name in a?

 

 

Best regards,

Yang Shiqi

 

 

 

 



RE: [PHP] auto refresh once

2005-03-02 Thread yangshiqi
I can't guess your purpose, but may be you can do it like this.


function refreshByOnce()
{
$isVisit = isset($_SESSION['isVisit'])?$_SESSION['isVisit']:false;
If (!$isVisit)
{
$_SESSION['isVisit'] = true;
Header('Location:http://yourdomain.com');
Exit;
}
}

But unfortunately this will give your server more press, since you must use
session here. So if your site have a very huge visits, pls be careful.
 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: William Stokes [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 02, 2005 3:55 PM
To: php-general@lists.php.net
Subject: [PHP] auto refresh once

Hello,

Is it possible to force one automatic refresh browser when user enters to a 
webpage? If so, how?

Thanks
-Will 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Setting cookie on first visit

2005-03-02 Thread yangshiqi
When the user first visits your site, there is no skin in your cookie. Then
you can give a default value. And after the user modifies his/her profile,
you can set it to the cookie. So I don't think it is a problem of setting
cookie.

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Tom Whitbread [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 02, 2005 5:18 PM
To: php-general lists
Subject: [PHP] Setting cookie on first visit

I am using a cookie to detect what skin a user wants to display. The 
problem is if a user visits the site for the first time the cookie is 
not being set. I am detecting if its being set or not with

if(!isset($_COOKIE['skin'])){ ... }

It's not setting the cookie untill a user refreshes the page once. How 
can I ensure it's set when it hasnt been set before?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP book recommendations

2005-02-15 Thread yangshiqi
I enjoy the Core PHP Programming, Third Edition by Leon Atkinson very
much.

 
Best regards,
Yang Shiqi
 
 
 
-Original Message-
From: Joe Harman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 16, 2005 3:20 AM
To: php-general@lists.php.net
Subject: Re: [PHP] PHP book recommendations

personally, I like Julie Meloni's books... PHP essentials.. and fast
and easy web development... these were some of the first books that i
bought and got started with... they are pretty easy to use, especially
if you are not into reading technical manuals

http://www.thickbook.com



On Tue, 15 Feb 2005 14:20:05 -0500, Joe Harman [EMAIL PROTECTED] wrote:
 sorry... wrong address
 
 
 On Tue, 15 Feb 2005 14:19:46 -0500, Joe Harman [EMAIL PROTECTED] wrote:
  personally, I like Julie Meloni's books... PHP essentials.. and fast
  and easy web development... these were some of the first books that i
  bought and got started with... they are pretty easy to use, especially
  if you are not into reading technical manuals
 
 
  On Tue, 15 Feb 2005 08:54:14 -0800 (PST), Chris Shiflett
  [EMAIL PROTECTED] wrote:
   --- Bosky, Dave [EMAIL PROTECTED] wrote:
I'm looking for an easy to read PHP book that will help me learn a
solid foundation in PHP.
  
   If you need a strong foundation:
  
   http://www.oreilly.com/catalog/learnphp5/
  
   If you already have a strong foundation:
  
   http://www.amazon.com/exec/obidos/ASIN/0672325616
  
   Hope that helps.
  
   Chris
  
   =
   Chris Shiflett - http://shiflett.org/
  
   PHP Security - O'Reilly HTTP Developer's Handbook - Sams
   Coming Soon http://httphandbook.org/
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Job Recruitment and Support Ticketing Appz

2005-02-05 Thread yangshiqi
Pls go to sourceforge or freshmeat.net.

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Jason Paschal [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 05, 2005 3:53 AM
To: php-general@lists.php.net
Subject: [PHP] Job Recruitment and Support Ticketing Appz

A friend of mine is looking for one each of the following web appz:

1) Job Recruitment
A bundle of scripts that will allow someone to manage job listings and
accept applications online.

2) Online Support Ticketing 
Users submit issues, and they are resolved by the support team. 
Resolutions may be shared in a searchable knowledgebase.

Anyone know of any solid PHP projects that deal with these issues? 
Just didn't want to reinvent the wheel.

Thank you,
Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] about watermark

2005-02-05 Thread yangshiqi
Does anyone can recommend some app about watermark(open source)?

Coz I want to use it in our production, so I must use sth which is certified
very safely and fast.

Thx.

 

Best regards,

Yang Shiqi

 

 

 

 



RE: [PHP] Problem with session

2005-02-05 Thread yangshiqi
Make sure that in your php.ini, include this:
variables_order = GPC
gpc_order = GPC

there C means $_COOKIES

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Theeraputh Mekathikom [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 06, 2005 2:52 PM
To: yangshiqi
Cc: php-general@lists.php.net
Subject: Re: [PHP] Problem with session

I found the problem. I have passed SID using GET and then using 
session_id($_GET['sid']);, it works fine.
But it seems that I cannot use cookie at all. I tried to set cookie 
manually, setcookie();. Nothing happen, I cannot
retrive my variable using $_COOKIE['sid'];. Is there anyway to check 
cookie enabling? My web browser
seems to be ok since I can accept cookies from other site. I do wonder 
whether that it is because the server PHP
configuration.

Best Regards,
Thone

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Headers already sent error

2005-02-03 Thread yangshiqi
Pls Make sure that outside your ?php and ? tags, these is no any
blankspace or sth else.

 
Best regards,
Yang Shiqi
 
 
 
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 03, 2005 3:44 PM
To: [php] PHP General List
Subject: Re: [PHP] Headers already sent error

Tim Burgan wrote:

 Hello,


 I'm receiving an error Cannot modify header information - headers 
 already sent by XXX.

 In my php, I have a heap of code, then use header(Location: 
 blah.php); to redirect the user. I get this error on the webhost, but 
 not on my local host.

 I've searched and found that this can be caused by spaces after the 
 closing php tag, but I don't have any.

 What could this be?


 Tim

Rest assured, *something* is getting output before you try that header() 
call. Anything outside of PHP tags (carriage rturns/line feeds/spaces) 
any echo or print.

To help you figure it out, try doing something like exit('STARTOFBODY'); 
instead of the header call. Then view the source of the ouput and see 
what precedes that

Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Pagination Optimization

2005-01-18 Thread yangshiqi
Yes. I just use the same method which Curt mentioned below and seem well.
But I met the problem a little bit complex that the sql used group by.
Any idea?

 
Best regards,
Yang Shiqi
 
 
 

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
Sent: Sunday, January 09, 2005 2:37 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: Pagination Optimization

* Thus wrote Bruno B B Magalhes:
 Thanks for your help, in fact helped a lot... Now my function only 
 performs 2 queries, here it is:
 
 ===
   function fetch_paginated($query='',$page=1,$itens=20)
   {
   $this-query($query);

This here is going to be your big bottle neck. You're requiring
your database to fetch all the results. You're goal with
pagination is to know basically how many rows there are from the
result with minimal effort there are two ways i know that can
accomplish this rather efficiently:

  1. use the SQL_CALC_FOUND_ROWS option (i'm assuming this is
 mysql from your LIMIT statement).

 This way you can always use the LIMIT based on the page and
 items you want, and still know how many items would have
 been in the results. This will result with simply one query
 to the database.

  2. Modify your select statement to issue a count(*) of the
 query, to accomplish this automatically you can do something
 like:


 /* find the coulumns to replace with count(*) */
 $match = '/(select)\s+(.*?)\s+(from\s+.*)/i';

 /* row to start on; calculating what page they are
  * on to the actual row number */
 $start = (($page-1) * $items);

 /* replace fieldnames with count(*) */
 $replace = '$1 count(*) as qty $3';

 /* now replace the sqlqty and make the limit query  */
 $sql_qty = preg_replace($match, $replace, $query);
 $sql_qty = preg_replace('/(order|group) by.*/', '', $sql_qty);
 $sql_limit = $query .  limit $start, $items;


 And now you have $sql_qty that returns the number of total
 rows are available and $sql_limit which give you the actual
 results.


The first usage, is probably the fastest approach (i havn't done
any benchmarks), but it does limit to you with *only* mysql = 4.0 and
and is not a common thing in other dbms (iirc).  

The second option seems like a lot of work but, i can guarantee  you
that it will be much faster than selecting all rows in a resultset
and figururing out what to do, expecially on the later pages.


Here is some code that uses method 2, keep in mind that the does
several things, like generating the navigation (which makes it more
complex). I should probably seperate the pagination method a bit
more.

http://zirzow.dyndns.org/html/php/code/paginate.php

And an example usage of it:
http://www.bigstockphoto.com/search.php


HTH,

Curt
-- 
Quoth the Raven, Nevermore.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



: [PHP] IDE recommendation-- (Free?)

2004-12-18 Thread yangshiqi
Or may be you can use vim + ctags + cscope.
I use these for months and I think these are best tools for develop on
unix/linux.
Very powerfull.


Best regards,
Yang Shiqi

--
: Jeffery Fernandez [mailto:[EMAIL PROTECTED] 
: 20041217 21:45
: [EMAIL PROTECTED]
: Re: [PHP] IDE recommendation-- (Free?)

Mat Harris wrote:

On Fri, Dec 17, 2004 at 08:20:36 -0500, GH wrote:
  

Hi...

 I am looking for a FREE PHP IDE that uses syntax highlighting and
code completion amongst other features...

Do any of you have any recommendations... again I am looking for FREE
(not much budget for me)?

I use BOTH Linux and Windows



I can heartily recommend SciTE (http://www.scintilla.org/SciTE.html)
i believe it has the features you desire, plus, there is a version
customised
for php, available here http://amip.tools-for.net/SciTE-CVS.exe

btw, there is a GTK+ version so you can use it on linux as well.

  

Thanks
Gary



hope this helps

mat

  

here you go.. a well maintained list: 
http://www.thelinuxconsultancy.co.uk/phpeditors/

cheers,
Jeffery
http://melbourne.ug.php.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



: [PHP] header information problem

2004-12-18 Thread yangshiqi
I don't understand why you want to include header.html before you redirect
the users to the login_success.php?

By the way, you 'd better to add mysql_escape_string() with the username and
password to ensure the security of your code. Coz we can't believe any
users' input from web. May be the sql injection with your site.
Just be careful.

Best regards,
Yang Shiqi

--
: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
: 20041218 18:52
: [EMAIL PROTECTED]
: [PHP] header information problem

Dear Groups members.

i am making a user protected page, the script works excellent on my
local server, but online it gives me this error :

Warning: Cannot modify header information - headers already sent by
(output started at
/home/me2resh/public_html/apex/upload/header.html:10) in
/home/me2resh/public_html/apex/upload/upload.php on line 33

the script of the page is 

?
if (!isset($ID)){
include 'header.html';
echo No ID is Set.brYou Got To This Page By Mistake;
include 'footer.html';
}else{
session_start();  
include 'db.php'; 
include 'header.html';
$username = $_POST['username']; 
$password = $_POST['password']; 
if((!$username) || (!$password)){ 
echo Please enter ALL of the information! br /; 
include 'login_form.html'; 
include 'footer.html'; 
exit(); 
}
$sql = mysql_query(SELECT * FROM user WHERE User_Login='$username'
AND User_Password='$password');
$login_check = mysql_num_rows($sql); 
if($login_check  0){
session_register('ID'); 
$_SESSION['ID'] = $ID;  
while($row = mysql_fetch_array($sql)){ 
foreach( $row AS $key = $val ){ 
$$key = stripslashes( $val ); 
} 
session_register('User_First_Name'); 
$_SESSION['User_First_Name'] = $User_First_Name; 
session_register('User_Last_Name'); 
$_SESSION['User_Last_Name'] = $User_Last_Name;   
session_register('User_ID'); 
$_SESSION['User_ID'] = $User_ID; 
header(Location: login_success.php); 
}
}else{
include 'header.html';
echo You could not be logged in! Either the username and
password
do not match!br /
Please try again!br /; 
include 'login_form.html'; 
include 'footer.html'; 
}
} 
?


Can anyone help me with that problem please ?

-- 
Ahmed Abdel-Aliem
www.ApexScript.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



: [PHP] header information problem

2004-12-18 Thread yangshiqi
And if you have some special intent, you can use ob_start().

 
Best regards,
Yang Shiqi
 
 
 
--
: yangshiqi [mailto:[EMAIL PROTECTED] 
: 20041218 19:36
: 'Ahmed Abdel-Aliem'; '[EMAIL PROTECTED]'
: : [PHP] header information problem

I don't understand why you want to include header.html before you redirect
the users to the login_success.php?

By the way, you 'd better to add mysql_escape_string() with the username and
password to ensure the security of your code. Coz we can't believe any
users' input from web. May be the sql injection with your site.
Just be careful.

Best regards,
Yang Shiqi

--
: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
: 20041218 18:52
: [EMAIL PROTECTED]
: [PHP] header information problem

Dear Groups members.

i am making a user protected page, the script works excellent on my
local server, but online it gives me this error :

Warning: Cannot modify header information - headers already sent by
(output started at
/home/me2resh/public_html/apex/upload/header.html:10) in
/home/me2resh/public_html/apex/upload/upload.php on line 33

the script of the page is 

?
if (!isset($ID)){
include 'header.html';
echo No ID is Set.brYou Got To This Page By Mistake;
include 'footer.html';
}else{
session_start();  
include 'db.php'; 
include 'header.html';
$username = $_POST['username']; 
$password = $_POST['password']; 
if((!$username) || (!$password)){ 
echo Please enter ALL of the information! br /; 
include 'login_form.html'; 
include 'footer.html'; 
exit(); 
}
$sql = mysql_query(SELECT * FROM user WHERE User_Login='$username'
AND User_Password='$password');
$login_check = mysql_num_rows($sql); 
if($login_check  0){
session_register('ID'); 
$_SESSION['ID'] = $ID;  
while($row = mysql_fetch_array($sql)){ 
foreach( $row AS $key = $val ){ 
$$key = stripslashes( $val ); 
} 
session_register('User_First_Name'); 
$_SESSION['User_First_Name'] = $User_First_Name; 
session_register('User_Last_Name'); 
$_SESSION['User_Last_Name'] = $User_Last_Name;   
session_register('User_ID'); 
$_SESSION['User_ID'] = $User_ID; 
header(Location: login_success.php); 
}
}else{
include 'header.html';
echo You could not be logged in! Either the username and
password
do not match!br /
Please try again!br /; 
include 'login_form.html'; 
include 'footer.html'; 
}
} 
?


Can anyone help me with that problem please ?

-- 
Ahmed Abdel-Aliem
www.ApexScript.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



: [PHP] Re: upload file warning

2004-12-17 Thread yangshiqi
All right.
I know that it exactly does what it is, and can't be really caught directly
since this happens before the script gets control.
After display_errors = off, I can pick it up from error logs.

Thanks all.

--
: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
: 20041217 14:48
: [EMAIL PROTECTED]
: [PHP] Re: upload file warning

Yangshiqi wrote:
 I got a php waring when I upload my file:
 
  
 
 Warning: MAX_FILE_SIZE of 20 bytes exceeded - file
[imgpath=mz-n10.pdf]
 not saved in Unknown on line 0
 
that seems like a very descriptive warning to me...
  
 
  
 
 In the form I write like these:
 
  
 
 input type='hidden' name='MAX_FILE_SIZE' value=20
yes... this is where you did put it...
 input type='file' name='imgpath'
 
  
 
 And my configuration is :
 
  
 
 file_uploads = on
 
 upload_max_filesize = 4M
 
 upload_tmp_dir = /tmp
 
  
 
 so, what 's wrong? 
what do you *think* is wrong :| I mean... just *read* the warning :S
And can I catch the exceeded file error before it is
 passed back to the client?
a) it's checked for size and discarded immediately
b) the file is never passed 'back' to the client. It just disappears 
into the abyss that is /dev/null
 
  
 
  
 
 Best wishes.
 
  
 
 yangshiqi
 
  
 
  
 
  
 
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] upload file warning

2004-12-16 Thread yangshiqi
I got a php waring when I upload my file:

 

Warning: MAX_FILE_SIZE of 20 bytes exceeded - file [imgpath=mz-n10.pdf]
not saved in Unknown on line 0

 

 

In the form I write like these:

 

input type='hidden' name='MAX_FILE_SIZE' value=20
input type='file' name='imgpath'

 

And my configuration is :

 

file_uploads = on

upload_max_filesize = 4M

upload_tmp_dir = /tmp

 

so, what 's wrong? And can I catch the exceeded file error before it is
passed back to the client?

 

 

Best wishes.

 

yangshiqi

 

 

 



: [PHP] empty() problem

2004-12-12 Thread yangshiqi
Maybe this can help you.

If (empty((string)$Game_rating))


--
: Ahmed Abdel-Aliem [mailto:[EMAIL PROTECTED] 
: 20041212 21:58
: [EMAIL PROTECTED]
: [PHP] empty() problem

Hi Group Members
i have a problem with function empty() 
i use it to check if user entered the form fields and store it in array

for example : 

if (empty($Game_rating))
$errors[] = You didn't enter the Online Status for the Game.;

the problem when the user enters 0 in the form field
the empty function returns the error.

can i  use another function that doesn't return false when the 0 is passes ?

any help plz ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


: [PHP] Pass mysql array into SESSION?

2004-12-08 Thread yangshiqi
Yes. And also look at your php.ini, if the session's name and path is not
set ,
You must set it above session_start();
Like :
session_name('test');
session_save_path(/homes/eric/temp);
session_start();
...

--
: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
: 2004129 10:15
: Jerry Swanson
: PHP List
: Re: [PHP] Pass mysql array into SESSION?

Jerry Swanson wrote:
 I want to pass an array from one page to excell generation page. I
 tried to pass through session($_SESSION['sql'] = $var). But value is
 not set.
 
 The array is actually $result = mysql_query($query);
 

did you call session_start() at the beginning of your scripts? Is the 
query executed without an error? Are there any rows returned?

Start with something simple and see if it works:

Page 1:
session_start();

query database...

print_r() the result

store the result in session variable

link to Page 2


Page 2:

session_start();

print_r the session variable

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



: [PHP] Close all open tags in HTML text

2004-12-08 Thread yangshiqi
May be you could use a iframe to ensure your own page much safer,
despite show the users' inputs is very dangerous.

--
: Raditha Dissanayake [mailto:[EMAIL PROTECTED] 
: 2004129 12:26
: [EMAIL PROTECTED]
: Re: [PHP] Close all open tags in HTML text


Matt Palermo wrote:

I am allowing users to imput HTML code into a textarea.  After they input 
this, I wany to output their HTML to the browser.  In order for the
document 
to be safe, I need to close all open HTML tags that have been left open by 
the user, along with any open comments.  Is there a way to take an HTML 
string and add closing tags and comments to it if needed?
  

Certainly not impossible but by no means an easy task. You would be 
doing the job of an html validator and it's probably better for you to 
use a third party library for that than to code it yourself.

Thanks,

Matt 

  



-- 
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] how to display the content step by step

2004-12-07 Thread yangshiqi
Just like many applications, I want to display my main content table a
sector after a sector, may be row ater row.

 

Coz the html may wait until the whole table be downloaded then to show it,
but I see some application like the Web calendar
http://www.k5n.us/webcalendar.php?topic=Demo

 

Anyone here know about this?

 

 

 

Best wishes,

 

Yangshiqi