|
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-help_at_lists.php.net
Date: Tue Jan 28 2003 - 15:49:38 CST
php-general Digest 28 Jan 2003 21:49:38 -0000 Issue 1850
Topics (messages 133357 through 133444):
problem installing php
133357 by: Anton Grafström
133358 by: John W. Holmes
133399 by: Anton Grafström
set_error_handler inside a class
133359 by: electroteque
133404 by: John W. Holmes
133433 by: electroteque
133438 by: John W. Holmes
Re: Need Guru's Help
133360 by: David T-G
133361 by: Tariq Murtaza
133382 by: Maxim Maletsky
ftp_ssl_connect
133362 by: Markus Boettger
133400 by: Jason Wong
problem with copy()
133363 by: Bartosz Matosiuk
133385 by: Maxim Maletsky
Re: question about GD and colors
133364 by: nospam
133394 by: Philipp
Re: help needed with session variables
133365 by: Sascha Braun
133375 by: Maxim Maletsky
133398 by: John W. Holmes
php conditional formatting question
133366 by: WMB
133391 by: Guru Geek
Re: Transition Page?
133367 by: Sascha Braun
parsing ini files
133368 by: Erich C. Beyrent
133386 by: Maxim Maletsky
133388 by: Chris Hayes
133397 by: John W. Holmes
Access
133369 by: Todd Barr
133387 by: Maxim Maletsky
Re: Found a PHP bug!!!!!!!!!
133370 by: Maxim Maletsky
133371 by: Maxim Maletsky
Re: Do php extension need to be thread-safe?
133372 by: Maxim Maletsky
Re: phpMyAdmin for Microsoft SQL
133373 by: Maxim Maletsky
133393 by: Joshua E Minnie
Re: Help with Filesize
133374 by: Maxim Maletsky
Re: multiple entry forms !!
133376 by: Maxim Maletsky
Re: PHP vs Perl for system scripts (non-web)
133377 by: Maxim Maletsky
Re: HELP session cache limiters
133378 by: Maxim Maletsky
Re: Access to Pear
133379 by: Maxim Maletsky
Re: PHP Page Refresh on Redirection
133380 by: Maxim Maletsky
Re: Good way to organize code using classes???
133381 by: Maxim Maletsky
133432 by: Jeff Warrington
133441 by: Greg Beaver
Re: printing
133383 by: Maxim Maletsky
Re: Thread safety
133384 by: Maxim Maletsky
Getting a value back from POST (not the built-in return)
133389 by: Paul
133392 by: Chris Hayes
133401 by: Chris Shiflett
133439 by: Paul
133442 by: Chris Shiflett
Re: Too many 'linespaces'
133390 by: Lars Espelid
regexps
133395 by: Khalid El-Kary
133396 by: John W. Holmes
133403 by: Khalid El-Kary
133405 by: John W. Holmes
133406 by: ng
Problems with php.net
133402 by: Darren Gamble
Allowing . in $_POST variable
133407 by: Mike Potter
133408 by: Adam Voigt
133411 by: Chris Wesley
133416 by: John W. Holmes
133423 by: Chris Wesley
133426 by: John W. Holmes
133444 by: Philip Olson
Access difficulties
133409 by: Todd Barr
MS Access
133410 by: Todd Barr
133413 by: Johannes Schlueter
133419 by: Paul Roberts
133421 by: Todd Barr
htpasswd question
133412 by: Dominik Wittenbeck
register_globals
133414 by: Kiswa
Re: [PHP-WIN] htpasswd question
133415 by: Dash McElroy
best way to save form data on user side
133417 by: Petre Agenbag
133420 by: Petre Agenbag
133424 by: John W. Holmes
133425 by: Chris Shiflett
133430 by: Petre Agenbag
133434 by: Chris Shiflett
133435 by: John W. Holmes
133436 by: Adam White
133437 by: Jason Wong
Re: Need help.
133418 by: cybot
133427 by: Rick Emery
133429 by: John W. Holmes
getting the size of a quicktime movie or other media files
133422 by: Daniel Leighton
radius auth and sockets
133428 by: Bryan Koschmann - GKT
133440 by: Bryan Koschmann - GKT
PHP Displays File Header
133431 by: [-^-!-%-
ayuda help
133443 by: Rot Alvarez
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hi I am trying to install php with PHP 4.3.0 installer on windows98. I have
the Xitami server. When I try to run a php-file in the webbpages folder I
get the following meaasge
"Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means
that a page will only be served up if the REDIRECT_STATUS CGI variable is
set, e.g. via an Apache Action directive."
Does anyone know how I can get it to work?
Thanks for any help!
Best regards
/Anton
attached mail follows:
> Hi I am trying to install php with PHP 4.3.0 installer on windows98. I
> have
> the Xitami server. When I try to run a php-file in the webbpages
folder I
> get the following meaasge
>
> "Security Alert! The PHP CGI cannot be accessed directly.
> This PHP CGI binary was compiled with force-cgi-redirect enabled. This
> means
> that a page will only be served up if the REDIRECT_STATUS CGI variable
is
> set, e.g. via an Apache Action directive."
Uncomment the last line shown here from php.ini and set it to zero.
; cgi.force_redirect is necessary to provide security running PHP as a
CGI under
; most web servers. Left undefined, PHP turns this on by default. You
can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
attached mail follows:
Thanks. That solved the problem
"John W. Holmes" <holmes072000
charter.net> skrev i meddelandet
news:005e01c2c6ba$975f3110$7c02a8c0
coconut...
> > Hi I am trying to install php with PHP 4.3.0 installer on windows98. I
> > have
> > the Xitami server. When I try to run a php-file in the webbpages
> folder I
> > get the following meaasge
> >
> > "Security Alert! The PHP CGI cannot be accessed directly.
> > This PHP CGI binary was compiled with force-cgi-redirect enabled. This
> > means
> > that a page will only be served up if the REDIRECT_STATUS CGI variable
> is
> > set, e.g. via an Apache Action directive."
>
> Uncomment the last line shown here from php.ini and set it to zero.
>
> ; cgi.force_redirect is necessary to provide security running PHP as a
> CGI under
> ; most web servers. Left undefined, PHP turns this on by default. You
> can
> ; turn it off here AT YOUR OWN RISK
> ; **You CAN safely turn this off for IIS, in fact, you MUST.**
> ; cgi.force_redirect = 1
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
attached mail follows:
hi guys how is ti possible to do a set_error_handler within a class so it
will trigger the callback function and so will be able to return the line
and file in the message ?
attached mail follows:
> hi guys how is ti possible to do a set_error_handler within a class so
it
> will trigger the callback function and so will be able to return the
line
> and file in the message ?
You'd set it just like you would anywhere else in your code.
If you want the callback function to be a method in your class, then you
pass an array to set_error_handler(). Details are in the manual on the
format of the array. It'll be the same as any other callback function
that you can send a classes method to.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
attached mail follows:
sorry is there a way to do this in php3 ? my work currently only has php3 ,
where i am upgrading it for them soon, this is a bummer, i soughta wanna
catch errors and show the line and file in the error too
-----Original Message-----
From: John W. Holmes [mailto:holmes072000
charter.net]
Sent: Wednesday, January 29, 2003 4:51 AM
To: 'electroteque'; php-general
lists.php.net
Subject: RE: [PHP] set_error_handler inside a class
> hi guys how is ti possible to do a set_error_handler within a class so
it
> will trigger the callback function and so will be able to return the
line
> and file in the message ?
You'd set it just like you would anywhere else in your code.
If you want the callback function to be a method in your class, then you
pass an array to set_error_handler(). Details are in the manual on the
format of the array. It'll be the same as any other callback function
that you can send a classes method to.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
attached mail follows:
> sorry is there a way to do this in php3 ? my work currently only has php3
,
> where i am upgrading it for them soon, this is a bummer, i soughta wanna
> catch errors and show the line and file in the error too
Nope... it's 4.0.1 and higher only. UPGRADE!! :)
---John Holmes...
attached mail follows:
Tariq --
...and then Tariq Murtaza said...
%
% Hi All Guru's here,
Hi! [Hey, does that make me a guru now? ;-]
%
% I need your help regarding converting HTML Table structure to DB schema
% or XML format. I am not a Regular expression expert.
While I realize that this is a php list, I nonetheless recommend perl. I
had a quick look around at search.cpan.org for "html table parse" and
found lots of results, the first two of which look like exactly what you
need. If this is a one-shot conversion for your 500 files, I'd go that
route since it's already written.
HTH & HAND
:-D
-- David T-G * There is too much animal courage in (play) davidtgjustpickone.org * society and not sufficient moral courage. (work) davidtgwork
justpickone.org -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE+NnJvGb7uCXufRwARAsgtAJ49q2zAL5X49E61alQpb629jbmFewCePuAB IxsI8nKHwZg3mqrRx4O3y0E= =/C6E -----END PGP SIGNATURE-----
attached mail follows:
Thanks David,
I want it in php instead of perl anyway thanks for your help
Regards,
Tariq
David T-G wrote: > Tariq -- > > ...and then Tariq Murtaza said... > % > % Hi All Guru's here, > > Hi! [Hey, does that make me a guru now? ;-] > > > % > % I need your help regarding converting HTML Table structure to DB schema > % or XML format. I am not a Regular expression expert. > > While I realize that this is a php list, I nonetheless recommend perl. I > had a quick look around at search.cpan.org for "html table parse" and > found lots of results, the first two of which look like exactly what you > need. If this is a one-shot conversion for your 500 files, I'd go that > route since it's already written.
attached mail follows:
What about looking for something like that written in C that would convert your HTML into XML and then use PEAR's XMLParser to get it into a PHP structure?
-- Maxim Maletsky maximphp.net
Tariq Murtaza <tariq
smeda.org.pk> wrote... :
> Hi All Guru's here, > > I need your help regarding converting HTML Table structure to DB schema > or XML format. I am not a Regular expression expert. > > (Actually i have 500 html files containing this table struction,and need > to read all 500 files and convert them to DB schema or XML format) > > Looking for anybody to help me out. > Regards Tariq > > <table width="83%" border="1" cellpadding="2" cellspacing="0" > > <tr> > <td colspan="8" height="25"> <b> <a href=http://www.ababasons.com > > >A. BABA & SONS</a></b> </td> > <tr> > <td colspan="8" align="left" valign="top"> <p>240/2, SECTOR 6.1, > Lahore.<br> > [LAHORE ] </p></td> > <tr> > <td><b>Phone:</b></td> > <td>92021-6974878</td> > <td><b>Mobile:</b></td> > <td colspan="3">0333-66566 </td> > <td><b>Fax:</b></td> > <td colspan="3">92021-6901145</td> > </tr> > <tr> > <td colspan="8" height="25"> <b> <a href=http://www.ababasons.com > > >ABC & CO</a></b> </td> > > <tr> > <td colspan="8" align="left" valign="top"> <p>240/2, SECTOR 6.1, > NORTH KARACHI, > KARACHI.<br> > [KARACHI ] </p></td> > <tr> > <td><b>Phone:</b></td> > <td>92021-6974878</td> > <td><b>Mobile:</b></td> > <td colspan="3">033-565659</td> > <td><b>Fax:</b></td> > <td colspan="3">92021-6118625 </td> > </tr> > <tr> > <td colspan="8" height="25"> <b> <a href=http://www.ababasons.com > > >ARahat Textile</a></b> </td> > > <tr> > <td colspan="8" align="left" valign="top"> <p>240/2, SECTOR 6.1, > NORTH KARACHI, > KARACHI.<br> > [KARACHI ] </p></td> > <tr> > <td><b>Phone:</b></td> > <td>92021-6974878</td> > <td><b>Mobile:</b></td> > <td colspan="3"> </td> > <td><b>Fax:</b></td> > <td colspan="3">92021-6966625 </td> > </tr> > <tr> > <td colspan="8" height="25"> <b> <a href=http://www.ababasons.com > > >A. Corvid Ltd</a></b> </td> > > <tr> > <td colspan="8" align="left" valign="top"> <p>240/2, SECTOR 6.1, > NORTH Peshawar<br> > [PESHAWAR ] </p></td> > <tr> > <td width="7%"><b>Phone:</b></td> > <td width="26%">92021-6974878</td> > <td width="8%"><b>Mobile:</b></td> > <td colspan="3">0332-656656 </td> > <td width="5%"><b>Fax:</b></td> > <td width="33%" colspan="3">92021-69086265</td> > </tr> > </table> > -- > Tariq Murtaza > Assistant Web Master > Business Technology Team > Small & Medium Enterprise Development Authority > > > > > -- > Tariq Murtaza > Assistant Web Master > Business Technology Team > Small & Medium Enterprise Development Authority > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hello, I try it again ... is anybody here who can tell me how to use the ftp_ssl_connect function in 4.3? Has anybody a sample code in which the use uf the openSSL functions are declared? rtfm does not help here, because I do read for days now.
Thanks, Markus
attached mail follows:
On Tuesday 28 January 2003 20:19, Markus Boettger wrote: > Hello, > I try it again ... > is anybody here who can tell me how to use the ftp_ssl_connect function > in 4.3? > Has anybody a sample code in which the use uf the openSSL functions are > declared? > rtfm does not help here, because I do read for days now.
Just what exactly is the problem? AFAICS its use is similar to the plain ftp_connect() -- and there are plenty of examples on how to use that.
-- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* The First Rule of Program Optimization: Don't do it.
The Second Rule of Program Optimization (for experts only!): Don't do it yet. -- Michael Jackson */
attached mail follows:
hi
can the string source in copy () looks like that: "c:\pic.jpg". If not than how should it look like.
I'm not sure becouse script gives me "Unable to open c:\pic.jpg for reading: No such file or directory" but the file is there.
and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me: 'Unable to open 'none' for reading: No such file or directory'.
attached mail follows:
you need to escape the windows backslash:
$file = "c:\pic.jpg";
should be
$file = "c:\\pic.jpg";
or
$file = "c:/pic.jpg";
which will work the same
-- Maxim Maletsky maximphp.net
"Bartosz Matosiuk" <madsiuk
morellos.net> wrote... :
> hi > > can the string source in copy () looks like that: "c:\pic.jpg". If not > than how should it look like. > > I'm not sure becouse script gives me "Unable to open c:\pic.jpg for > reading: No such file or directory" but the file is there. > > and when i'm using $HTTP_POST_FILES['file']['tmp_name'] it returns me: > 'Unable to open 'none' for reading: No such file or directory'. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Hi
I have the same Problem with the bundeled libary. I hade no time to fill in a bug report at bugs.php.net. Probably you could?
regards Sebastian
> -----Original Message-----
> From: Jean-François Marseaut [mailto:jfmarseaut
studyssimo.be]
> Sent: Monday, January 27, 2003 5:16 PM
> To: php-general
lists.php.net
> Subject: [PHP] question about GD and colors
>
>
> With this script under, I get resized image in only 16
> colors. with an old version of gd, I got 16 million colors
> images. Has someone a response ?
>
>
> <?PHP
> /*******************
> file [string] -> filename jpg
> w [int] -> width
> ********************/
>
> header("Content-type: image/png");
>
> $file = urldecode($file);
> $file = "../".$file;
>
> $infofile = getimagesize($file);
> $long = $infofile[1];
> $haut = $infofile[0];
> $type = $infofile[2];
>
> if ($long<$w) $w=$long;
>
>
> $ratio = $haut / $w;
> $h = $long / $ratio;
>
> if ($h>$w)
> {
> $h = $w;
> $ratio = $long / $w;
> $w = $haut / $ratio;
> }
>
>
> $h = (int)$h;
>
> $dst_img = ImageCreate($w, $h);
> $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);
>
> switch ($type)
> {
> case 1 :
> $src_img=ImageCreateFromGif($file);
> break;
> case 2 :
> $src_img=ImageCreateFromJpeg($file);
> break;
> case 3 :
> $src_img=ImageCreateFromPng($file);
> break;
> case 6 :
> $src_img=imagecreatefromwbmp($file);
> break;
> default :
> ImagePng($dst_img);
>
> }
>
> imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
> ImageSX($src_img), ImageSY($src_img));
> imagepng($dst_img);
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Hi,
question was answered yesterday on the list. there is a new function imagecreatetruecolor(). use this instead of imagecreate().
Regard, Philipp
----- Original Message -----
From: "nospam" <phpmail1
HotPOP.com>
To: "'Jean-François Marseaut'" <jfmarseaut
studyssimo.be>
Cc: "'Php-General" <php-general
lists.php.net>
Sent: Monday, January 27, 2003 5:48 PM
Subject: RE: [PHP] question about GD and colors
Hi
I have the same Problem with the bundeled libary. I hade no time to fill in a bug report at bugs.php.net. Probably you could?
regards Sebastian
> -----Original Message-----
> From: Jean-François Marseaut [mailto:jfmarseaut
studyssimo.be]
> Sent: Monday, January 27, 2003 5:16 PM
> To: php-general
lists.php.net
> Subject: [PHP] question about GD and colors
>
>
> With this script under, I get resized image in only 16
> colors. with an old version of gd, I got 16 million colors
> images. Has someone a response ?
>
>
> <?PHP
> /*******************
> file [string] -> filename jpg
> w [int] -> width
> ********************/
>
> header("Content-type: image/png");
>
> $file = urldecode($file);
> $file = "../".$file;
>
> $infofile = getimagesize($file);
> $long = $infofile[1];
> $haut = $infofile[0];
> $type = $infofile[2];
>
> if ($long<$w) $w=$long;
>
>
> $ratio = $haut / $w;
> $h = $long / $ratio;
>
> if ($h>$w)
> {
> $h = $w;
> $ratio = $long / $w;
> $w = $haut / $ratio;
> }
>
>
> $h = (int)$h;
>
> $dst_img = ImageCreate($w, $h);
> $background_color = ImageColorAllocate ($dst_img, 0, 0, 0);
>
> switch ($type)
> {
> case 1 :
> $src_img=ImageCreateFromGif($file);
> break;
> case 2 :
> $src_img=ImageCreateFromJpeg($file);
> break;
> case 3 :
> $src_img=ImageCreateFromPng($file);
> break;
> case 6 :
> $src_img=imagecreatefromwbmp($file);
> break;
> default :
> ImagePng($dst_img);
>
> }
>
> imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $w, $h,
> ImageSX($src_img), ImageSY($src_img));
> imagepng($dst_img);
>
>
> --
> 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
attached mail follows:
Isnt it better to do it in this way?
session_start(); session_register('USER');
$USER['valid'] = true; $USER['firstname'] = $first_name; $USER['lastname'] = $last_name;
Then I really know what I am doing!
Good luck
Sascha
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000
charter.net>
To: "Pushpinder Singh Garcha" <pgarcha
adelphia.net>;
<php-general
lists.php.net>
Sent: Monday, January 27, 2003 11:02 PM
Subject: Re: [PHP] help needed with session variables
> Are you sure $first_name and $last_name have a value? Double check...
>
> ---John Holmes...
>
> ----- Original Message -----
> From: "Pushpinder Singh Garcha" <pgarcha
adelphia.net>
> To: <php-general
lists.php.net>
> Sent: Monday, January 27, 2003 4:44 PM
> Subject: [PHP] help needed with session variables
>
>
> hello,
>
> I am making use of sessions in my PHp/MySQL Database application. When
> the user is successfully authenticated against the database, a session
> is created in following manner:
>
>
> session_register("valid_user","firstname","lastname");
>
> $valid_user = $login;
> $firstname = $first_name;
> $lastname = $last_name;
>
> While I am able to use the $valid_user variable all thru the sesion ,
> when I try to use the $valid_user it works fine (i.e. I am able to
> access the value) throughout the session, however when I try to use the
> other two registered session variables i.e firstname and lastname, I
> am not able to extract the value. Can you suggest what might be going
> wrong. Note I am locally testing the setup on my Mac.
>
> Many Thanks
> Pushpinder Singh Garcha
> _________________________________
> Web Architect
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
pass it one value at the time:
session_register("valid_user"); session_register("firstname"); session_register("lastname");
Another recommended method is to use superglobal variable $_SESSION. You can then simply do:
$_SESSION['valid_user'] = $login; $_SESSION['firstname'] = $first_name; $_SESSION['lastname'] = $last_name;
and the three variables will be available on the next pages.
remember to start sessions before hand:
session_start();
-- Maxim Maletsky maximphp.net
Pushpinder Singh Garcha <pgarcha
adelphia.net> wrote... :
> hello, > > I am making use of sessions in my PHp/MySQL Database application. When > the user is successfully authenticated against the database, a session > is created in following manner: > > > session_register("valid_user","firstname","lastname"); > > $valid_user = $login; > $firstname = $first_name; > $lastname = $last_name; > > While I am able to use the $valid_user variable all thru the sesion , > when I try to use the $valid_user it works fine (i.e. I am able to > access the value) throughout the session, however when I try to use the > other two registered session variables i.e firstname and lastname, I > am not able to extract the value. Can you suggest what might be going > wrong. Note I am locally testing the setup on my Mac. > > Many Thanks > Pushpinder Singh Garcha > _________________________________ > Web Architect
attached mail follows:
> Isnt it better to do it in this way?
Better than what?
> session_start(); > session_register('USER'); > > $USER['valid'] = true; > $USER['firstname'] = $first_name; > $USER['lastname'] = $last_name; > > Then I really know what I am doing!
It's personal preference... whatever you understand.
I'd recommend just using $_SESSION and keep register_globals OFF, but that's me.
---John Holmes...
attached mail follows:
I know it's possible, but I just can't get it working. In an old file I have a straight php coding doc where it's used and am now trying to mimic the resulting output.
I'm trying to get a result from a query in a specific color when it fits the bill ( if ($teamcaptain == $deelnemer) //if yes, we'll make the result green echo "<td class="achtergrondbottom">"; etc
(((((SEE BELOW))))))
when the person ($deelnemer) also fits the $teamcaptain I want this one to be listed in different format, I dont care if it's only color or if it's a css. Hope there's someone able to help me here, thanks,
Martin The Netherlands
part of php code:
do { ?> <tr class="laag2"> <?php $teamcaptain = strtoupper($row_rsCompetitie['tmcap']);echo $teamcaptain; $deelnemer = strtoupper($row_rsCompetitie['zoekcode']);echo $deelnemer;?> <?php if ($teamcaptain == $deelnemer) //if yes, we'll make the result green echo "<td class="achtergrondbottom">"; } ?> <td><?php echo $row_rsCompetitie['zoekcode']; ?></td> <td class="achtergrondgrijs"><?php echo $row_rsCompetitie['roepnaam']; ?></td> <td><?php echo $row_rsCompetitie['samennaam']; ?></td> <td><?php echo $row_rsCompetitie['handicap']; ?></td> <td><?php echo $row_rsCompetitie['tmnaam']; ?></td> <td><?php echo $row_rsCompetitie['tmklasse']; ?></td> <td><?php echo $row_rsCompetitie['tmpoule']; ?></td> </tr> <?php } while ($row_rsCompetitie = mysql_fetch_assoc($rsCompetitie)); ?> </table>
attached mail follows:
I'm new to PHP but I had a similar problem. I was comparing information in a flat text file with a variable in my php code. They never matched according to the php. I echo'd both values to the screen and they matched. So then I echo'd them to the screen with three 'a' in front and three 'a' in back of the values. Much to my suspicion there was a blank space behind the value from the text file. So, I used rtrim to get rid of the blank space. Looks something like this:
$contents[1] = rtrim($contents[1]);
if ($idname = = $contents[0]) { echo "Works Thus Far!"; exit; }
Hope this is helpful! ! ! Roger
WMB wrote:
> I know it's possible, but I just can't get it working. > In an old file I have a straight php coding doc where it's used and am now > trying to mimic the resulting output. > > I'm trying to get a result from a query in a specific color when it fits the > bill > ( > if ($teamcaptain == $deelnemer) > //if yes, we'll make the result green > echo "<td class="achtergrondbottom">"; etc > > (((((SEE BELOW)))))) > > when the person ($deelnemer) also fits the $teamcaptain I want this one to > be listed in different format, I dont care if it's only color or if it's a > css. > Hope there's someone able to help me here, thanks, > > Martin > The Netherlands > > part of php code: > > do { ?> > <tr class="laag2"> > <?php $teamcaptain = strtoupper($row_rsCompetitie['tmcap']);echo > $teamcaptain; > $deelnemer = strtoupper($row_rsCompetitie['zoekcode']);echo $deelnemer;?> > <?php > if ($teamcaptain == $deelnemer) > //if yes, we'll make the result green > echo "<td class="achtergrondbottom">"; > } > ?> > <td><?php echo $row_rsCompetitie['zoekcode']; ?></td> > <td class="achtergrondgrijs"><?php echo $row_rsCompetitie['roepnaam']; > ?></td> > <td><?php echo $row_rsCompetitie['samennaam']; ?></td> > <td><?php echo $row_rsCompetitie['handicap']; ?></td> > <td><?php echo $row_rsCompetitie['tmnaam']; ?></td> > <td><?php echo $row_rsCompetitie['tmklasse']; ?></td> > <td><?php echo $row_rsCompetitie['tmpoule']; ?></td> > </tr> > <?php } while ($row_rsCompetitie = mysql_fetch_assoc($rsCompetitie)); ?> > </table> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
If there is really need for such a page, my first guess was, as i thought about it, to enter the content, which is responsible for the upload in a invisible frame.
For an invisible Frame you just have to make a frameset, where you only can see one part of the frame <frameset rows="*,1" or some like that, and on the other hand you are just making your transition page. after your upload is finished you just have to run a javascript parent.location.href="" command.
Dont know if it works but just give it a try.
mh, dont know if it really works, have no time yet, would be nice to know :))
Greetings
Sascha
attached mail follows:
Hey everybody,
I'm new the list and to PHP, so I thought I'd launch right in with a question.
I have a file which contains the following syntax:
; Events listings [event] month = january day = 23 year = 2003 venue = some club description = this is an event
[event] month = january day = 12 year = 2003 venue = another club description = this is another event
Each one of these headers sections represents the start of a new event. So, my code does the following:
$EVENTS = parse_ini_file('./data/events', TRUE); while($key = key($EVENTS)) { $$key = current($EVENTS); //variable variables next($EVENTS); }
The problem is that when I try to print the values for $venue, $day, etc, I only get the values for the last section encountered. I need a way to get the values of all the events - do my section heads need to be unique, or can I continue to use the same format in my ini file?
Thanks in advance!
-Erich-
attached mail follows:
there is a bunch of examples to parse the ini files in PHP. You can even do one on your own:
1. loop every line 2. if format is [**] then this is the key 3. everything till the empty line is a key = value pair
P.S: please, when replying click on "new email" and cut&paste the email address. If you click "reply-to" and change the "to" and "body" to your own so it looks like a new post, some of us still get it as a thread of the previous one.
-- Maxim Maletsky maximphp.net
"Erich C. Beyrent" <erich.beyrent
beyrent.net> wrote... :
> Hey everybody, > > I'm new the list and to PHP, so I thought I'd launch right in with a > question. > > I have a file which contains the following syntax: > > ; Events listings > [event] > month = january > day = 23 > year = 2003 > venue = some club > description = this is an event > > [event] > month = january > day = 12 > year = 2003 > venue = another club > description = this is another event > > Each one of these headers sections represents the start of a new event. So, > my code does the following: > > $EVENTS = parse_ini_file('./data/events', TRUE); > while($key = key($EVENTS)) > { > $$key = current($EVENTS); //variable variables > next($EVENTS); > } > > The problem is that when I try to print the values for $venue, $day, etc, I > only get the values for the last section encountered. I need a way to get > the values of all the events - do my section heads need to be unique, or can > I continue to use the same format in my ini file? > > Thanks in advance! > > -Erich- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
>I have a file which contains the following syntax: > >; Events listings >[event] >month = january >day = 23 >year = 2003 >venue = some club >description = this is an event > >[event] >month = january >day = 12
interesting function, i had not seen it yet.
You could have a look at the alternative function mentioned by the users 'seb' and 'Tom' in the online manual http://nl.php.net/manual/nl/function.parse-ini-file.php, at least you can tweak that so the values get added to arrays.
Or you could see whether this will work: [event] month[]=januari
[event] month[]=februari
I doubt whether it would work, the idea is that in this case $month[0] would be januari and $month[1] februari.
>$EVENTS = parse_ini_file('./data/events', TRUE); >while($key = key($EVENTS)) >{ > $$key = current($EVENTS); //variable variables > next($EVENTS); >}
if you ask me, i would do it like this:
while (list ($key, $val) = each ($_POST)) { { $$key = $val; }
attached mail follows:
> I have a file which contains the following syntax: > > ; Events listings > [event] > month = january > day = 23 > year = 2003 > venue = some club > description = this is an event > > [event] > month = january > day = 12 > year = 2003 > venue = another club > description = this is another event > > Each one of these headers sections represents the start of a new event. So, > my code does the following: > > $EVENTS = parse_ini_file('./data/events', TRUE); > while($key = key($EVENTS)) > { > $$key = current($EVENTS); //variable variables > next($EVENTS); > } > > The problem is that when I try to print the values for $venue, $day, etc, I > only get the values for the last section encountered. I need a way to get > the values of all the events - do my section heads need to be unique, or can > I continue to use the same format in my ini file?
Yes, each section has to be unique, otherwise you're just overwriting the values each time it's read.
If you want to do it this way, I'd write your own function to read the file and not use parse_ini_file().
---John Holmes...
attached mail follows:
Access
Does anyone here have any idea how to connect access to PHP?
Thanks
attached mail follows:
with ODBC
www.php.net/odbc
-- Maxim Maletsky maximphp.net
"Todd Barr" <tbarr
geo-imaging.com> wrote... :
> Access > > Does anyone here have any idea how to connect access to PHP? > > Thanks > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
just try doing it with === (three equal signs) and you'll see what is where
-- Maxim Maletsky maximphp.net
"Cal Evans" <cal
calevans.com> wrote... :
> John. > > > Actually, "08" is equal to 8 in PHP. PHP will convert the string to an > >integer and the two will compare as equal. > > No they are not equal. Yes, PHP will do the conversion so that they are > equal. That does not refute the fact that logically '08' != 8. > > > > Someone already posted why the problem was happening, because the numbers > > were being converted to invalid octal numbers and being set to zero. > > I understand the problem at hand. (and did when I posted) However, if Scott > had been doing the conversions manually, he would never have run across this > problem. It is a bad idea to rely on the language (whatever the language) > to do automatic variable conversions. > > =C= > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Your bug is this:
inconsistency of types.
You split a formatted string into smaller strings and compare the integers to it. In order to do this correctly, you will need to take your integers and convert them into the strings, format of which you already know and used for deformatting the original string. Then compare.
That is the only way to be safe, other ways are "magic" because PHP debugged them for you. It's really all about the programming logic. few of you who are fluent with C or Java would dump into this.
-- Maxim Maletsky maximphp.net
"Scott Fletcher" <scott
abcoa.com> wrote... :
> Found a PHP bug, I'm using PHP version 4.2.3. I have been struggling with > why PHP code failed to work with the month is August or September, so I have > been playing around it and found the problem. I recently wrote a demo > script for you all to play around with. Let me know which PHP version does > this bug not affected you.... I'm going to file a PHP bug at > http://bug.php.net...... I'll let you know where PHP bug # is it. To tell > you the truth, I don't know how to search for existing bug on this one if > there is any because I don't know if it is an if-statement issue or if it is > something else.... Feel free to submit a patch if you know how. > > Let me know what you found and post it here... > > --clip-- > <? > //Sample Code..... ================================================== > $VARIABLE[0] = "2002-01"; > $VARIABLE[1] = "2002-02"; > $VARIABLE[2] = "2002-03"; > $VARIABLE[3] = "2002-04"; > $VARIABLE[4] = "2002-05"; > $VARIABLE[5] = "2002-06"; > $VARIABLE[6] = "2002-07"; > $VARIABLE[7] = "2002-08"; > $VARIABLE[8] = "2002-09"; > $VARIABLE[9] = "2002-10"; > $VARIABLE[10] = "2002-11"; > $VARIABLE[11] = "2002-12"; > > //Loop Code to check the variable.... =============================== > for ($x=0;$x<12;$x++) { > $month = substr($VARIABLE[$x],5,2); > > echo "The # of month is ".$x."<br>"; > > if ($month == 01) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 02) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 03) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 04) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 05) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 06) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 07) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 08) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 09) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 10) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 11) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > if ($month == 12) { echo "It's a Match!!<br>"; } else { echo "It's not > a Match!!<br>"; } > > echo "<br>"; > } > > //Strange Workaround to 08 and 09 =================================== > echo "Strange Workaround to the Problem!!<br><br>"; > > $month = substr($VARIABLE[7],5,2); > echo "The # of month is 08<br>"; > if (trim($month) == 8) { > echo "It's working!!!<br>"; > } > > $month = substr($VARIABLE[8],5,2); > echo "The # of month is 09<br>"; > if (trim($month) == 9) { > echo "It's working!!!<br>"; > } > > //Testing (Should this be working or not??) ========================= > echo "<br><br>"; > $month = substr($VARIABLE[0],5,2); > echo "The # of month is 1<br>"; > if (trim($month) == 1) { //With "1" as an integer... > echo "It's working!!!<br>"; > } > > echo "<br>"; > $month = substr($VARIABLE[0],5,2); > echo "The # of month is 01<br>"; > if (trim($month) == 01) { //With "01" as an integer > echo "It's working!!!<br>"; > } > > echo "<br>"; > $month = substr($VARIABLE[0],5,2); > echo "The # of month is 1<br>"; > if (trim($month) == "1") { //With "1" as an integer... > echo "It's working!!!<br>"; > } > > echo "<br>"; > $month = substr($VARIABLE[0],5,2); > echo "The # of month is 01<br>"; > if (trim($month) == "01") { //With "01" as an integer > echo "It's working!!!<br>"; > } > ?> > --clip-- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Absolutely yes. Take a look at the current extensions there to see how it can be controlled.
-- Maxim Maletsky maximphp.net
Joshua Moore-Oliva <josh
chatgris.com> wrote... :
> Do php extension need to be thread-safe? I am running php on apache2. I > would guess that since it's compiled in as a module, it would need to be > thread-safe correct? > > Josh. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
There is nothing for MS SQL that I know. phpMyAdmin was used for mySQL initially and then some volunteers like you made postreSQL and Oracle versions of it. So, you might want to try one on your own on SourceForge :)
-- Maxim Maletsky maximphp.net
"Joshua E Minnie" <josh
acsurf.net> wrote... :
> Hey all, > > Does any body know of anything similar to phpMyAdmin for MS SQL? I have been doing some googling and haven't come across anything that would help me out. I have also checked out www.sourceforge.net and can't seem to come across anything either. I am looking for something that will be easy enough for my client to utilize to update/manipulate a database, rather than having me re-create the wheel so-to-speak. > > -- > Joshua Minnie > Advantage Computer Services, LLC > Senior Project Manager > josh
acsurf.net > www.advantagecomputerservices.com > Tel: 269.276.9690 > Fax : 269.342.8750
attached mail follows:
I might just have to do that, thanks.
"Maxim Maletsky" wrote:
> There is nothing for MS SQL that I know. phpMyAdmin was used for mySQL
> initially and then some volunteers like you made postreSQL and Oracle
> versions of it. So, you might want to try one on your own on SourceForge
> :)
>
>
> --
> Maxim Maletsky
> maxim
php.net
>
>
>
> "Joshua E Minnie" <josh
acsurf.net> wrote... :
>
> > Hey all,
> >
> > Does any body know of anything similar to phpMyAdmin for MS SQL? I have
been doing some googling and haven't come across anything that would help me
out. I have also checked out www.sourceforge.net and can't seem to come
across anything either. I am looking for something that will be easy enough
for my client to utilize to update/manipulate a database, rather than having
me re-create the wheel so-to-speak.
> >
> > --
> > Joshua Minnie
> > Advantage Computer Services, LLC
> > Senior Project Manager
> > josh
acsurf.net
> > www.advantagecomputerservices.com
> > Tel: 269.276.9690
> > Fax : 269.342.8750
>
attached mail follows:
Try fstat() function on the file pointer - it will return you the various results, including its size.
-- Maxim Maletsky maximphp.net
Rodrigo Corrêa <rodrigo
praticsistemas.com.br> wrote... :
> > How do i use the function filesize, because i´m using like: > > I just want associate the variable $body with a html file > > $file_name = 'c:/templates/resp_rep_efetiva_contrato.php'; > $fd = fopen($file_name,"r"); > line 27 $size = filesize($file_name); / Dá erro aqui > $body = fread($fd, $size); > $mail = mail($address, $subject, $body, $header); > it keeps saind that: > > Warning: stat failed for c://templates/resp_rep_efetiva_contrato.php (errno=2 - No such file or directory) in line 27 > > but, the file exists because the fopen function works ok, I don´t known what to do > > > > Thanks in advance > > > -------------------------------------------------------------------------------- > Equipe Pratic Sistemas > Rodrigo Corrêa > Fone: (14) 441-1700 > suporte
praticsistemas.com.br > rodrigo
praticsistemas.com.br > > >
attached mail follows:
Create the 7 steps, or 7 pages. Create a session to contain all the answers you need from the user Submit a form on each step and register each data-set into the session respectively to the their locations. Fill up the whole session this way and proceed on the 7th step to the actual injection into the DB.
That is the most elegant way, IMO.
-- Maxim Maletsky maximphp.net
"scott" <scott
sporticia.com> wrote... :
> hi > > looking for some advice > > I have a site in progress. user to it have to enter a LOT of information (it > will contain a club directory) > > in order to try and make it a less unpleasant experience for the user, I > want to give them 7 smaller input forms, each one following the other > > what would be the correct way to do this, one very large, complex coded php > conditional form that does everything, or several smaller ones ? > > if I use one form, it will conatin rather a lot of code, but execution would > all be handled by the form itself > > but if I use multiple smaller forms, each form would need to process the > previous forms input, and then display it's inputs for entry > > I am also using sessions, which adds a little to complexity > > any general good coding practice tips/links would be helpful > > thanks > > _scott > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Paul Chvostek <paul+php
it.ca> wrote... :
> > I have to write a swath of code to manage system-related stuff based on > database content. Scripts will be run as root by cron, and determine > what they have to do via user interaction and SQL lookups. Functions > will include manipulation of system configuration files, legacy text > file configs, and some signalling with posix_kill. On some of the > machines in question, there won't even be an httpd installed, so I'd be > building a php as a standalone binary, and running it with shell magic > and a -q option. I've done this kind of stuff in the past in smaller > environments, and it seems to work nicely.
PHP can easily do all that, probably even easier that with Perl. Perl is somewhat too painful to write scripts in. For my needs, i whether use PHP or Ruby for stand-alone apps. Ruby is less flexible than PHP but its "pure" OOP and I often need to resort to it.
> I'm more comfortable writing stuff in PHP. I use PHP alot more, and I > find the resultant code more readable and easier to maintain.
You answered yourself again - if you are more comfortable with PHP then why hassle with painful Perl?
> Aside > from Perl's ubiquity and the dubious advantage of future flexibility by > using Perl's DBI interface to talk to different SQL servers (I'm using > MySQL at the moment), are there any compelling reasons I should write > system stuff in Perl rather than PHP?
PHP natively works quite well with mySQL, thus its another reason to use it.
-- Maxim Maletsky maximphp.net
attached mail follows:
this means that somewhere (on line 19 of /home/sisource/public_html/stage/administration/config.php) there is an output. For sessions to work, session_start() should be *before* any output was created. Even a new line or a whitespace would break it.
-- Maxim Maletsky maximphp.net
"Didier McGillis" <codesmoker
hotmail.com> wrote... :
> I dont know where this came from. The site was working fine, unless someone > else on my team made a fix in this file. > > Any thoughts on this error? > > Warning: Cannot send session cache limiter - headers already sent (output > started at /home/sisource/public_html/stage/administration/config.php:19) in > /home/sisource/public_html/stage/administration/phpSecurePages/checklogin.php > on line 134 > > > > > > > > > _________________________________________________________________ > Tired of spam? Get advanced junk mail protection with MSN 8. > http://join.msn.com/?page=features/junkmail > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
It is a bad idea to "hijack" someone's thread. In other words, when posting a new question, do not reply to an existing post changing its subject and content. Mail headers still reference to the old one and we all see it just being another post of a thread.
-- Maxim Maletsky maximphp.net
"Warren Vail" <warren
vailtech.net> wrote... :
> > I know how to load extensions if they are not included in PHP.ini (dl > function), but how do I gain access to PEAR? > > I can see the directory /apache/php/pear/ on my test machine, but when I try > to reference via > > include_once("DB.php"); > > not found on include list error,,,,, can I dynamically change include list, > and what kind of security hole would that represent? my test machine is > windows, and my production machine is Redhat Linux, so I need to find a way > to gain access to pear in both environments. > > Warren Vail > warren
vailtech.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
make sure that new page's headers do not cache. See www.php.net/header for examples.
-- Maxim Maletsky maximphp.net
"Phil" <philcava
attbi.com> wrote... :
> I have a PHP page with a form that submits to another PHP processing page. > On completion of the PHP actions on the processing page, I have echoed into > the page the javascript action of 'location.href=...' and the location is > redirected to the PHP form page that starting the process. Both pages take > data from an SQL server. The problem I'm having is that the the javascript > always grabs the cached page. I need a newly refreshed page to return with > updated data from the SQL server. Any suggestions? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
"
Nilaab" <superbus22
attbi.com> wrote... :
> Hello everyone, > > I want to be able to use objects to create my future pages. My goal is to > use methods of classes to make the original front-line script easier to > read, while all the processing is done with a simple call to the different > classes from a single class. Please read futher, as I'll get to a point and > to my question... > > I have many classes that do different tasks, like formValidator.class, > stringManipulator.class, db.class, fileManipulation.class, template.class, > etc (these are self-explanitory as their names suggest). Then, I might have > a class called category.class that adds, deletes, edits, moves, and renames > categories within the filesystem and database. But I would have a front-line > script called category.php that would call the necessary methods of > category.class at certain points, depending on the task being done on a > specific step. > > In other words I want category.class to call the other classes and do > something with them, then in turn I want category.php to call objects in > category.class for a specific task, such as: > > <?php > > // category.php > > include ("category.class"); > $cat = new category (); > $cat->addCategory($new_cat_name); > // or > $cat->editCategory($cat_name); > // or > $cat->deleteCategory($cat_name); > // or > $cat->moveCategory($cat_name); > // or > $cat->renameCategory($cat_name); > > ?> > > > My question is: > > How can I call a class within another class and do something with it? Right > now I'm doing it the most convenient way I know, which is including other > classes using the include() function within the methods of the > category.class. There is no multiple-inheritance allowed in PHP, so I can > only use inheritance on one class.
Including new classes within the existing classes is not such a bad idea as it ensures you to have only the necessary classes called.
> I am also extremely skeptical about creating too many classes at a time in > one script. Do the above examples degrade performance speed of the script > when I call too many classes? Also, isn't there a way to use sessions to > save created classes and then use them again for other scripts without the > need to make a new instance of the same class again and again?
yes, you can serialize/unserialize classes into the sessions. This makes it a little more complicated, but can be helpful sometimes.
> I am really looking for a better way to organize my code while still being > able to use these classes whenever I need them and at the same time keeping > the category.php file clean and easy to read. Is there a tutorial on how to > organize code? I'm not looking for html template tutorials. Just how to get > around inheritance limits while still keeping performance and clean-code in > mind.
You know what I have once done? I created a file with functions that return you the object pointers. It would create (declare) the class whenever it was not declared before or just return the pointer from a global variable if it was declared before. That way, you only load a few functions, and whenever you need a class you assign a variable to the function's return to have the class. This limits you script to only classes you use and no includes within the script itself. A kind of silly method, but can be easy to work with.
Also, check out the new Zend 2 engine, it has tons of improvements with classes for PHP5. Currently the code is in CVS (checkout php5 module). Changes are listed here:
http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES
-- Maxim Maletsky maximphp.net
attached mail follows:
On Tue, 28 Jan 2003 16:20:20 +0100, Maxim Maletsky wrote:
>
I use PHP classes extensively and very often use classes within other classes.
First off, I would make sure to take advantage of inheritence as much as possible. I have heirarchies up to 4 deep for some of my classes depending on how much specialization I need while at the same time maintaining only one set of code for functionality common to all subclasses.
As for using classes within classes, I don't include the classes within a class definition nor within a method def. I include the class def in the class file but outside the actual class {} statement.
When I instantiate the class, if I will need the object ref to pass to other classes or to other methods within the calling class, I assign the initial object instantiation to a class variable. That way any class methods can have ready access to that class via the ojbect reference stored in the class variable.
Only when I know for sure that the use of a class will be for one purpose do I include and instantiate within a method.
as always, YMMV depending on the structure of your project.
NOTE: There is a set of new PHP functions that allow a sort of dynamic multiple inheritence. You can look here for info:
http://www.php.net/manual/en/ref.objaggregation.php
Jeff
> "
Nilaab" <superbus22
attbi.com> wrote... :
>
>> Hello everyone,
>>
>> I want to be able to use objects to create my future pages. My goal is
>> to use methods of classes to make the original front-line script easier
>> to read, while all the processing is done with a simple call to the
>> different classes from a single class. Please read futher, as I'll get
>> to a point and to my question...
>>
>> I have many classes that do different tasks, like formValidator.class,
>> stringManipulator.class, db.class, fileManipulation.class,
>> template.class, etc (these are self-explanitory as their names suggest).
>> Then, I might have a class called category.class that adds, deletes,
>> edits, moves, and renames categories within the filesystem and database.
>> But I would have a front-line script called category.php that would call
>> the necessary methods of category.class at certain points, depending on
>> the task being done on a specific step.
>>
>> In other words I want category.class to call the other classes and do
>> something with them, then in turn I want category.php to call objects in
>> category.class for a specific task, such as:
>>
>> <?php
>>
>> // category.php
>>
>> include ("category.class");
>> $cat = new category ();
>> $cat->addCategory($new_cat_name);
>> // or
>> $cat->editCategory($cat_name);
>> // or
>> $cat->deleteCategory($cat_name);
>> // or
>> $cat->moveCategory($cat_name);
>> // or
>> $cat->renameCategory($cat_name);
>>
>> ?>
>>
>>
>> My question is:
>>
>> How can I call a class within another class and do something with it?
>> Right now I'm doing it the most convenient way I know, which is
>> including other classes using the include() function within the methods
>> of the category.class. There is no multiple-inheritance allowed in PHP,
>> so I can only use inheritance on one class.
>
> Including new classes within the existing classes is not such a bad idea
> as it ensures you to have only the necessary classes called.
>
>> I am also extremely skeptical about creating too many classes at a time
>> in one script. Do the above examples degrade performance speed of the
>> script when I call too many classes? Also, isn't there a way to use
>> sessions to save created classes and then use them again for other
>> scripts without the need to make a new instance of the same class again
>> and again?
>
> yes, you can serialize/unserialize classes into the sessions. This makes
> it a little more complicated, but can be helpful sometimes.
>
>> I am really looking for a better way to organize my code while still
>> being able to use these classes whenever I need them and at the same
>> time keeping the category.php file clean and easy to read. Is there a
>> tutorial on how to organize code? I'm not looking for html template
>> tutorials. Just how to get around inheritance limits while still keeping
>> performance and clean-code in mind.
>
> You know what I have once done? I created a file with functions that
> return you the object pointers. It would create (declare) the class
> whenever it was not declared before or just return the pointer from a
> global variable if it was declared before. That way, you only load a few
> functions, and whenever you need a class you assign a variable to the
> function's return to have the class. This limits you script to only
> classes you use and no includes within the script itself. A kind of silly
> method, but can be easy to work with.
>
>
> Also, check out the new Zend 2 engine, it has tons of improvements with
> classes for PHP5. Currently the code is in CVS (checkout php5 module).
> Changes are listed here:
>
> http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES
>
>
> --
> Maxim Maletsky
> maxim
php.net
attached mail follows:
Be careful with aggregation, it is REALLY unstable in PHP 4.3.0. I get crashes of PHP left and right, when changing the most random things (like adding a comment in another part of the code separate from aggregation!!)
Greg
-- phpDocumentor http://www.phpdoc.org"Jeff Warrington" <jaydub2099
yahoo.com> wrote in message news:pan.2003.01.28.20.31.47.905478
yahoo.com... > On Tue, 28 Jan 2003 16:20:20 +0100, Maxim Maletsky wrote: > > > > > I use PHP classes extensively and very often use classes > within other classes. > > First off, I would make sure to take advantage of inheritence > as much as possible. I have heirarchies up to 4 deep for > some of my classes depending on how much specialization > I need while at the same time maintaining only one set > of code for functionality common to all subclasses. > > As for using classes within classes, I don't include > the classes within a class definition nor within > a method def. I include the class def in the class > file but outside the actual class {} statement. > > When I instantiate the class, if I will need the object > ref to pass to other classes or to other methods within > the calling class, I assign the initial object > instantiation to a class variable. That way any class > methods can have ready access to that class via the > ojbect reference stored in the class variable. > > Only when I know for sure that the use of a class will > be for one purpose do I include and instantiate within > a method. > > as always, YMMV depending on the structure of your project. > > NOTE: There is a set of new PHP functions that allow > a sort of dynamic multiple inheritence. You can look > here for info: > > http://www.php.net/manual/en/ref.objaggregation.php > > Jeff > > > > > "
Nilaab" <superbus22
attbi.com> wrote... : > > > >> Hello everyone, > >> > >> I want to be able to use objects to create my future pages. My goal is > >> to use methods of classes to make the original front-line script easier > >> to read, while all the processing is done with a simple call to the > >> different classes from a single class. Please read futher, as I'll get > >> to a point and to my question... > >> > >> I have many classes that do different tasks, like formValidator.class, > >> stringManipulator.class, db.class, fileManipulation.class, > >> template.class, etc (these are self-explanitory as their names suggest). > >> Then, I might have a class called category.class that adds, deletes, > >> edits, moves, and renames categories within the filesystem and database. > >> But I would have a front-line script called category.php that would call > >> the necessary methods of category.class at certain points, depending on > >> the task being done on a specific step. > >> > >> In other words I want category.class to call the other classes and do > >> something with them, then in turn I want category.php to call objects in > >> category.class for a specific task, such as: > >> > >> <?php > >> > >> // category.php > >> > >> include ("category.class"); > >> $cat = new category (); > >> $cat->addCategory($new_cat_name); > >> // or > >> $cat->editCategory($cat_name); > >> // or > >> $cat->deleteCategory($cat_name); > >> // or > >> $cat->moveCategory($cat_name); > >> // or > >> $cat->renameCategory($cat_name); > >> > >> ?> > >> > >> > >> My question is: > >> > >> How can I call a class within another class and do something with it? > >> Right now I'm doing it the most convenient way I know, which is > >> including other classes using the include() function within the methods > >> of the category.class. There is no multiple-inheritance allowed in PHP, > >> so I can only use inheritance on one class. > > > > Including new classes within the existing classes is not such a bad idea > > as it ensures you to have only the necessary classes called. > > > >> I am also extremely skeptical about creating too many classes at a time > >> in one script. Do the above examples degrade performance speed of the > >> script when I call too many classes? Also, isn't there a way to use > >> sessions to save created classes and then use them again for other > >> scripts without the need to make a new instance of the same class again > >> and again? > > > > yes, you can serialize/unserialize classes into the sessions. This makes > > it a little more complicated, but can be helpful sometimes. > > > >> I am really looking for a better way to organize my code while still > >> being able to use these classes whenever I need them and at the same > >> time keeping the category.php file clean and easy to read. Is there a > >> tutorial on how to organize code? I'm not looking for html template > >> tutorials. Just how to get around inheritance limits while still keeping > >> performance and clean-code in mind. > > > > You know what I have once done? I created a file with functions that > > return you the object pointers. It would create (declare) the class > > whenever it was not declared before or just return the pointer from a > > global variable if it was declared before. That way, you only load a few > > functions, and whenever you need a class you assign a variable to the > > function's return to have the class. This limits you script to only > > classes you use and no includes within the script itself. A kind of silly > > method, but can be easy to work with. > > > > > > Also, check out the new Zend 2 engine, it has tons of improvements with > > classes for PHP5. Currently the code is in CVS (checkout php5 module). > > Changes are listed here: > > > > http://cvs.php.net/co.php/ZendEngine2/ZEND_CHANGES > > > > > > -- > > Maxim Maletsky > > maxim
php.net >
attached mail follows:
It's easy to do with JavaScript. Client will only have to confirm. Sometimes, in PDF nor even confirming is necessary. Not sure if what I said makes sense.
-- Maxim Maletsky maximphp.net
"Shaun van den Berg" <shaun
novtel.co.za> wrote... :
> Hey, > > Is there a way in php to print to a printer? say i have a order from , when > someone clicks the submit button - then print the form plus the entered > details to a page ? > > Thanks for you help > > Shaun > > -- > Novtel Consulting > Tel: +27 21 9822373 > Fax: +27 21 9815846 > Please visit our website: > www.novtel.co.za > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Don't the current PHP extensions have a good example there? It's pretty much easy to understand reading the code.
-- Maxim Maletsky maximphp.net
"Olga Tonkonog" <olga.tonkonog
caatoosee.com> wrote... :
> Hello ! > > I write extension for PHP. I create bibliothek for Windows and for Linux. > I set switch ZTS for thread-safety in Windows and use project php4ts. > How can I set thread-safety for Linux? Help!! > > Thank you at advance > > Olga > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Using a fairly simple fsockopen and POST I'm sending form data to a script which populates fields in a database. Everything works fine, however I've been trying to figure out how to send a value set on the other machine (database) back through the open socket (note: not the return value usually retrieved by fgets($fp etc...) which is then available to the sending machine. Searching via Google hasn't given me an answer.
Is it possible? Can somebody help? Syntax would be very nice, I'm not a PHP guru.
TIA, Paul
attached mail follows:
At 01:38 29-1-03, you wrote: >Using a fairly simple fsockopen and POST I'm sending form data to a script >which populates fields in a database. Everything works fine, however I've >been trying to figure out how to send a value set on the other machine >(database) back through the open socket (note: not the return value >usually retrieved by fgets($fp etc...) which is then available to the >sending machine. Searching via >Google hasn't given me an answer. > >Is it possible? Can somebody help? Syntax would be very nice, I'm not a >PHP guru. i never did use fsockopen, but reading a bit in the online user-annotated manual (http://www.php.net/manual/en/function.fsockopen.php) i found this link that may help you on the sending side: http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51
On the receiving side, if we're talking POST, then you HAVE to be aware of the change in handling them since PHP 4.10, before this version you could just try to read the POST variable directly, e.g. Name went to $Name, or better $HTTP_POST_VARS['Name']. But since then it is recommended to read it through $_POST['Name']. The old way only works if you set register_globals on in the php.ini file, if i remember well.
Unfortunately for you i only have a Dutch link to explain this better.
attached mail follows:
--- Paul <pauljwj
earthlink.net> wrote:
> Using a fairly simple fsockopen and POST I'm sending
> form data to a script which populates fields in a
> database. Everything works fine, however I've been
> trying to figure out how to send a value set on the
> other machine (database) back through the open socket
> (note: not the return value usually retrieved by
> fgets($fp etc...) which is then available to the
> sending machine. Searching via Google hasn't given me
> an answer.
>
> Is it possible? Can somebody help? Syntax would be very
> nice, I'm not a PHP guru.
Anything that the receiving Web server outputs is sent back to you just as it would be a Web browser. So, you can read this data just as if from a file (which is why fsockopen is so convenient). Thus, just echo whatever you want to send back.
You make a statement that is very conflicting:
> I've been trying to figure out how to send a value set > on the other machine (database) back through the open > socket (note: not the return value usually retrieved > by fgets($fp etc...)
So, you want to send data "back through the open socket", but you do not want read this data from the socket. I think you have a misunderstanding here somewhere that will make things difficult for you. What fgets() gives you *is* the data sent from the remote server.
If you want to pass data back in a manageable way, you will probably want to output XML, because that is easier and more reliable to parse than HTML.
Chris
attached mail follows:
Okay, some clarification. I do indeed want to read what I get back from the socket. Using fgets($fp, 1024) on the sending side (where the socket is opened and the data sent) and return = $variable on the other end (oh yes, the variable has a value as of the return), all I ever get back is 'HTTP 1.1' exactly, or nothing at all in the return value. Can you fill me in on the syntax here? How would you write the fgets statement and how would you define and populate the return value on the other end?
Chris wrote:
--- Paul <pauljwj
earthlink.net> wrote:
>> Using a fairly simple fsockopen and POST I'm sending >> form data to a script which populates fields in a >> database. Everything works fine, however I've been >> trying to figure out how to send a value set on the >> other machine (database) back through the open socket >> (note: not the return value usually retrieved by >> fgets($fp etc...) which is then available to the >> sending machine. Searching via Google hasn't given me >> an answer. >> >> Is it possible? Can somebody help? Syntax would be very >> nice, I'm not a PHP guru.
Anything that the receiving Web server outputs is sent back to you just as it would be a Web browser. So, you can read this data just as if from a file (which is why fsockopen is so convenient). Thus, just echo whatever you want to send back. You make a statement that is very conflicting:
>> I've been trying to figure out how to send a value set >> on the other machine (database) back through the open >> socket (note: not the return value usually retrieved >> by fgets($fp etc...)
So, you want to send data "back through the open socket", but you do not want read this data from the socket. I think you have a misunderstanding here somewhere that will make things difficult for you. What fgets() gives you *is* the data sent from the remote server.
attached mail follows:
--- Paul <pauljwj
earthlink.net> wrote:
> Can you fill me in on the syntax here? How would you
> write the fgets statement and how would you define
> and populate the return value on the other end?
Maybe this example will help. This searches PHP's site for curl, outputting the HTTP content to the screen. When you are making a socket connection like this, you get the whole HTTP response, not just the content. This example uses an explode() to separate headers from content, which isn't very safe (if the content contains \r\n somewhere, it screws up), but it will probably work for you:
<base href="http://www.php.net/">
<? $content = php_post("www.php.net", "/search.php", "lang=en_US&pattern=curl&show=manual"); echo $content;
function php_post($host, $path, $data) { $http_response="";
$fp=fsockopen($host, 80); fputs($fp, "POST $path HTTP/1.1\r\n"); fputs($fp, "Host: $host\r\n"); fputs($fp, "Content-Type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-Length: " . strlen($data)."\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, "$data"); while(!feof($fp)) { $http_response.=fgets($fp, 128); } fclose($fp);
list($http_headers, $http_content) = explode("\r\n\r\n", $http_response);
# This only returns the content - modify if you want to also return the headers return $http_content; } ?>
Chris
attached mail follows:
Thanks, problem solved!
I moved the hidden-vars inside a td-tag and the problem was no more.
Lars
"Lars Espelid" <lars_espelid
hotmail.com> skrev i melding
news:20030128022454.77851.qmail
pb1.pair.com...
> Hello,
>
> I present some content of a mysql-table in an html-table. When the query
> which collects the content contains few rows I get the amount of space I
> want between the output and the above content. But when I get for instance
> 60 rows, the printed result jumps down about 7 lines. I would like to have
> the same small gap between the result of the query and the above content.
>
> The code is as follows:
>
> ......snip.........
>
> <table width="100%" cellpadding="0" class="alle">
> <tr>
> <td> <strong><?php echo $row_Recordset1['mModell']; ?></strong>
> </td>
> <td align="right"> </td>
> </tr>
>
> <tr>
> <td colspan="2">
> <?php
> //checks if there exists any rows
> if($totalRows_Recordset1 > 0) {
> ?>
>
> <table width="70%" border="0">
> <tr>
> ..........around here the printed result jumps many rows down
> <td><strong>Kontonr.</strong></td>
> <td><strong>Delkontonr.</strong></td>
> <td><strong>Tekst</strong></td>
> <td><strong>Kostnad</strong></td>
> <td><strong>Enhet</strong></td>
> </tr>
> <tr><td colspan="5"></td></tr>
> <?php do {
> $kontonr = $row_Recordset1['mKontonr'];
> $delkontonr = $row_Recordset1['mDelkontonr'];
> if ($delkontonr == 0) { $strong = '<strong>'; $strong2 =
> '</strong>'; }
> else { $strong = ''; $strong2 = ''; }
> ?>
> <tr>
> <td><?php echo $strong .
> fjern_null($row_Recordset1['mHovedkonto']) . $strong2; ?></td>
> <td><?php echo $strong .
> $row_Recordset1['mDelkontonr'] . $strong2; ?></td>
> <td><?php echo $strong .
> $row_Recordset1['mKontotekst'] . $strong2; ?></td>
> <td><?php echo $strong .
> fjern_null($row_Recordset1['mKostnad']) . $strong2; ?></td>
> <td><?php echo $strong . $row_Recordset1['mEnhet'] .
> $strong2; ?></td>
> </tr>
> <!--<input name="modell" type="hidden" value="<?php
> //echo $modell; ?>">-->
> <input name="modellId" type="hidden" value="<?php echo
> $row_Recordset1['modellId']; ?>">
> <?php } while ($row_Recordset1 =
> mysql_fetch_assoc($Recordset1)); ?>
> </table>
>
>
>
> <?php
> } //if($totalRows_Recordset1 > 0) {
> ?>
> </td>
> </tr>
> </table>
>
> ...... and so on ............
>
>
> When the query returns 60 rows I get ca. 7 blank lines between <?php echo
> $row_Recordset1['mModell']; ?> and Kontonr.
>
> Does anyone understand? Anyone have a tip?
>
> Thanks a lot!
>
> Lars
>
>
attached mail follows:
I need to use regular expressions, but i found that the current Perl-compaitable API unuseful in my case, infact i need to get the positions of every match to the pattern and i found nothing in the Manual that does so, does any one know a way to do this (the only one i found is specific to PHP 4.3.0)
Thanx in advance :)
Regards, Khalid Al-Kary.
_________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus
attached mail follows:
> I need to use regular expressions, but i found that the current > Perl-compaitable API unuseful in my case, infact i need to get the positions > of every match to the pattern and i found nothing in the Manual that does > so, does any one know a way to do this (the only one i found is specific to > PHP 4.3.0)
You could match all of the strings and then use one of the other string functions to find the position.
---John Holmes...
attached mail follows:
using any of the string functions on the output would ofcourse cause a performance drawback (do you agree with me?), i had used a combination of string functions to do instead of regexps, which one will be faster as you think ?
where can i suggest such a function on the current regexps API ?
Thanx, Khalid Al-Kary
_________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
attached mail follows:
> using any of the string functions on the output would ofcourse cause a > performance drawback (do you agree with me?), i had used a combination of > string functions to do instead of regexps, which one will be faster as you > think ?
It depends on exactly what your doing, how much text you have, and why you need to match the position as well as the text.
> where can i suggest such a function on the current regexps API ?
I don't know.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/
attached mail follows:
>using any of the string functions on the output would ofcourse > cause a performance drawback (do you agree with me?), i had > used a combination of string functions to do instead of regexps, > which one will be faster as you think ?
Hi,
i made some basic bench and see that it really depends...
try to make some basic search like ^[0-9]{1,4}$ how can u do this ? with substr, strlen, strstr and ifthenelse ? i found really faster to use preg_match(), which is really faster than if (ereg())...
attached mail follows:
Good day,
This is a bit off-topic for the list, but, I'm not sure where else I can send this.
The "search" function on php.net appears to be broken. One can search through the function list, but any query via "whole site" or "online documentation" returns no results.
I tried to send a message to webmaster
php.net, the address posted on the
site for this sort of thing. However, my message eventually bounces back to
me, with the php.net qmail deamon stating that it can not confirm that my
address was valid. I presume that there is some sort of system that replies
to me to confirm that my return address is valid, but this also appears to
be broken, as no such e-mail is ever received.
If anyone can pass this along, or even suggest where this could be sent, that would be great. This problem has been present for a couple of weeks now, at least.
Thanks,
============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948
attached mail follows:
Hi all: I filled a bug today that quickly got resolved invalid, but I think it deserves another look. I had a bit of a problem today with "." getting converted to "_" for my variable names automatically. I have been told that this was because if you have register_globals on, then you can't have a variable with a . in its name. Fair enough. However, since that's now considered to be bad practice, it would make sense to me that this "feature" get another look. I can see no logical reason to not allow . in the global $_POST variable... Basically, what I'd like is to be able to post a form element with id="myvariable.whatever" and access it on the next page with $_POST["myvariable.whatever"]. Comments are appreciated. Mike
attached mail follows:
Well I think using periods in variable names in general is a no-no, but other then being a little out-of-the-norm I see no reason why you shouldn't be allowed to.
P.S. OEOne is sweeeeet software, good job.
On Tue, 2003-01-28 at 13:50, Mike Potter wrote:
Hi all: I filled a bug today that quickly got resolved invalid, but I think it deserves another look. I had a bit of a problem today with "." getting converted to "_" for my variable names automatically. I have been told that this was because if you have register_globals on, then you can't have a variable with a . in its name. Fair enough. However, since that's now considered to be bad practice, it would make sense to me that this "feature" get another look. I can see no logical reason to not allow . in the global $_POST variable... Basically, what I'd like is to be able to post a form element with id="myvariable.whatever" and access it on the next page with $_POST["myvariable.whatever"]. Comments are appreciated. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- Adam Voigt (adamcryptocomm.com) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQA+NtG9F9k9BmZXCWYRAhV7AJ48d7jpvOFKdlxLab/GR+Lk6/0h+ACeP1M6 5yyN7rcCdFlOL2qlpi0F3pc0M -----END PGP SIGNATURE-----
attached mail follows:
On Tue, 28 Jan 2003, Mike Potter wrote:
> sense to me that this "feature" get another look. I can see no logical > reason to not allow . in the global $_POST variable... > Basically, what I'd like is to be able to post a form element with > id="myvariable.whatever" and access it on the next page with > $_POST["myvariable.whatever"].
Here's just one of many good reasons ...
// obviously this is some busted garbage $name.Array["first"]="Chris"; $name.Array["last"]="Wesley"; $name=$name.Array["first"]." ".$name.Array["last"];
// and this is not $name_Array["first"]="Chris"; $name_Array["last"]="Wesley"; $name=$name_Array["first"]." ".$name_Array["last"];
You'd make both your Lex and your Yacc puke while parsing the first one ;)
~Chris
attached mail follows:
> > sense to me that this "feature" get another look. I can see no logical > > reason to not allow . in the global $_POST variable... > > Basically, what I'd like is to be able to post a form element with > > id="myvariable.whatever" and access it on the next page with > > $_POST["myvariable.whatever"]. > > Here's just one of many good reasons ... > > // obviously this is some busted garbage > $name.Array["first"]="Chris"; > $name.Array["last"]="Wesley"; > $name=$name.Array["first"]." ".$name.Array["last"];
That assumes register_globals is ON, though, which isn't recommended. If you read the questions, the poster talks about using the value such as $_POST['name.Array'], which is valid. Since it's encouraged to have register globals OFF, I think they should do aways with this period to underscore thing, also. It will only jack up people's code that rely on register_globals and they should be changing it anyhow.
---John Holmes...
attached mail follows:
On Tue, 28 Jan 2003, 1LT John W. Holmes wrote:
> > > Basically, what I'd like is to be able to post a form element with > > > id="myvariable.whatever" and access it on the next page with > > > $_POST["myvariable.whatever"]. > > > > // obviously this is some busted garbage > > $name.Array["first"]="Chris"; > > $name.Array["last"]="Wesley"; > > $name=$name.Array["first"]." ".$name.Array["last"]; > > That assumes register_globals is ON, though, which isn't recommended. If you > read the questions, the poster talks about using the value such as
There aren't two different lexigraphical parsers if you turn register_globals on or off. So, PHP either allows ALL variables to have a "." in their name, or disallow it altogether. So, moving outside of the narrow case of POST variable names is what I did *after thoroughly reading and thinking about the question*. (Somebody missed the Lex & Yacc hint.)
> $_POST['name.Array'], which is valid. Since it's encouraged to have register > globals OFF, I think they should do aways with this period to underscore > thing, also. It will only jack up people's code that rely on > register_globals and they should be changing it anyhow.
As long as it's possible to turn register_globals on, this will have to be a problem. I'd vote for tearing this bandaid off, getting rid of register_globals altogether, and undo all the idiosyncrasies it causes, but that's just me (and others who think similarly).
~Chris
attached mail follows:
> > > > Basically, what I'd like is to be able to post a form element with > > > > id="myvariable.whatever" and access it on the next page with > > > > $_POST["myvariable.whatever"]. > > > > > > // obviously this is some busted garbage > > > $name.Array["first"]="Chris"; > > > $name.Array["last"]="Wesley"; > > > $name=$name.Array["first"]." ".$name.Array["last"]; > > > > That assumes register_globals is ON, though, which isn't recommended. If you > > read the questions, the poster talks about using the value such as > > There aren't two different lexigraphical parsers if you turn > register_globals on or off. So, PHP either allows ALL variables to have a > "." in their name, or disallow it altogether. So, moving outside of the > narrow case of POST variable names is what I did *after thoroughly reading > and thinking about the question*. (Somebody missed the Lex & Yacc hint.)
I'm not familar with the core code of PHP at all, but what would happend if this "feature" was just disabled? For everyone with rg OFF, it wouldn't affect them, right? If rg is ON and you never use a period in a variable name, then it shouldn't affect you either, right? What is someone actually did, though? Would it cause PHP to shit itself or just make a weird variable name? My point was that who cares what it does, because it's only going to affect people with rg ON, anyhow, that try using a period, right?
> > $_POST['name.Array'], which is valid. Since it's encouraged to have register > > globals OFF, I think they should do aways with this period to underscore > > thing, also. It will only jack up people's code that rely on > > register_globals and they should be changing it anyhow. > > As long as it's possible to turn register_globals on, this will have to be > a problem. I'd vote for tearing this bandaid off, getting rid of > register_globals altogether, and undo all the idiosyncrasies it causes, > but that's just me (and others who think similarly).
Yeah, I agree, but we both know that won't happen for a while.
---John Holmes...
attached mail follows:
Regarding keeping . as . and not _ in variables:
This isn't going to happen as it seriously breaks BC. This also would affect functions such as import_request_variables() and extract(). There is no worthy benefit here, this will never happen.
Regards, Philip
attached mail follows:
Hello,
I have figured out how to connect it, I think
But now I get this error
attached mail follows:
I have it connected, now I am getting the following error
Warning: SQL error: , SQL state 00000 in SQLConnect in c:\program files\apache group\apache\htdocs\test.php on line 7
Any ideas?
attached mail follows:
On Tuesday 28 January 2003 23:11, Todd Barr wrote: > I have it connected, now I am getting the following error > > Warning: SQL error: , SQL state 00000 in SQLConnect in c:\program > files\apache group\apache\htdocs\test.php on line 7
What are you doing on line 7? What did you do on the lines 1-6? Sorry for the question, but my gem is broken...
johannes
attached mail follows:
that means there's an error in your sql, what's the sql your using. Best Wishes
Paul Roberts
mail
paul-roberts.com
++++++++++++++++++++++++
----- Original Message -----
From: "Johannes Schlueter" <php
schlueters.de>
To: "Todd Barr" <tbarr
geo-imaging.com>; <php-general
lists.php.net>
Sent: Tuesday, January 28, 2003 7:25 PM
Subject: Re: [PHP] MS Access
On Tuesday 28 January 2003 23:11, Todd Barr wrote: > I have it connected, now I am getting the following error > > Warning: SQL error: , SQL state 00000 in SQLConnect in c:\program > files\apache group\apache\htdocs\test.php on line 7
What are you doing on line 7? What did you do on the lines 1-6? Sorry for the question, but my gem is broken...
johannes
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I was just checking to see if the connection was working This one lacked a sql statment
----- Original Message -----
From: "Paul Roberts" <mail
paul-roberts.com>
To: "Todd Barr" <tbarr
geo-imaging.com>; <php-general
lists.php.net>
Sent: Tuesday, January 28, 2003 11:57 AM
Subject: Re: [PHP] MS Access
that means there's an error in your sql, what's the sql your using. Best Wishes
Paul Roberts
mail
paul-roberts.com
++++++++++++++++++++++++
----- Original Message -----
From: "Johannes Schlueter" <php
schlueters.de>
To: "Todd Barr" <tbarr
geo-imaging.com>; <php-general
lists.php.net>
Sent: Tuesday, January 28, 2003 7:25 PM
Subject: Re: [PHP] MS Access
On Tuesday 28 January 2003 23:11, Todd Barr wrote: > I have it connected, now I am getting the following error > > Warning: SQL error: , SQL state 00000 in SQLConnect in c:\program > files\apache group\apache\htdocs\test.php on line 7
What are you doing on line 7? What did you do on the lines 1-6? Sorry for the question, but my gem is broken...
johannes
-- 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
attached mail follows:
I am currently trying to create a .htpasswd file for apache using PHP and the crypt() on Win2k. I can generate the file alright but it does not work. I have looked into some classes as well and all use the crypt() function. The reason for this not working is probably the algorithm used because the passwords within a .htpasswd created with apache looks a hell lot different using something like
$apr1$rB2.....$8iUWArWEsTQ2553kjk22NS1 (not a real password by the way)
anyone having experience with that? Something up because I use windows?
Dominik Wittenbeck
----------------------------------------------------------------
E-Mail: webmaster
developaz.com
URL: http://www.developaz.com
attached mail follows:
I know its stupid but i´ve been writing a site for a register_globals = on enviroment now i need to convert all the code to an off setting
the page is built by sending a whole lot off vars to diferent pages. as you can see below the hyperlink sends the id var to the same page and then echos the code. can anyone help humpty dumpty?
<font size="2"><a href="left.php?id=1" target="_self">Finansiering</a><BR> <? If($id==1){ echo "<a href=info/leas.htm target=\"mainFrame\"><font color=\"#00CCCC\">Leasing</font></a><BR> <a href=info/avb.htm target=\"mainFrame\"><font color=\"#00CCCC\">Räntefri avbet.</font></a><BR> <a href=info/stul.htm target=\"mainFrame\"><font color=\"#00CCCC\">Studentlån</font></a><BR>"; }; ?>
attached mail follows:
I would try something like this instead:
$params = escapeshellarg($params); $output = system(c:\path\to\htpasswd $params); //check for output errors or what not
There very well could be a better solution (especially since I have not tried the above code...).
I remember seeing somewhere that the crypt algorithms are different for Apache and PHP on Win32.
-Dash
Cleanliness is next to impossible.
On Tue, 28 Jan 2003, Dominik Wittenbeck wrote:
> I am currently trying to create a .htpasswd file for apache using PHP and
> the crypt() on Win2k. I can generate the file alright but it does not work.
> I have looked into some classes as well and all use the crypt() function.
> The reason for this not working is probably the algorithm used because the
> passwords within a .htpasswd created with apache looks a hell lot different
> using something like
>
> $apr1$rB2.....$8iUWArWEsTQ2553kjk22NS1 (not a real password by the way)
>
> anyone having experience with that? Something up because I use windows?
>
> Dominik Wittenbeck
> ----------------------------------------------------------------
> E-Mail: webmaster
developaz.com
> URL: http://www.developaz.com
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
Hi I have a rather annoying problem regarding forms. I have built an app that allows the users to fill in a rather large form (much like a claim form) and then have the data pumped into a mysql db. The problem is: the users want to be able to "save" their forms on their systems as a) backup/proof that they have filled it in and b) for their records for future use and c) the hope is that it would also allow for a reliable method to complete the form off-line and then submit it when online again.
So, I'm not sure what the best way is to tackle this situation. My gutt says it would need some kind of client stand alone app, but I wouldn't want to go there unless I am proven beyond reasonable doubt that it is the only way.
The users are mostly in computer limbo, and if they had their way, they would want to use "Word or Excel" to complete the forms, save it to their hard drive and "click to send it away"...
Help!, Please?!
attached mail follows:
Hi Bryan
Thanks for the suggestions.
Can you elaborate on the pdf option? Wouldn't that mean the users would
need a copy of adobe acrobat writer?
On Tue, 2003-01-28 at 21:53, Bryan Brannigan wrote:
> 3 choices as I see it..
>
> a) create a PDF for download
> b) let the users create the form in Excel and then figure out a way to
> import that into your database using a webapp
> c) client side app :(
>
> > -----Original Message-----
> > From: Petre Agenbag [mailto:internet
vsa.co.za]
> > Sent: Tuesday, January 28, 2003 2:35 PM
> > To: php-general
lists.php.net
> > Subject: [PHP] best way to save form data on user side
> >
> >
> > Hi
> > I have a rather annoying problem regarding forms.
> > I have built an app that allows the users to fill in a rather
> > large form
> > (much like a claim form) and then have the data pumped into a
> > mysql db.
> > The problem is: the users want to be able to "save" their
> > forms on their
> > systems as a) backup/proof that they have filled it in and b)
> > for their
> > records for future use and c) the hope is that it would also
> > allow for a
> > reliable method to complete the form off-line and then submit it when
> > online again.
> >
> > So, I'm not sure what the best way is to tackle this
> > situation. My gutt
> > says it would need some kind of client stand alone app, but I wouldn't
> > want to go there unless I am proven beyond reasonable doubt that it is
> > the only way.
> >
> > The users are mostly in computer limbo, and if they had their
> > way, they
> > would want to use "Word or Excel" to complete the forms, save it to
> > their hard drive and "click to send it away"...
> >
> > Help!, Please?!
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
attached mail follows:
> I have a rather annoying problem regarding forms. > I have built an app that allows the users to fill in a rather large form > (much like a claim form) and then have the data pumped into a mysql db. > The problem is: the users want to be able to "save" their forms on their > systems as a) backup/proof that they have filled it in and b) for their > records for future use and c) the hope is that it would also allow for a > reliable method to complete the form off-line and then submit it when > online again.
Saving the form would be useless because how would you ever know if they really submitted it or not?
It seems like the easiest thing to do would be to show them a "confirmation" page that says "your claim has been accepted" and here is the data you submitted. "Save or print this page for your records" like you see on many other systems.
Would that work?
I guess it wouldn't do anything for option C above, but that option is always present unless you're using some kind of timeout feature?
---John Holmes...
attached mail follows:
--- Petre Agenbag <internet
vsa.co.za> wrote:
> I have a rather annoying problem regarding forms.
> I have built an app that allows the users to fill
> in a rather large form (much like a claim form)
> and then have the data pumped into a mysql db.
> The problem is: the users want to be able to
> "save" their forms on their systems as a)
> backup/proof that they have filled it in and b)
> for their records for future use and c) the hope
> is that it would also allow for a reliable method
> to complete the form off-line and then submit it
> when online again.
Well, this sounds like a bad idea in general, but if you have no choice in the matter, I suppose cookies can fulfill the need.
Anything you implement like this is going to lessen the security of the data, because rather than the client sending it to you once, you are going to expose it over the Internet several times. If this risk is acceptable for whatever reason, then cookies are probably no less secure for this data than anything else.
Normally, I would highly recommend *not* storing client data on cookies, because that opens you up to several types of attacks, but you can accomplish what you want to do with this method. Only "punish" those who want this feature by setting these cookies only for those who choose to save this data locally. You could help the situation by encrypting the data in your cookies, so that only presentation attacks are a concern, but your users wouldn't be able to easily look at their data as verification of anything.
My recommendation is to leverage your position as the technical expert to advise a more proper solution, one that you agree to, not them. They should not be consulted regarding application design unless they have experience with it. Rather, they should be describing their needs and let you (or the technical lead / project manager) do the technical design.
Good luck to you.
Chris
attached mail follows:
Hi Chris
On Tue, 2003-01-28 at 22:09, Chris Shiflett wrote:
> --- Petre Agenbag <internet
vsa.co.za> wrote:
> > I have a rather annoying problem regarding forms.
> > I have built an app that allows the users to fill
> > in a rather large form (much like a claim form)
> > and then have the data pumped into a mysql db.
> > The problem is: the users want to be able to
> > "save" their forms on their systems as a)
> > backup/proof that they have filled it in and b)
> > for their records for future use and c) the hope
> > is that it would also allow for a reliable method
> > to complete the form off-line and then submit it
> > when online again.
>
> Well, this sounds like a bad idea in general, but if you
> have no choice in the matter, I suppose cookies can fulfill
> the need.
>
> Anything you implement like this is going to lessen the
> security of the data, because rather than the client
> sending it to you once, you are going to expose it over the
> Internet several times.