OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 19 Jan 2004 11:02:54 -0000 Issue 2539

php-general-digest-helplists.php.net
Date: Mon Jan 19 2004 - 05:02:54 CST


php-general Digest 19 Jan 2004 11:02:54 -0000 Issue 2539

Topics (messages 174981 through 175009):

Re: Using lists over newsgroup, Problem
        174981 by: Luke

Re: Error Reporting help
        174982 by: Chris Edwards
        174984 by: Luke
        174993 by: Jason Wong

Re: recompiling php
        174983 by: Brian V Bonini

Report Server
        174985 by: daniel.electroteque.org

how to check the form filled all
        174986 by: Sungpill Han
        175001 by: Tom Rogers

execute php script with crontab
        174987 by: rudi
        174988 by: Robert Cummings
        174989 by: Jason Wong
        174992 by: rudi

Re: Pdfs getting corrupted during upload
        174990 by: Binay

Re: POST method for hyperlink
        174991 by: Chris Shiflett

Using PHP with Style Sheets
        174994 by: Freedomware
        174995 by: John Nichel
        174996 by: Richard Davey
        174998 by: Freedomware
        175002 by: Dagfinn Reiersřl
        175006 by: Justin French

odd error with if !(cond){}
        174997 by: Tristan Gutsche
        174999 by: Greg Donald
        175005 by: Tristan Gutsche

How to search the database?
        175000 by: Radwan Aladdin
        175003 by: Toby Irmer
        175007 by: Ryan A
        175008 by: Angelo Zanetti

Re: Is this possible ?
        175004 by: Dagfinn Reiersřl

date fiedl
        175009 by: Diana Castillo

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


I'm successfully using Outlook Express news client to view messages and post
messages, but i do get postmaster reply emails sometimes saying message
sending expired, even though they show up and obviously worked as i can get
replys

--
Luke

"Siamak" <siamaks2000yahoo.com> wrote in message
news:20040118202514.62002.qmailweb11807.mail.yahoo.com...
> Hello,
>
> I have done whatever I could to send messages to
> newsgroups but messages do not appear in the list (I
> think server ignores them).
>
> I have set a valid email and I am using XanaNews
> client.
>
> I really hate to receive huge amounts of emails in my
> box from listserver (as I am forced now).
>
> Any solution?
>
> Mac
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus

attached mail follows:


Tried that, thanks, no joy.

It's almost like it parses it before it tries to execute any lines and if a
syntax error occurs, it doesn't execute any of the script.

The prior version would run up until the syntax error and then give you the
line if error, which usually meant the syntax error was on the previous
line.

"Adam I Agnieszka Gasiorowski Fnord" <agquarxvenus.ci.uw.edu.pl> wrote in
message news:400ACCFC.F8610F68venus.ci.uw.edu.pl...
> Chris Edwards wrote:
>
> [cut]
>
> > For example if I code
> >
> > echo "This is a syntax error because of the double quote start and the
> > single quote end ';
> >
> > I just get a blank screen.
> >
> > I have 14 pages of PHP settings printed out, so for any kind person that
can
> > help, I can respond with their values quickly.
>
> Try putting this at the beginning
> of your script:
>
> ini_set('display_errors', 1);
>
> --
> Seks, seksić, seksolatki... news:pl.soc.seks.moderowana
> http://hyperreal.info { iWanToDie } WiNoNa ) (
> http://szatanowskie-ladacznice.0-700.pl foReVeR( * )
> Poznaj jej zwiewne kształty... http://www.opera.com 007

attached mail follows:


Are you using output buffering? that will stop it from being displayed (it
does on mine, if thre is an error and output buffering, nothing at all shows
up)

So try turning output buffering off, or at the beggining somewhere put
while(ob_end_flush);

--
Luke
"Chris Edwards" <chrisaedwardsearthlink.net> wrote in message
news:20040118171456.84751.qmailpb1.pair.com...
> My hosting company recently upgraded to PHP 4.3.0. Since doing this I no
> longer get syntax type errors, from my typo's inside my PHP scripts. These
> use to come up in my browser when that page was requested and the script
> run.
>
> I have spent hours going through the online help, trying to set a number
of
> the error reporting levels and parameters but cannot get to where it will
> report on a syntax error.
>
> For example if I code
>
> echo "This is a syntax error because of the double quote start and the
> single quote end ';
>
> I just get a blank screen.
>
> I have 14 pages of PHP settings printed out, so for any kind person that
can
> help, I can respond with their values quickly.
>
> Thanks
> Chris Edwards

attached mail follows:


On Monday 19 January 2004 07:30, Chris Edwards wrote:

> It's almost like it parses it before it tries to execute any lines and if a
> syntax error occurs, it doesn't execute any of the script.

That's right.

> The prior version would run up until the syntax error and then give you the
> line if error, which usually meant the syntax error was on the previous
> line.

I don't think any version of PHP has ever done that.

More likely your prior version of PHP had "display_errors" enabled. In general
you can enable and display all errors using:

  error_reporting (E_ALL);
  ini_set('display_errors', 1);

But if "display_errors" (in php.ini) is disabled then syntax errors will not
be displayed -- they can only be viewed in the error log.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Most people will listen to your unreasonable demands, if you'll consider
their unacceptable offer.
*/

attached mail follows:


On Sun, 2004-01-18 at 15:08, John wrote:
> ive a problem with php and mysql, and was told to re-compile php. is this
> easy?? i got a box with rhl 9 pre-loaded, with php and mysql installed, but
> no apache. so i just downloaded the apache binary. php was installed with
> rpm i think. to recompile, do ive to uninstall php firs t(u can guess im
> used to windows) or will the new compile just overwrite everything.

It will overwrite it if it's being installed to the same location. Find
the PHP binary on your system:

$ which php

and run

$ php -i | grep -i configure

To see what options the currently running version was compiled with.

If they are suitable for you stuff them into a text file:

$ php -i | grep configure | tr -d "'" | tr -s " " "\n" | \
? grep -e '^--' > php_config.txt

Download and untar php then run configure.

$./configure `cat php_config.txt | tr -s "\n" " "`

--
Brian GnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
                                          Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQBACyF6LDUBEASk8NwRAnNOAJ9CCR6nRU6cO9yk4sXm9ijL0NlGCwCfSME/
Hxbc5wxsFJSGqTjyxcSjp84=
=tTOj
-----END PGP SIGNATURE-----

attached mail follows:


Hi there, i was wondering if there was a good report designer/server out
there which is open source and runs perfectly on a linux machine connecting
to mysql, which can do pdf or excel and maybe charts. There have been too
many i have tried out but either dont work or isnt what i wanted. Please
let me know asap.

attached mail follows:


HI, i want to check if the user filled the all inputs in the form. So, I
checked NULL and "" with this function in the post receiving script.
-------------------------------
function is_filled_out()
{
 // test that each variabl has a value
 foreach($_POST as $key => $value)
 {
  if(is_null($value) || $value="")
   return false;
 }
 return true;
}
---------------------
but when I submit the form without putting any value, it returns 'true'.
what's wrong with my code?

attached mail follows:


Hi,

Thursday, January 15, 2004, 7:33:29 PM, you wrote:
SH> HI, i want to check if the user filled the all inputs in the form. So, I
SH> checked NULL and "" with this function in the post receiving script.
SH> -------------------------------
SH> function is_filled_out()
SH> {
SH> // test that each variabl has a value
SH> foreach($_POST as $key => $value)
SH> {
SH> if(is_null($value) || $value="")
SH> return false;
SH> }
SH> return true;
SH> }
SH> ---------------------
SH> but when I submit the form without putting any value, it returns 'true'.
SH> what's wrong with my code?

try

if(empty($val))

--
regards,
Tom

attached mail follows:


Hi There,
 
I am a new be in php programming ussually i using php under windows, but now i am migrate to linux.

I have php script to write time (testcron.php owner apache chmod 775) into file testcron.txt(owner apache chmod 775), and i want this script
running from crontab.

My problem is how to execute my script with cron. i know this question it's sound dumbs.. but i have try it and fail.... may be somebody can
help me..
 
This is my php script just for checking cron, i am using apache web server in linux redhat 7.3 the other tutorial say that i have to compile my php script so the cron can execute my script, but how to compile it and i don't have cgi.
 
<?
$waktu=date("l-j-F-Y H:i:s");
$jelaskan="Waktu test cron terbaru";
$filename_count = "testcron.txt";
$fcount = fopen ($filename_count, "w") or die("Couldn't open
$filename");
fwrite ($fcount, "$jelaskan ---> $waktu\n");
fclose($fcount);
?>
 
I have try to added my script in crontab, like this :
 
[rootcity root]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
#01 * * * * root run-parts /etc/cron.hourly
#02 4 * * * root run-parts /etc/cron.daily
01 * * * * root run-parts /usr/bin/php /var/www/html/cron/testcron.php
#22 4 * * 0 root run-parts /etc/cron.weekly
#42 4 1 * * root run-parts /etc/cron.monthly
 
There must be something wrong, i don't know what...???, coz this script did not write anything to a file testcron.txt

Please Tell me WHAT should i do, step by step to setting up this script
with crontab.
 
Thanks for all help.
idur

---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

attached mail follows:


On Sun, 2004-01-18 at 23:01, rudi wrote:
> Hi There,
>
> I am a new be in php programming ussually i using php under windows, but now i am migrate to linux.
>
> I have php script to write time (testcron.php owner apache chmod 775) into file testcron.txt(owner apache chmod 775), and i want this script
> running from crontab.
>
> My problem is how to execute my script with cron. i know this question it's sound dumbs.. but i have try it and fail.... may be somebody can
> help me..
>
> This is my php script just for checking cron, i am using apache web server in linux redhat 7.3 the other tutorial say that i have to compile my php script so the cron can execute my script, but how to compile it and i don't have cgi.
>
> <?
> $waktu=date("l-j-F-Y H:i:s");
> $jelaskan="Waktu test cron terbaru";
> $filename_count = "testcron.txt";
> $fcount = fopen ($filename_count, "w") or die("Couldn't open
> $filename");
> fwrite ($fcount, "$jelaskan ---> $waktu\n");
> fclose($fcount);
> ?>
>
> I have try to added my script in crontab, like this :
>
> [rootcity root]# cat /etc/crontab
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=root
> HOME=/
> # run-parts
> #01 * * * * root run-parts /etc/cron.hourly
> #02 4 * * * root run-parts /etc/cron.daily
> 01 * * * * root run-parts /usr/bin/php /var/www/html/cron/testcron.php
> #22 4 * * 0 root run-parts /etc/cron.weekly
> #42 4 1 * * root run-parts /etc/cron.monthly
>
> There must be something wrong, i don't know what...???, coz this script did not write anything to a file testcron.txt
>
> Please Tell me WHAT should i do, step by step to setting up this script
> with crontab.
>
> Thanks for all help.
> idur

Double check your file path. You may want to use an absolute path. You
might also try firing an error or an email to yourself at the beginning
of your script to see if the script is actually running. Check your cron
logs also.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


On Monday 19 January 2004 12:01, rudi wrote:

> 01 * * * * root run-parts /usr/bin/php /var/www/html/cron/testcron.php

I believe 'run-parts' takes a directory as argument. Try:

1 * * * * root /usr/bin/php /var/www/html/cron/testcron.php

Also if you have:

#!/usr/bin/php

as the first line in testcron.php (and make it executable) then you can use
simply:

1 * * * * /var/www/html/cron/testcron.php

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
However the modem comes set from the factory, it will be the WRONG way to work
on your machine
                -- Murphy's Laws of BBS'ing n3
*/

attached mail follows:


Ok, thanks i will check it first. soon i will send mail about it.

Jason Wong <php-generalgremlins.biz> wrote:On Monday 19 January 2004 12:01, rudi wrote:

> 01 * * * * root run-parts /usr/bin/php /var/www/html/cron/testcron.php

I believe 'run-parts' takes a directory as argument. Try:

1 * * * * root /usr/bin/php /var/www/html/cron/testcron.php

Also if you have:

#!/usr/bin/php

as the first line in testcron.php (and make it executable) then you can use
simply:

1 * * * * /var/www/html/cron/testcron.php

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
However the modem comes set from the factory, it will be the WRONG way to work
on your machine
-- Murphy's Laws of BBS'ing n3
*/

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

---------------------------------
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes

attached mail follows:


Yes we are using the same server.
PHP - 4.3.2

I m very confused why this is happening with them(client)??
Binay
----- Original Message -----
From: "Bogdan Stancescu" <gutzamoongate.ro>
To: <php-generallists.php.net>
Sent: Saturday, January 17, 2004 7:35 PM
Subject: [PHP] Re: Pdfs getting corrupted during upload

> You didn't specify whether you and your client are using the same
> server. If not, make sure you have the same gpc slashing settings on
> both servers.
>
> Bogdan
>
> Binay wrote:
> > Hi all,
> >
> > I m undergoing a very weird kind of file uploading problem. I m trying
to upload an image file and a pdf file using HTTP Upload form. Now my client
is complaining that pdf file is getting corrupted during uploading as they
do not open once uploaded. But when i try to upload(using WinXp home, I.E
6+) from my end every thing works perfectly ... so its very surprising for
me.
> >
> > Initially when client complained (using WinXp home editon , I.E 6+) , i
thought it is some browser issue and hence instructed them to upload pdf
using Win2K machine. But they are facing the same problem there also. I don
know wht to do..
> >
> > Any of u guys faced this sort of problem plz tell me where exactly is
the problem? Why the pdf files are getting corrupted? is there some thing
hidden which is causing the corruption?
> >
> > Thanks in advance
> >
> > Binay
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


--- Richard Davey <richlaunchcode.co.uk> wrote:
> JH> I am curious if there is anyway to take a variable that is passed
> JH> via a URL by a reguler text hyperlink Ex:
> JH> http://localhost/Calendar/active_layout.php?d=2.1.2004
> JH> and hide it like you would do with the POST method using forms
>
> Not really, no. One solution might be to use mod_rewrite on Apache so
> at least it could look like:
>
> http://localhost/Calendar/active_layout/d/2.1.2004

Another option would be to just refer to $_SERVER['PATH_INFO'], in case
you don't have mod_rewrite but still want to have URLs like this.

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/

attached mail follows:


I just learned that you can even use PHP on style sheets. Can anyone
here tell me how to set it up?

I found a page at http://www.webdeveloper.co.nz/forum/topic/50 that
apparently cites two different methods. The first is to put a php
heading at the top of a style sheet, then alter a document so that your
server will recognize the style sheet as a php page.

But someone else said all you have to do is change the page's extension
from .css to .php. I tried that, but it didn't work for me.

Are you aware of any good tutorials on using PHP with style sheets?

Thanks.

attached mail follows:


Freedomware wrote:
> I just learned that you can even use PHP on style sheets. Can anyone
> here tell me how to set it up?
>
> I found a page at http://www.webdeveloper.co.nz/forum/topic/50 that
> apparently cites two different methods. The first is to put a php
> heading at the top of a style sheet, then alter a document so that your
> server will recognize the style sheet as a php page.
>
> But someone else said all you have to do is change the page's extension
> from .css to .php. I tried that, but it didn't work for me.
>
> Are you aware of any good tutorials on using PHP with style sheets?
>
> Thanks.
>

If you want PHP to parse your *.css files, you need to tell your
webserver software to do so. In Apache....

AddType application/x-httpd-php .php .css

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

attached mail follows:


Hello Freedomware,

Monday, January 19, 2004, 7:18:10 AM, you wrote:

F> I just learned that you can even use PHP on style sheets. Can anyone
F> here tell me how to set it up?

F> Are you aware of any good tutorials on using PHP with style sheets?

Sorry but you haven't really stumbled onto a pot of gold here or
anything. One of the methods listed just adds CSS to the PHP parsed
file list (which probably isn't the most smartest idea in the world)
and the other renames a CSS file to PHP - I'm dubious that you even
need to bother outputting the header, but haven't ever tried it to
know. Neither are exactly revolutionary and I'll doubt you'll find any
tutorials on it because it's not really doing anything unique/new.

PHP is a server-side language. If you use it to output some CSS then
by all means feel free. Others us it to output JavaScript/HTML/Java
Applet Parameters/PDF files and all kinds.

--
Best regards,
 Richard mailto:richlaunchcode.co.uk

attached mail follows:


"Sorry but you haven't really stumbled onto a pot of gold here or
anything."

Hmmm... it sounds like using PHP with style sheets isn't a recommended
practice.

John Nichel wrote:

> If you want PHP to parse your *.css files, you need to tell your
> webserver software to do so. In Apache....
>
> AddType application/x-httpd-php .php .css

But I'd like to give it a try. Thanks for the tips.

attached mail follows:


Freedomware wrote:

> "Sorry but you haven't really stumbled onto a pot of gold here or
> anything."
>
> Hmmm... it sounds like using PHP with style sheets isn't a recommended
> practice.

I wouldn't do it unless I had a good reason to do it. The reason that's
cited on the page you referred to
is to have different code in Netscape 4 and "real browsers". So if you
have a real need to make pages
pages to look gorgeous in Netscape 4, you might consider it. Or if you
want to do
pathologically ;-) advanced and flexible things with styles. Plain CSS
is flexible enough for me most
of the time, but it's a good idea to learn it properly.

>
>
> John Nichel wrote:
>
>> If you want PHP to parse your *.css files, you need to tell your
>> webserver software to do so. In Apache....
>>
>> AddType application/x-httpd-php .php .css
>
>
> But I'd like to give it a try. Thanks for the tips.
>

attached mail follows:


On Monday, January 19, 2004, at 06:18 PM, Freedomware wrote:

> I just learned that you can even use PHP on style sheets. Can anyone
> here tell me how to set it up?

Add this to your .htaccess file:
<Files ~ "\.css$">
        ForceType application/x-httpd-php
</Files>

Add this to the top of your CSS file:
<?

Then you can use it to do all sorts of stuff:

---
<?
header("Content-Type: text/css");
include("../inc/colours.inc");
?>
body {
        background-color: #<?=$col[1]?>;
        color: #<?=$col[1]?>;
        }

<? if(something) { ?>
p {
        font-size: 110%;
        }
<? } ?>

/*etc etc*/
---

Justin French

attached mail follows:


Hello im hoping someone might have an insight into this one im getting an
odd error when I use a not condition in an if statement

The code is as follows:
if !(isset($_REQUEST["license"]))
{
  $license = "off";
}

The error I am receiving is:

Parse error: parse error, unexpected '!', expecting '(' in
c:\inetpub\wwwroot\php\car.php on line 9

To avoid the error im simply using a script that doesnt use the ! mark but
the fact that using an ! in this position is occuring is worrying.. Has
anyone else encountered this?

Regards
Tristan Gutsche

attached mail follows:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tristan Gutsche wrote:
| Hello im hoping someone might have an insight into this one im getting an
| odd error when I use a not condition in an if statement
|
| The code is as follows:
| if !(isset($_REQUEST["license"]))
| {
| $license = "off";
| }
|
| The error I am receiving is:
|
| Parse error: parse error, unexpected '!', expecting '(' in
| c:\inetpub\wwwroot\php\car.php on line 9
|
| To avoid the error im simply using a script that doesnt use the ! mark but
| the fact that using an ! in this position is occuring is worrying.. Has
| anyone else encountered this?

Do

if(!isset($_REQUEST["license"]))

- --
******************************************************
* __ __ _ *
* ___/ /__ ___ / /_(_)__ ___ __ __ _______ __ _ *
* / _ / -_)_-</ __/ / _ \/ -_) // // __/ _ \/ ' \ *
* \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ *
* (___/ gregdestiney.com *
******************************************************
BOFH Excuse #444:
overflow error in /dev/null

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAC5IHoAq8t3CabwcRAqKoAJ0RfFIBJJnWREgY9PUViRj8wlrcmwCgpN8d
AZdz70SMYVJnNd9/C/o/KFQ=
=b7NS
-----END PGP SIGNATURE-----

attached mail follows:


Danke looks like its a simple case where the reference book had a Typo in it
putting the ! on the outside of the bracket.

Thanx for your help.

Regards
Tristan

"Greg Donald" <destineydestiney.com> wrote in message
news:400B9207.3070303destiney.com...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Tristan Gutsche wrote:
> | Hello im hoping someone might have an insight into this one im getting
an
> | odd error when I use a not condition in an if statement
> |
> | The code is as follows:
> | if !(isset($_REQUEST["license"]))
> | {
> | $license = "off";
> | }
> |
> | The error I am receiving is:
> |
> | Parse error: parse error, unexpected '!', expecting '(' in
> | c:\inetpub\wwwroot\php\car.php on line 9
> |
> | To avoid the error im simply using a script that doesnt use the ! mark
but
> | the fact that using an ! in this position is occuring is worrying.. Has
> | anyone else encountered this?
>
> Do
>
> if(!isset($_REQUEST["license"]))
>
>
> - --
> ******************************************************
> * __ __ _ *
> * ___/ /__ ___ / /_(_)__ ___ __ __ _______ __ _ *
> * / _ / -_)_-</ __/ / _ \/ -_) // // __/ _ \/ ' \ *
> * \_,_/\__/___/\__/_/_//_/\__/\_, (_)__/\___/_/_/_/ *
> * (___/ gregdestiney.com *
> ******************************************************
> BOFH Excuse #444:
> overflow error in /dev/null
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.3 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFAC5IHoAq8t3CabwcRAqKoAJ0RfFIBJJnWREgY9PUViRj8wlrcmwCgpN8d
> AZdz70SMYVJnNd9/C/o/KFQ=
> =b7NS
> -----END PGP SIGNATURE-----

attached mail follows:


Hello..

I made my Login and registration pages and everything is okay.. but what I want now is to know how to make this :

A PHP page for the administrator.. that has a TextBox (UserName).. he will enter a user name in it.. after that he will press the button (Activate).. Now by pressing that button the PHP page will search the database (A specified table) for that username, if it is exist then search his row for a field named (Activation) and then update its value into "Activated".. but if this user is not exist in that table.. a message will apear for the administrator..

Waiting your replies guys ;-)

Thanks in advance...

Cheers..

attached mail follows:


RTFM and stop sending messages to this list with a high priority. The
questions you are asking are answered in the first 3 chapters of any good
book about php.

toby

----- Original Message -----
From: "Radwan Aladdin" <raladinemirates.net.ae>
To: <php-generallists.php.net>
Sent: Monday, January 19, 2004 9:13 AM
Subject: [PHP] How to search the database?

> Hello..
>
> I made my Login and registration pages and everything is okay.. but what I
want now is to know how to make this :
>
> A PHP page for the administrator.. that has a TextBox (UserName).. he will
enter a user name in it.. after that he will press the button (Activate)..
Now by pressing that button the PHP page will search the database (A
specified table) for that username, if it is exist then search his row for a
field named (Activation) and then update its value into "Activated".. but if
this user is not exist in that table.. a message will apear for the
administrator..
>
> Waiting your replies guys ;-)
>
> Thanks in advance...
>
> Cheers..
>

attached mail follows:


Hmmm, your problem sounds like a serious one but something everyone must
know...
I have found this site to be particularly useful http://php.net,as for some
reason these guys
 seem to know what they are talking about..... after going through the
online
manual (or downloading it...),...go to this site http://google.com and
search for "RTFM" for a
total solution to these kinds of problems.

Cheers,
-Ryan

> Hello..
>
> I made my Login and registration pages and everything is okay.. but what I
want now is to know how to make this :
>
> A PHP page for the administrator.. that has a TextBox (UserName).. he will
enter a user name in it.. after that he will press the button (Activate)..
Now by pressing that button the PHP page will search the database (A
specified table) for that username, if it is exist then search his row for a
field named (Activation) and then update its value into "Activated".. but if
this user is not exist in that table.. a message will apear for the
administrator..
>
> Waiting your replies guys ;-)
>
> Thanks in advance...
>
> Cheers..
>

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

attached mail follows:


you should try to figure parts of it out before just asking. By us just
giving you the answer means that you aren't going to learn anything. TRy and
battle but when you get it working you will feel as if you've accomplished
something rather than cut and paste someone else's code!!

-----Original Message-----
From: Ryan A [mailto:ryancoinpass.com]

Sent: Monday, January 19, 2004 12:27 PM
To: raladinemirates.net.ae
Cc: php-generallists.php.net
Subject: Re: [PHP] How to search the database?

Hmmm, your problem sounds like a serious one but something everyone must
know...
I have found this site to be particularly useful http://php.net,as for some
reason these guys
 seem to know what they are talking about..... after going through the
online
manual (or downloading it...),...go to this site http://google.com and
search for "RTFM" for a
total solution to these kinds of problems.

Cheers,
-Ryan

> Hello..
>
> I made my Login and registration pages and everything is okay.. but what I
want now is to know how to make this :
>
> A PHP page for the administrator.. that has a TextBox (UserName).. he will
enter a user name in it.. after that he will press the button (Activate)..
Now by pressing that button the PHP page will search the database (A
specified table) for that username, if it is exist then search his row for a
field named (Activation) and then update its value into "Activated".. but if
this user is not exist in that table.. a message will apear for the
administrator..
>
> Waiting your replies guys ;-)
>
> Thanks in advance...
>
> Cheers..
>

--
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

--------------------------------------------------------------------
Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

attached mail follows:


An object-oriented way of doing it: keep the extra result in a member variable and
get it separately. You might not find this necessary, but it gets more useful
in more complex cases.

class MyClass {
  var $num;
  Function MyFunc(){
    if(isset($_POST['var'])){
      $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
          ");

      $this->num = mysql_num_rows($sql);

        $returnsomething ="blah blah";
    }
    return $returnsomething;
  }

  function getCount() { return $this->num; }

}

Dave Carrera wrote:

>Hi List,
>
>I have a function that makes a call to mysql based on certain vars.
>
>---example----
>
>Function MyFunc(){
> if(isset($_POST[var])){
> $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
>");
> $returnsomething ="blah blah";
> }
> return $returnsomething;
>}
>
>And that all works fine no probs here but.....
>
>I want to use a result somewhere in my script that is not returned by
>return. Let me show you...
>
>---example----
>
>Function MyFunc(){
> if(isset($_POST[var])){
> $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
>");
>
> $num = mysql_num_rows($sql); // I want to use this result outside this
>function.
>
>$returnsomething ="blah blah";
> }
> return $returnsomething;
>}
>
>So $num contains a number that I want to use outside the function which is
>not covered by return.
>
>I know return stops a script and returns what I want it to return but how do
>I send out of the function the var I want.
>
>I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
>would'nt anyway just tried it and yes I know I have to declare it inside my
>new function using global $var; to use it.
>
>So I ask is this achiveable or how can I do this.
>
>Thank you in advance
>
>Dave C
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
>
>
>
>
>

attached mail follows:


Does anyone know if there is any speed advantage to saving a date as a unix
timestamp or a numeric field instead of a date field? (in Mysql)
thanks,

--
--
Diana Castillo
Global Reservas, S.L.
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039
Fax : 00-34-915228673
email: dianahotelkey.com
Web : http://www.hotelkey.com
      http://www.destinia.com