|
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: Mon Jul 29 2002 - 10:03:22 CDT
php-general Digest 29 Jul 2002 15:03:22 -0000 Issue 1493
Topics (messages 110081 through 110184):
mod_php4.c errors on Apache Complie
110081 by: Peter
110087 by: David Robley
110090 by: Peter
Re: Table formatting
110082 by: César Aracena
110086 by: Jason Wong
110089 by: César Aracena
110096 by: Martin Towell
Nope it didn't work :(
110083 by: Deadsam
110147 by: Richard Lynch
PHP Acronym: What does it mean to you? http://phpacronym.coolfreepage.com
110084 by: SpamSucks86
Re: Oracle 8i SQL Problem..
110085 by: Nick Oostveen
110092 by: Martin Towell
110104 by: Rudolf Visagie
110140 by: Richard Lynch
Re: PHP Acronym: What does it mean to you?
110088 by: David Robley
Re: Logging out with authentication
110091 by: Chris Shiflett
110093 by: Ray Todd Stevens
110101 by: Peter Janett
110102 by: JJ Harrison
Reg-Vulnerabilities in PHP
110094 by: SenthilVelavan
110105 by: JJ Harrison
PHP + Form + Session Problem. Please help
110095 by: Wee Keat
110103 by: JJ Harrison
Re: need help with uploading images
110097 by: Tom Rogers
110144 by: Richard Lynch
Re: REGEX for credit card number
110098 by: Analysis & Solutions
110142 by: Richard Lynch
PHP-MySQL connection problem
110099 by: Manisha
110109 by: John Holmes
110148 by: Richard Lynch
libphp4.so
110100 by: Peter
110149 by: Richard Lynch
Reg patch for PHP4.0.6
110106 by: SenthilVelavan
110108 by: Manuel Lemos
Picking up Data of Previous Date from Table
110107 by: Thomas Edison Jr.
110179 by: Analysis & Solutions
Re: pdflib, NEED HELP with function problem (newby)
110110 by: Richard Lynch
Re: slow reading from socket
110111 by: Richard Lynch
Re: what is the .Xauthority file
110112 by: Richard Lynch
Re: Possible to have optional values in function?
110113 by: Richard Lynch
Re: phpinfo()
110114 by: Richard Lynch
Ming Sprite confusion
110115 by: Richard Lynch
110171 by: Rasmus Lerdorf
Re: PHP 4.2.2 and Apache LoadModule issue
110116 by: Richard Lynch
Re: Using cookies with PHP
110117 by: Richard Lynch
Re: my application is not able to communicate with qmail sever !
110118 by: Richard Lynch
Re: including just created file
110119 by: Richard Lynch
Re: How reliable is pcntl support?
110120 by: Richard Lynch
Re: Changing a variable's value when a link is clicked
110121 by: Richard Lynch
Re: php 4.2.2 on redhat 7.3
110122 by: Richard Lynch
Re: PostgreSQL
110123 by: Richard Lynch
110164 by: John Holmes
Re: Closing file pointer
110124 by: Richard Lynch
Re: PHP Integration...
110125 by: Richard Lynch
Re: filling an array(2)
110126 by: Richard Lynch
Re: PHP UPGRADE on LINUX
110127 by: Richard Lynch
Re: Red Hat 7.2 enabling MySQL on preinstalled PHP
110128 by: Richard Lynch
Re: calling user-defined php functions from <a href> tag
110129 by: Richard Lynch
110153 by: Brent Baisley
Re: portal / content management
110130 by: Richard Lynch
Re: File Browser like Win Explorer in php
110131 by: Richard Lynch
110165 by: Reuben D. Budiardja
Re: Pulling a data from array of checkboxes
110132 by: Richard Lynch
Re: Sending a File to User's Browser
110133 by: Richard Lynch
Re: Extra spacing with <br> in HTML
110134 by: Richard Lynch
110160 by: Kevin Breit
Re: php 'mail()' security
110135 by: Richard Lynch
Re: PHP/MySQL Search Engine Query Question
110136 by: Richard Lynch
Re: file_name
110137 by: Richard Lynch
Re: cant send data from a website to another
110138 by: Richard Lynch
Re: Help reg. create user and allocate space
110139 by: Richard Lynch
Re: Site Search
110141 by: Richard Lynch
Re: REGEX for phone #
110143 by: Richard Lynch
110167 by: Analysis & Solutions
Re: Adding slashes when magic quotes is off?
110145 by: Richard Lynch
Re: sessions and https
110146 by: Richard Lynch
ENCRYPT() in MySQL
110150 by: Justin French
slm
110151 by: TUBA UGRAS
Create a link where http://
110152 by: Jesse Lawrence
110154 by: lallous
110163 by: Analysis & Solutions
Re: Call func with variable num params (Dont confuse with making func variable params)
110155 by: Brent Baisley
PHP counterpart to 4GuysFromRolla?
110156 by: Paul Dionne
110157 by: lallous
110158 by: Jay Blanchard
110159 by: Jason Wong
Brain Fart- table formatting help
110161 by: Brian V Bonini
110162 by: Jay Blanchard
110173 by: Brian V Bonini
110175 by: John Holmes
110177 by: Jay Blanchard
Good books on sessions
110166 by: Petre
110172 by: Rasmus Lerdorf
inserting info into db
110168 by: Tyler Durdin
110169 by: lallous
110170 by: Reuben D. Budiardja
Patch 4.2.2
110174 by: Sonket
110176 by: Matt Babineau
110184 by: Sonket
PHP 4.2.2 & vpopmail
110178 by: Jakub Zawierucha
Dates and Date()
110180 by: Christopher J. Crane
110181 by: Rasmus Lerdorf
110182 by: Analysis & Solutions
110183 by: Andrey Hristov
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:
Howdy,
I've successfully complied PHP and the straight cigfiguration of apache
1.3.26 but when i go to configure php as a module in apache using
#./configure --enable-module=max --enable-shared=max --activate-module=src/m
odules/php4/libmodphp4.a
i get the following error
mod_php4.c:28:18: zend.h: No such file or directory
mod_php4.c:29:17: php.h: No such file or directory
mod_php4.c:30:27: php_variables.h: No such file or directory
mod_php4.c:47:21: php_ini.h: No such file or directory
mod_php4.c:48:25: php_globals.h: No such file or directory
mod_php4.c:49:18: SAPI.h: No such file or directory
mod_php4.c:50:22: php_main.h: No such file or directory
mod_php4.c:52:26: zend_compile.h: No such file or directory
mod_php4.c:53:26: zend_execute.h: No such file or directory
mod_php4.c:54:28: zend_highlight.h: No such file or directory
mod_php4.c:55:25: zend_indent.h: No such file or directory
mod_php4.c:57:39: ext/standard/php_standard.h: No such file or directory
In file included from mod_php4.c:61:
mod_php4.h:34: parse error before "zend_bool"
mod_php4.h:34: warning: no semicolon at end of struct or union
mod_php4.h:35: warning: data definition has no type or storage class
mod_php4.h:37: parse error before "apache_module_entry"
mod_php4.h:37: warning: data definition has no type or storage class
mod_php4.h:43: parse error before "php_apache_info"
mod_php4.h:43: warning: data definition has no type or storage class
mod_php4.c:67: parse error before "TSRMLS_DC"
mod_php4.c:70: parse error before "TSRMLS_DC"
mod_php4.c:71: warning: parameter names (without types) in function
declaration
mod_php4.c:72: parse error before '*' token
mod_php4.c:73: parse error before '*' token
mod_php4.c:90: parse error before "HashTable"
mod_php4.c:91: parse error before "HashTable"
mod_php4.c:92: parse error before "HashTable"
mod_php4.c:93: parse error before "HashTable"
mod_php4.c:94: parse error before "HashTable"
mod_php4.c:95: parse error before "HashTable"
mod_php4.c:127: parse error before "TSRMLS_DC"
.
.
.
.
does any one have any idea's on why it is and what i can do about it?
Cheers
Peter
"the only dumb question is the one that wasn't asked"
attached mail follows:
In article <DPEPKCNEFOKBCNNANCIPEEGACHAA.php
vfsa.com.au>, php
vfsa.com.au
says...
> Howdy,
>
> I've successfully complied PHP and the straight cigfiguration of apache
> 1.3.26 but when i go to configure php as a module in apache using
>
> #./configure --enable-module=max --enable-shared=max --activate-module=src/m
> odules/php4/libmodphp4.a
>
> i get the following error
>
> mod_php4.c:28:18: zend.h: No such file or directory
<SNIP more of the same>
>
> does any one have any idea's on why it is and what i can do about it?
I was under the (possibly wrong) understanding that .a libraries are
static, not dynamically loadable.
The way I usually get apache/php as a DSO is to compile apache first, with
--enable-modules=max --enable-shared=max blah blah whatever else you
need (but not -activate-module)
Then copmile php with whatever config options you need _and_
--with-apxs=/full/path/to/apxs
--with-apache-conf=/dir/where/your/apacheconf/files
Last config item might be slightly different - can't remember exactly :-)
Try ./configure --help |grep apache for the correct syntax.
Then when you do make install for php it will install libphp4.so in the
correct place and also amend your httpd.conf to activate php as DSO. The
nyou just (re)start apache and off you go.
Cheers
-- David Robley Temporary Kiwi!Quod subigo farinam
attached mail follows:
problem solved!!! thanks for your help Dave :D
Cheers Peter
> -----Original Message-----
> From: David Robley [mailto:robleyd
paradise.net.nz]
> Sent: Monday, 29 July 2002 2:02 PM
> To: php-general
lists.php.net
> Subject: [PHP] Re: mod_php4.c errors on Apache Complie
>
>
> In article <DPEPKCNEFOKBCNNANCIPEEGACHAA.php
vfsa.com.au>,
> php
vfsa.com.au
> says...
> > Howdy,
> >
> > I've successfully complied PHP and the straight cigfiguration of apache
> > 1.3.26 but when i go to configure php as a module in apache using
> >
> > #./configure --enable-module=max --enable-shared=max
> --activate-module=src/m
> > odules/php4/libmodphp4.a
> >
> > i get the following error
> >
> > mod_php4.c:28:18: zend.h: No such file or directory
> <SNIP more of the same>
> >
> > does any one have any idea's on why it is and what i can do about it?
>
> I was under the (possibly wrong) understanding that .a libraries are
> static, not dynamically loadable.
>
> The way I usually get apache/php as a DSO is to compile apache
> first, with
> --enable-modules=max --enable-shared=max blah blah whatever else you
> need (but not -activate-module)
>
> Then copmile php with whatever config options you need _and_
> --with-apxs=/full/path/to/apxs
> --with-apache-conf=/dir/where/your/apacheconf/files
>
> Last config item might be slightly different - can't remember exactly :-)
> Try ./configure --help |grep apache for the correct syntax.
>
> Then when you do make install for php it will install libphp4.so in the
> correct place and also amend your httpd.conf to activate php as DSO. The
> nyou just (re)start apache and off you go.
>
> Cheers
> --
> David Robley
> Temporary Kiwi!
>
> Quod subigo farinam
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I like this method a lot. Now, considering I do like FOR looping as a fact, how can I make a loop inside another loop. I mean, if I tell the first loop that $i=0 and then do the comparison and then add 1 to $i, in the inner or second loop should I state that $i=$i or what? Also make it $i=0???
Thanks, C.
> -----Original Message-----
> From: Chris Earle [mailto:chris
earleweb.com]
> Sent: Saturday, July 27, 2002 1:54 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: Table formatting
>
> You can do what he said or just put a separate loop inside the
original
> loop.
>
> Depending on how you get the info, you can use either way (his would
> create
> less overhead if you are just using the same <TD> info every row,
> otherwise
> they're really the same because his way you'll have to create an array
to
> access later for multiple rows, or just do my way and have the loop
access
> the NEXT *3* (or whatever) items ...).
>
> i.e.,
> for (LOOP FOR <TR>)
> {
> for (LOOP FOR <TD>) {}
> }
>
> "César aracena" <icaam
icaam.com.ar> wrote in message
> news:001a01c234f0$a5e8ad80$28ed0dd1
gateway...
> Hi all.
>
> Last nite I've came across a problem I wasn't able to figure out by my
> self. It's not difficult to make a loop that will make new *TABLE
ROWS*
> (<tr>) to show several DB objects in a nice way. what I need to do, is
> to display 2 or maybe even 3 of this objects stored in a DB per table
> row, separated in different *TABLE COLUMS* (<td>). how can I achieve
> this? What I usually do is:
>
> ------------------------------
> // DB QUERY
> $query = "SELECT * FROM table_name";
> $result = mysql_query($query) or die(mysql_error());
> $num_rows = mysql_num_rows($result);
>
> // NOW THE LOOP
> for ($i=0; $i<$num_rows; $i++)
> {
> $row = mysql_fetch_array($result);
> echo "<tr>";
> echo "<td>";
> echo $row[whatever];
> echo "</td>";
> echo "</tr>";
> }
> ------------------------------
>
> but how can I get 2 or 3 columns displaying different db objects? A
loop
> inside a loop?
>
> Thanks in advance,
>
> <mailto:webmaster
icaam.com.ar> Cesar Aracena
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
On Monday 29 July 2002 11:27, César Aracena wrote: > I like this method a lot. Now, considering I do like FOR looping as a > fact, how can I make a loop inside another loop. I mean, if I tell the > first loop that $i=0 and then do the comparison and then add 1 to $i, in > the inner or second loop should I state that $i=$i or what? Also make it > $i=0???
Not sure if I understand your question. To nest for-loops you have to use a different counter for each loop. Eg, if you're using $i for the outer-loop you can use $j for the inner-loop.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Some people's mouths work faster than their brains. They say things they haven't even thought of yet. */
attached mail follows:
I know no one in this list like to think we newbie's want the job done for us, so I'm trying to figure out the below question myself, but trust me when I say it's making me nuts... this is my best shot so far:
$query = "SELECT * FROM saav_arts ORDER BY artid"; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); $num_cols = 2;
for ($x = 0; $x < $num_rows; $x++) { echo "<tr>";
for ($i = 0; $i < $num_cols; $i++) {
$row = mysql_fetch_array($result); echo "<td align=\"center\">"; echo "<a href=\"details.php?artid=".$row[artid]."\"><img src=\"".$CFG->artdir."/".$row[artsmall]."\" ALT=\"".$row[artname]."\" BORDER=\"0\"></a>"; echo "</td>"; }
echo "</tr>"; }
The thing is that it shows up two columns as I want, but not the 4 images that I have in DB... it shows 2 rows of 2 images each and antoher 2 rows of 2 *NOT DIPLAYED* images which I don't have... like it was looping again with nothing to fetch from the DB... What is this?
Jason: as I wrote this, your tip came over and as you can see I did figure it out (almost melted my brain though)... now, do you know what is going on?
Thanx, C.
> -----Original Message-----
> From: César Aracena [mailto:icaam
icaam.com.ar]
> Sent: Monday, July 29, 2002 12:27 AM
> To: 'Chris Earle'; php-general
lists.php.net
> Subject: RE: [PHP] Re: Table formatting
>
> I like this method a lot. Now, considering I do like FOR looping as a
> fact, how can I make a loop inside another loop. I mean, if I tell the
> first loop that $i=0 and then do the comparison and then add 1 to $i,
in
> the inner or second loop should I state that $i=$i or what? Also make
it
> $i=0???
>
> Thanks, C.
>
> > -----Original Message-----
> > From: Chris Earle [mailto:chris
earleweb.com]
> > Sent: Saturday, July 27, 2002 1:54 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Re: Table formatting
> >
> > You can do what he said or just put a separate loop inside the
> original
> > loop.
> >
> > Depending on how you get the info, you can use either way (his would
> > create
> > less overhead if you are just using the same <TD> info every row,
> > otherwise
> > they're really the same because his way you'll have to create an
array
> to
> > access later for multiple rows, or just do my way and have the loop
> access
> > the NEXT *3* (or whatever) items ...).
> >
> > i.e.,
> > for (LOOP FOR <TR>)
> > {
> > for (LOOP FOR <TD>) {}
> > }
> >
> > "César aracena" <icaam
icaam.com.ar> wrote in message
> > news:001a01c234f0$a5e8ad80$28ed0dd1
gateway...
> > Hi all.
> >
> > Last nite I've came across a problem I wasn't able to figure out by
my
> > self. It's not difficult to make a loop that will make new *TABLE
> ROWS*
> > (<tr>) to show several DB objects in a nice way. what I need to do,
is
> > to display 2 or maybe even 3 of this objects stored in a DB per
table
> > row, separated in different *TABLE COLUMS* (<td>). how can I achieve
> > this? What I usually do is:
> >
> > ------------------------------
> > // DB QUERY
> > $query = "SELECT * FROM table_name";
> > $result = mysql_query($query) or die(mysql_error());
> > $num_rows = mysql_num_rows($result);
> >
> > // NOW THE LOOP
> > for ($i=0; $i<$num_rows; $i++)
> > {
> > $row = mysql_fetch_array($result);
> > echo "<tr>";
> > echo "<td>";
> > echo $row[whatever];
> > echo "</td>";
> > echo "</tr>";
> > }
> > ------------------------------
> >
> > but how can I get 2 or 3 columns displaying different db objects? A
> loop
> > inside a loop?
> >
> > Thanks in advance,
> >
> > <mailto:webmaster
icaam.com.ar> Cesar Aracena
> > CE / MCSE+I
> > Neuquen, Argentina
> > +54.299.6356688
> > +54.299.4466621
> >
> >
> >
> >
> >
> > --
> > 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:
try changing these two lines
$num_rows = mysql_num_rows($result); $num_cols = 2;
to this
$num_cols = 2; $num_rows = mysql_num_rows($result) / $num_cols;
this isn't the full solution, but will help you on your way...
HTH Martin
-----Original Message-----
From: César Aracena [mailto:icaam
icaam.com.ar]
Sent: Monday, July 29, 2002 2:03 PM
To: php-general
lists.php.net
Subject: RE: [PHP] Re: Table formatting
I know no one in this list like to think we newbie's want the job done for us, so I'm trying to figure out the below question myself, but trust me when I say it's making me nuts... this is my best shot so far:
$query = "SELECT * FROM saav_arts ORDER BY artid"; $result = mysql_query($query) or die(mysql_error()); $num_rows = mysql_num_rows($result); $num_cols = 2;
for ($x = 0; $x < $num_rows; $x++) { echo "<tr>";
for ($i = 0; $i < $num_cols; $i++) {
$row = mysql_fetch_array($result); echo "<td align=\"center\">"; echo "<a href=\"details.php?artid=".$row[artid]."\"><img src=\"".$CFG->artdir."/".$row[artsmall]."\" ALT=\"".$row[artname]."\" BORDER=\"0\"></a>"; echo "</td>"; }
echo "</tr>"; }
The thing is that it shows up two columns as I want, but not the 4 images that I have in DB... it shows 2 rows of 2 images each and antoher 2 rows of 2 *NOT DIPLAYED* images which I don't have... like it was looping again with nothing to fetch from the DB... What is this?
Jason: as I wrote this, your tip came over and as you can see I did figure it out (almost melted my brain though)... now, do you know what is going on?
Thanx, C.
> -----Original Message-----
> From: César Aracena [mailto:icaam
icaam.com.ar]
> Sent: Monday, July 29, 2002 12:27 AM
> To: 'Chris Earle'; php-general
lists.php.net
> Subject: RE: [PHP] Re: Table formatting
>
> I like this method a lot. Now, considering I do like FOR looping as a
> fact, how can I make a loop inside another loop. I mean, if I tell the
> first loop that $i=0 and then do the comparison and then add 1 to $i,
in
> the inner or second loop should I state that $i=$i or what? Also make
it
> $i=0???
>
> Thanks, C.
>
> > -----Original Message-----
> > From: Chris Earle [mailto:chris
earleweb.com]
> > Sent: Saturday, July 27, 2002 1:54 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Re: Table formatting
> >
> > You can do what he said or just put a separate loop inside the
> original
> > loop.
> >
> > Depending on how you get the info, you can use either way (his would
> > create
> > less overhead if you are just using the same <TD> info every row,
> > otherwise
> > they're really the same because his way you'll have to create an
array
> to
> > access later for multiple rows, or just do my way and have the loop
> access
> > the NEXT *3* (or whatever) items ...).
> >
> > i.e.,
> > for (LOOP FOR <TR>)
> > {
> > for (LOOP FOR <TD>) {}
> > }
> >
> > "César aracena" <icaam
icaam.com.ar> wrote in message
> > news:001a01c234f0$a5e8ad80$28ed0dd1
gateway...
> > Hi all.
> >
> > Last nite I've came across a problem I wasn't able to figure out by
my
> > self. It's not difficult to make a loop that will make new *TABLE
> ROWS*
> > (<tr>) to show several DB objects in a nice way. what I need to do,
is
> > to display 2 or maybe even 3 of this objects stored in a DB per
table
> > row, separated in different *TABLE COLUMS* (<td>). how can I achieve
> > this? What I usually do is:
> >
> > ------------------------------
> > // DB QUERY
> > $query = "SELECT * FROM table_name";
> > $result = mysql_query($query) or die(mysql_error());
> > $num_rows = mysql_num_rows($result);
> >
> > // NOW THE LOOP
> > for ($i=0; $i<$num_rows; $i++)
> > {
> > $row = mysql_fetch_array($result);
> > echo "<tr>";
> > echo "<td>";
> > echo $row[whatever];
> > echo "</td>";
> > echo "</tr>";
> > }
> > ------------------------------
> >
> > but how can I get 2 or 3 columns displaying different db objects? A
> loop
> > inside a loop?
> >
> > Thanks in advance,
> >
> > <mailto:webmaster
icaam.com.ar> Cesar Aracena
> > CE / MCSE+I
> > Neuquen, Argentina
> > +54.299.6356688
> > +54.299.4466621
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I've been trying a few things that should actually work and for some strange reason they aren't. It's a strange one indeed. jpg is not a MIME type though (just thought I'd let you know that) but nevertheless it should work, but for some weird reason it isn't. I'll keep plugging away at it till I figure it out. Thanks Anyhow Deadsam if you come up with another method please let me know :)
"Oscar F" <lists
webdevfm.com> wrote in message
news:002001c23684$fc68ba20$bc00a8c0
320jupiter...
> deadsman,
>
> if (($filename_type != "image/jpeg") && ($filename_type != "image/jpg") &&
> ($filename_type != "image/pjpeg")) {
> header("Location:submitError.php"); exit; //goes to an error page if the
> file wasnt a jpg
> } else {
> $upload_path = "/path/of/the/$filename_name";
> if (is_uploaded_file($filename)) {
> Exec("cp $filename $upload_path");
> } else {
> //do whatever if it wasnt uploaded
> }
>
> The "file" formfield, is called filename.. just in case... if you call it
> myFile, you'd have to replace $filename with that.
>
> Hope this helps.
>
> Oscar.-
>
> ----- Original Message -----
> From: "Deadsam" <deadsam
sympatico.ca>
> To: <php-general
lists.php.net>
> Sent: Sunday, July 28, 2002 5:53 PM
> Subject: [PHP] need help with uploading images
>
>
> > I'm trying to get an uploader to work, where you check to make sure it's
a
> > jpeg file that's being uploaded, and no other files allowed. the server
is
> > unix linux using php4.1
> > Any help would be appreciated.
> > thanks in advance
> > deasdam
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
attached mail follows:
>I've been trying a few things that should actually work and for some strange >reason they aren't. It's a strange one indeed. jpg is not a MIME type though >(just thought I'd let you know that) but nevertheless it should work, but >for some weird reason it isn't. >I'll keep plugging away at it till I figure it out.
Already answered the original, but thought I'd add:
The $_FILE['filename']['type']
is just set to whatever the browser *CLAIMS* the file's type is.
So, (A) every damn browser sets it differently and (B) a real hacker can make it be any damn thing they want and it can't be trusted anyway.
$_FILE['filename']['type'] is therefore essentially USELESS and might as well be ripped out. :-)
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Visit http://phpacronym.coolfreepage.com <http://phpacronym.coolfreepage.com/> and submit what the PHP acronym means to you!
attached mail follows:
I could be wrong on this but I believe that Oracle 8i uses a proprietary join syntax. This support has been added in the latest version of Oracle, but with 8i I believe you're out of luck using the left join keywords.
Check out http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for more info on this.
At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote: >Hi, >This really isn't a PHP issue..sorry. > >I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL >which works for MSSQL 2K and seems correct for Oracle... but keeps >giving me a Error.. ORA-00933 SQL command not properly ended on the >following query... > >SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, >usergrp.userid, users.userdescrip > FROM grp > LEFT JOIN usergrp > ON grp.grp=usergrp.grp > LEFT JOIN users > ON usergrp.userid=users.userid > ORDER BY grp.grp > >The error keeps pointing at the first "LEFT JOIN". Anybody know why? > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
You'll prob. need to use the (+) to join like this
SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp, usergrp, users WHERE grp.grp = usergrp.grp (+) AND usergrp.userid=users.userid (+) ORDER BY grp.grp
-----Original Message-----
From: Nick Oostveen [mailto:nicko-ml
hpmarketing.com]
Sent: Monday, July 29, 2002 1:47 PM
To: Frank S. Kicenko; php-general
lists.php.net
Subject: Re: [PHP] Oracle 8i SQL Problem..
I could be wrong on this but I believe that Oracle 8i uses a proprietary join syntax. This support has been added in the latest version of Oracle, but with 8i I believe you're out of luck using the left join keywords.
Check out http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for more info on this.
At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote: >Hi, >This really isn't a PHP issue..sorry. > >I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL >which works for MSSQL 2K and seems correct for Oracle... but keeps >giving me a Error.. ORA-00933 SQL command not properly ended on the >following query... > >SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, >usergrp.userid, users.userdescrip > FROM grp > LEFT JOIN usergrp > ON grp.grp=usergrp.grp > LEFT JOIN users > ON usergrp.userid=users.userid > ORDER BY grp.grp > >The error keeps pointing at the first "LEFT JOIN". Anybody know why? > >-- >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:
Oracle 9i would be happy with the left join syntax but not 8i.
-----Original Message-----
From: Martin Towell [mailto:martin.towell
world.net]
Sent: Monday, July 29, 2002 6:09 AM
To: 'Nick Oostveen'; Frank S. Kicenko; php-general
lists.php.net
Subject: RE: [PHP] Oracle 8i SQL Problem..
You'll prob. need to use the (+) to join like this
SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, usergrp.userid, users.userdescrip FROM grp, usergrp, users WHERE grp.grp = usergrp.grp (+) AND usergrp.userid=users.userid (+) ORDER BY grp.grp
-----Original Message-----
From: Nick Oostveen [mailto:nicko-ml
hpmarketing.com]
Sent: Monday, July 29, 2002 1:47 PM
To: Frank S. Kicenko; php-general
lists.php.net
Subject: Re: [PHP] Oracle 8i SQL Problem..
I could be wrong on this but I believe that Oracle 8i uses a proprietary join syntax. This support has been added in the latest version of Oracle, but with 8i I believe you're out of luck using the left join keywords.
Check out http://certcities.com/certs/oracle/columns/story.asp?EditorialsID=106 for more info on this.
At 10:26 AM 7/28/2002 -0500, Frank S. Kicenko wrote: >Hi, >This really isn't a PHP issue..sorry. > >I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL >which works for MSSQL 2K and seems correct for Oracle... but keeps >giving me a Error.. ORA-00933 SQL command not properly ended on the >following query... > >SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, >usergrp.userid, users.userdescrip > FROM grp > LEFT JOIN usergrp > ON grp.grp=usergrp.grp > LEFT JOIN users > ON usergrp.userid=users.userid > ORDER BY grp.grp > >The error keeps pointing at the first "LEFT JOIN". Anybody know why? > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
>Hi, >This really isn't a PHP issue..sorry. > >I'm having a nightmare with Oracle 8i (pos!). I'm writing common SQL >which works for MSSQL 2K and seems correct for Oracle... but keeps >giving me a Error.. ORA-00933 SQL command not properly ended on the >following query... > >SELECT grp.grpdescrip, grp.grp, grp.createcust, grp.auth1, grp.auth2, >usergrp.userid, users.userdescrip > FROM grp > LEFT JOIN usergrp > ON grp.grp=usergrp.grp > LEFT JOIN users > ON usergrp.userid=users.userid > ORDER BY grp.grp > >The error keeps pointing at the first "LEFT JOIN". Anybody know why?
WILD GUESSES!
Maybe Oracle don't like when you don't say INNER or OUTER?
Maybe Oracle just plain won't let you do two LEFT JOINs in one?
Maybe Oracle wants some parens so it knows which LEFT JOIN to do first?
Maybe Oracle don't like the line-breaks?
Maybe you have some funky invisible non-ASCII character in there? [Not likely, but...]
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
In article <000001c236b2$e5af1350$f5563944
cc1966780a>,
spamsucks86
comcast.net says...
> Visit http://phpacronym.coolfreepage.com
> <http://phpacronym.coolfreepage.com/> and submit what the PHP acronym
> means to you!
Hmm, at least it is 404-compliant :-)
-- David Robley Temporary Kiwi!Quod subigo farinam
attached mail follows:
Ray Todd Stevens wrote:
>I am working on a web site that is using php controled www- >authenticate authentication. User ids are specific to users and >different pages and different levels of information for a given page >will be displayed based on the user id used. The problem is how do >you log out without having to quit all browser sessions. >
HTTP authentication is a protocol-level mechanism that is outside of PHP. Though PHP gives you some control over the HTTP response (the message from the Web server to the Web client), it cannot grant you control of future HTTP requests (messages from the Web client to the Web server), which is what you are wanting to do.
You see, there is no such thing as "logging out" with HTTP authentication (because you are never exactly logged in); every HTTP request must include the authentication credentials. Because most browsers will save this information rather than prompting for it for every request, it can appear as if you are "logged in" until the browser session is destroyed, but that's not actually how it works.
So, in case I did not explain that well, whether the Web browser returns the HTTP authentication credentials in future requests is entirely up to the Web browser and is thus a browser configuration issue. However, I'm not aware (someone feel free to correct me) of any browsers that allow you to turn off this caching behavior with regards to HTTP authentication anyway, so you will have no option other than to end the browser session.
That's not the answer you are wanting, but might I suggest you look into writing your own access restriction logic in PHP rather than using HTTP authentication. This is what most developers choose, and it will give you far more flexibility and security.
Happy hacking.
Chris
attached mail follows:
I do understand how this works. Yea the browser caches the information and returns it each time. I was tryiung to find a way to clear this cache. (seems to be a failure in current browsers that there is no command for this) Or have a system so that a cookie can be created that forces a change. The problem I have with the cookie solution is that cookies only seem to change if the page is fully loaded. I can rejject the login and make them reinter the userid.password if a cookie is set. But I then can't erase the cookie. Once it is set the user id and password never will work again until the browser exits.
> Ray Todd Stevens wrote: > > >I am working on a web site that is using php controled www- > >authenticate authentication. User ids are specific to users and > >different pages and different levels of information for a given page > >will be displayed based on the user id used. The problem is how do > >you log out without having to quit all browser sessions. > > > > HTTP authentication is a protocol-level mechanism that is outside of > PHP. Though PHP gives you some control over the HTTP response (the > message from the Web server to the Web client), it cannot grant you > control of future HTTP requests (messages from the Web client to the > Web server), which is what you are wanting to do. > > You see, there is no such thing as "logging out" with HTTP > authentication (because you are never exactly logged in); every HTTP > request must include the authentication credentials. Because most > browsers will save this information rather than prompting for it for > every request, it can appear as if you are "logged in" until the > browser session is destroyed, but that's not actually how it works. > > So, in case I did not explain that well, whether the Web browser > returns the HTTP authentication credentials in future requests is > entirely up to the Web browser and is thus a browser configuration > issue. However, I'm not aware (someone feel free to correct me) of any > browsers that allow you to turn off this caching behavior with regards > to HTTP authentication anyway, so you will have no option other than > to end the browser session. > > That's not the answer you are wanting, but might I suggest you look > into writing your own access restriction logic in PHP rather than > using HTTP authentication. This is what most developers choose, and it > will give you far more flexibility and security. > > Happy hacking. > > Chris > >
--------------------------------------------------------------------
--------------
Ray Todd Stevens Specialists in Network and Security
Consulting
Senior Consultant Software audit service available
Stevens Services
Suite 21
3754 Old State Rd 37 N
Bedford, IN 47421
(812) 279-9394
Raytodd
kiva.net
Thought for the day: Concerto (n): a fight between a piano and a pianist.
For PGP public key send message with subject please send PGP key
If this message refers to an attachment the attachment may arrive as a seperate mail message depending on the type of mail client and gateway software you are using.
attached mail follows:
I looked at how phpMyAdmin did it, and came up with this.
1) Put this at the top of your main page:
// this handles the log out if (isset($PHP_AUTH_USER) && $old_usr == $PHP_AUTH_USER) { header('WWW-Authenticate: Basic realm="Your Protected Area Name"'); header('HTTP/1.0 401 Unauthorized'); echo '<html><body>This area requires authentication. If you are trying to log in and out as the same user, <A HREF="http://your_main_log_in_page">click here</A>.</body></html>'; exit; } else {
2) End the else at the bottom of your main page ( put in the ending }).
3) Add a link to log out, like this: <A HREF="http://your_main_log_in_page?old_usr=<?= $PHP_AUTH_USER?>">Log out</A>
That seems to work the way phpMyAdmin does, which I think is snazzy!
HTH,
Peter Janett
New Media One Web Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ New Upgrades Are Now Live!!! Windows 2000 accounts - Cold Fusion 5.0 and Imail 7.1 Sun Solaris (UNIX) accounts - PHP 4.1.2, mod_perl/1.25, Stronghold/3.0 (Apache/1.3.22), MySQL 3.23.43 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PostgreSQL coming soon!
http://www.newmediaone.net
webmaster
newmediaone.net
(303)828-9882
----- Original Message -----
From: "Ray Todd Stevens" <raytodd
kiva.net>
To: "Chris Shiflett" <shiflett
php.net>
Cc: <php-general
lists.php.net>
Sent: Sunday, July 28, 2002 10:16 PM
Subject: Re: [PHP] Logging out with authentication
> I do understand how this works. Yea the browser caches the
> information and returns it each time. I was tryiung to find a way to
> clear this cache. (seems to be a failure in current browsers that
> there is no command for this) Or have a system so that a cookie
> can be created that forces a change. The problem I have with the
> cookie solution is that cookies only seem to change if the page is
> fully loaded. I can rejject the login and make them reinter the
> userid.password if a cookie is set. But I then can't erase the cookie.
> Once it is set the user id and password never will work again until
> the browser exits.
>
> > Ray Todd Stevens wrote:
> >
> > >I am working on a web site that is using php controled www-
> > >authenticate authentication. User ids are specific to users and
> > >different pages and different levels of information for a given page
> > >will be displayed based on the user id used. The problem is how do
> > >you log out without having to quit all browser sessions.
> > >
> >
> > HTTP authentication is a protocol-level mechanism that is outside of
> > PHP. Though PHP gives you some control over the HTTP response (the
> > message from the Web server to the Web client), it cannot grant you
> > control of future HTTP requests (messages from the Web client to the
> > Web server), which is what you are wanting to do.
> >
> > You see, there is no such thing as "logging out" with HTTP
> > authentication (because you are never exactly logged in); every HTTP
> > request must include the authentication credentials. Because most
> > browsers will save this information rather than prompting for it for
> > every request, it can appear as if you are "logged in" until the
> > browser session is destroyed, but that's not actually how it works.
> >
> > So, in case I did not explain that well, whether the Web browser
> > returns the HTTP authentication credentials in future requests is
> > entirely up to the Web browser and is thus a browser configuration
> > issue. However, I'm not aware (someone feel free to correct me) of any
> > browsers that allow you to turn off this caching behavior with regards
> > to HTTP authentication anyway, so you will have no option other than
> > to end the browser session.
> >
> > That's not the answer you are wanting, but might I suggest you look
> > into writing your own access restriction logic in PHP rather than
> > using HTTP authentication. This is what most developers choose, and it
> > will give you far more flexibility and security.
> >
> > Happy hacking.
> >
> > Chris
> >
> >
>
>
> --------------------------------------------------------------------
> --------------
> Ray Todd Stevens Specialists in Network and Security
> Consulting
> Senior Consultant Software audit service available
> Stevens Services
> Suite 21
> 3754 Old State Rd 37 N
> Bedford, IN 47421
> (812) 279-9394
> Raytodd
kiva.net
>
> Thought for the day:
> Concerto (n): a fight between a piano and a pianist.
>
>
> For PGP public key send message with subject
> please send PGP key
>
> If this message refers to an attachment the attachment
> may arrive as a seperate mail message depending on the
> type of mail client and gateway software you are using.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
You could redirect to a file outside the 'realm' by using header("location: ") or just linking to it.
-- JJ Harrison webmastertececo.com www.tececo.com
"Ray Todd Stevens" <raytodd
kiva.net> wrote in message news:3D44690D.25129.D620734
localhost... > I am working on a web site that is using php controled www- > authenticate authentication. User ids are specific to users and > different pages and different levels of information for a given page > will be displayed based on the user id used. The problem is how do > you log out without having to quit all browser sessions. Anyone > doing this? Care to share code that makes it work? > -------------------------------------------------------------------- > -------------- > Ray Todd Stevens Specialists in Network and Security > Consulting > Senior Consultant Software audit service available > Stevens Services > Suite 21 > 3754 Old State Rd 37 N > Bedford, IN 47421 > (812) 279-9394 > Raytodd
kiva.net > > Thought for the day: > Concerto (n): a fight between a piano and a pianist. > > > For PGP public key send message with subject > please send PGP key > > If this message refers to an attachment the attachment > may arrive as a seperate mail message depending on the > type of mail client and gateway software you are using. >
attached mail follows:
Hello Folks, I have applied patch to PHP4.0.6.Any one of you please suggest on how to test the patched version and confirm that the vulnerability is fixed. [Note : Patch is applied for the following Vulnerability. Vulnerabilities in the php_mime_split function may allow an intruder to execute arbitrary code with the privileges of the web server.] Any help is appreciated. Advance thanks and regards, Senthil.
attached mail follows:
I don't know. php_info();?
But why use PHP 4.0.6 ?
We are up to PHP 4.2.2 now(Which was just realeased due to a security bug).
-- JJ Harrison webmastertececo.com www.tececo.com
"Senthilvelavan" <senthilvellan
gmx.net> wrote in message news:009101c236bc$61c8b410$300110ac
snpsi... Hello Folks, I have applied patch to PHP4.0.6.Any one of you please suggest on how to test the patched version and confirm that the vulnerability is fixed. [Note : Patch is applied for the following Vulnerability. Vulnerabilities in the php_mime_split function may allow an intruder to execute arbitrary code with the privileges of the web server.] Any help is appreciated. Advance thanks and regards, Senthil.
attached mail follows:
Hi all,
I have been working on an online shopping thingy for quite a while and I have encounter a strange problem which could not be solved. Deeply needed your help.
Problem:
Its very hard to explain this. So, if you do not quite understand it, please tell me, I will send some screenshots to you personally... I tried send it here but it was rejected.
Okay.. here goes... I have a product list, where customers can select which products to buy and enter the quantity they want...
Upon clicking on "Order" button, the customer is brought to his shopping cartwhere there is the product, with price in "Per Unit", "Qty", and "Total Price" . In this area, value for "Qty" column is obtained from the $qty that is passed on from the previous page, where it is also a registered in session_register("qty"). (The same goes to the Product, where prod_id is obtained from $prod_id, also a session registered variable.)
It worked out fine so far... it could get the product, unit price, qty and the total price.
But then, when I continued shopping second time, doing the same thing, first select the product, then enter the quantity and then dump it in the shopping cart, something starts going wrong... the "Qty" column do not show any value at all......
However, products are still working... which means that the $prod_id session is recorded. How come?
Here is the snippet of the script: (took out the HTML <font> tags to make it more readable)
The code I used to create the table in the product list -------------------------------------------------------------------------------------------------------------
<?php session_start(); session_register("qty"); ?>
.... all other normal thingy......
while($query_data = mysql_fetch_array($result)) {
$price = $query_data["price_lq"] * $rrp * $gst; $RowColor = useColor();
echo "<TR BGCOLOR=\"$RowColor\">"; echo "<TD>".$query_data["prod_brand"]."</TD>"; echo "<TD>".$query_data["prod_code"]."</TD>"; echo "<TD>".$query_data["prod_desc"]."</TD>"; echo "<TD>$",number_format($price, 2, '.', ''),"</TD>"; echo "<TD><input name=\"qty[".$query_data["prod_id"]."]\" type=\"text\" size=\"1\"></TD>\n"; echo "<TD><input type=\"checkbox\" name=\"choice[", $query_data["prod_id"], "]\" value=\"", $query_data["prod_id"],"\"></TD>\n";
}
all other html stuffs.............
-----------------------------------------------------------------------------------------------------------------------
This is the code I used for the shopping cart -----------------------------------------------------------------------------------------------
<?php session_start(); session_register("qty"); ?>
.... all other normal thingy......
while (list($key,$prod_id) = each($cart)) { $result = mysql_query("SELECT * FROM products WHERE prod_id = '$prod_id' ORDER BY prod_brand ASC", $link_id); $query_data = mysql_fetch_array($result); $RowColor = useColor(); $index = $query_data["prod_id"]; $quantity = $qty[$index]; $price_perunit = $query_data["price_lq"] * $rrp * $gst; $total_price = $query_data["price_lq"] * $rrp * $gst * $quantity; $grandtotal = $grandtotal + $total_price;
echo "<TR BGCOLOR=\"$RowColor\">"; echo "<TD>".$query_data["prod_brand"]."</TD>"; echo "<TD>".$query_data["prod_desc"]."</TD>"; echo "<TD>$".number_format($price_perunit, 2, '.', '')."</TD>"; echo "<TD>".$quantity."</TD>"; echo "<TD>$".number_format($total_price, 2, '.', '')."</strong><BR></FONT> </TD>\n"; echo "\t<TD><a href=\"delete.php?delete=".$query_data["prod_id"]."\" Onclick=\"return confirm('Are you sure?');\">"; echo "[Delete]</a></TD></TR>";
}
other html stuffs.................
--------------------------------------------------------------------------------------------------------------------------
attached mail follows:
I could take a guess. I would imagine that you are not closing all of your browser windows. This means that the session cookie was being kept.
First I recommend using session_destroy(); at the end of your session work.
Also writting your script as if register globals was off would probably fix it. e.g. use $_SESSION['qty'] instead of $qty for session data. Using scripts ensures greater compatibilty and (hopefully) better security.
For more info on Register Globals you should check out these pages: http://www.php.net/manual/en/security.registerglobals.php
http://www.php.net/manual/en/language.variables.predefined.php
I also suggest buying a book for PHP(if you don't have one) I would recommend PHP and MySQL Web Development by Luke Welling and Laura Thopson.
It includes a working example of what you are probably trying to do.
-- JJ Harrison webmastertececo.com www.tececo.com
"Wee Keat" <weekeat
amorphosium.com> wrote in message news:008601c236bc$a656e7a0$6300a8c0
wickid...
Hi all,
I have been working on an online shopping thingy for quite a while and I have encounter a strange problem which could not be solved. Deeply needed your help.
Problem:
Its very hard to explain this. So, if you do not quite understand it, please tell me, I will send some screenshots to you personally... I tried send it here but it was rejected.
Okay.. here goes... I have a product list, where customers can select which products to buy and enter the quantity they want...
Upon clicking on "Order" button, the customer is brought to his shopping cartwhere there is the product, with price in "Per Unit", "Qty", and "Total Price" . In this area, value for "Qty" column is obtained from the $qty that is passed on from the previous page, where it is also a registered in session_register("qty"). (The same goes to the Product, where prod_id is obtained from $prod_id, also a session registered variable.)
It worked out fine so far... it could get the product, unit price, qty and the total price.
But then, when I continued shopping second time, doing the same thing, first select the product, then enter the quantity and then dump it in the shopping cart, something starts going wrong... the "Qty" column do not show any value at all......
However, products are still working... which means that the $prod_id session is recorded. How come?
Here is the snippet of the script: (took out the HTML <font> tags to make it more readable)
The code I used to create the table in the product list ---------------------------------------------------------------------------- ---------------------------------
<?php session_start(); session_register("qty"); ?>
.... all other normal thingy......
while($query_data = mysql_fetch_array($result)) {
$price = $query_data["price_lq"] * $rrp * $gst; $RowColor = useColor();
echo "<TR BGCOLOR=\"$RowColor\">"; echo "<TD>".$query_data["prod_brand"]."</TD>"; echo "<TD>".$query_data["prod_code"]."</TD>"; echo "<TD>".$query_data["prod_desc"]."</TD>"; echo "<TD>$",number_format($price, 2, '.', ''),"</TD>"; echo "<TD><input name=\"qty[".$query_data["prod_id"]."]\" type=\"text\" size=\"1\"></TD>\n"; echo "<TD><input type=\"checkbox\" name=\"choice[", $query_data["prod_id"], "]\" value=\"", $query_data["prod_id"],"\"></TD>\n";
}
all other html stuffs.............
---------------------------------------------------------------------------- -------------------------------------------
This is the code I used for the shopping cart ---------------------------------------------------------------------------- -------------------
<?php session_start(); session_register("qty"); ?>
.... all other normal thingy......
while (list($key,$prod_id) = each($cart)) { $result = mysql_query("SELECT * FROM products WHERE prod_id = '$prod_id' ORDER BY prod_brand ASC", $link_id); $query_data = mysql_fetch_array($result); $RowColor = useColor(); $index = $query_data["prod_id"]; $quantity = $qty[$index]; $price_perunit = $query_data["price_lq"] * $rrp * $gst; $total_price = $query_data["price_lq"] * $rrp * $gst * $quantity; $grandtotal = $grandtotal + $total_price;
echo "<TR BGCOLOR=\"$RowColor\">"; echo "<TD>".$query_data["prod_brand"]."</TD>"; echo "<TD>".$query_data["prod_desc"]."</TD>"; echo "<TD>$".number_format($price_perunit, 2, '.', '')."</TD>"; echo "<TD>".$quantity."</TD>"; echo "<TD>$".number_format($total_price, 2, '.', '')."</strong><BR></FONT> </TD>\n"; echo "\t<TD><a href=\"delete.php?delete=".$query_data["prod_id"]."\" Onclick=\"return confirm('Are you sure?');\">"; echo "[Delete]</a></TD></TR>";
}
other html stuffs.................
---------------------------------------------------------------------------- ----------------------------------------------
attached mail follows:
Hi,
Monday, July 29, 2002, 7:53:30 AM, you wrote: D> I'm trying to get an uploader to work, where you check to make sure it's a D> jpeg file that's being uploaded, and no other files allowed. the server is D> unix linux using php4.1 D> Any help would be appreciated. D> thanks in advance D> deasdam
This may work:
$im = getimagesize('anchor.jpg'); if($im[2] == 2 && $im[0] > 0 && $im[1] > 0) echo 'Found a JPEG <br>';
or even this;
if($fd = fopen('test.jpg', "r")): fseek($fd,6); $f = fread($fd,4); if($f == "JFIF") echo "JPEG <br>"; fclose ($fd); endif;
-- regards, Tom
attached mail follows:
>I'm trying to get an uploader to work, where you check to make sure it's a >jpeg file that's being uploaded, and no other files allowed. the server is >unix linux using php4.1
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
On Sun, Jul 28, 2002 at 04:02:32PM -0400, Mike Mannakee wrote: > Does anyone have a regular expression that works to validate credit card > numbers?
http://www.analysisandsolutions.com/code/ccvs-ph.htm
I just updated it to Version 4.3 LATE Friday night. So, anyone using anything earlier than that should upgrade.
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
>Does anyone have a regular expression that works to validate credit card >numbers?
has links to code archives that will give you tons of them.
Ditto for the phone numbers post I'm about to read.
NOTE: Making users not be able to use phone numbers like 1-800-MY-STUFF is just wrong, wrong, wrong, not to mention that sooner or later an International user or somebody with an extension or who needs you to press *2 to reach them is gonna get screwed by your stupid phone regex... Don't do it.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Hi,
My server is running on shared server which has support for PHP 4.1.2. I installed mySQL for our shared server. I also installed phpMyAdmin. Both are running properly. But I am facing following problems
1) If there is any error in the script - It is not getting displayed - screen is becoming blank, so it is becoming very difficult for me to make out any mistake.
2) I am trying to send email - but not getting any email. This is the script
<? $mailBody = "This is one line \ n This is a second line \n\n this is a third line";
$boolMail = mail ("manisha
aurica.com", "Test mail", $mailBody);
print ("Email has been send ");
?>
I am getting print statement but not the mail. Any extra settings are required ?
Thanks in advance Manisha
attached mail follows:
> My server is running on shared server which has support for PHP 4.1.2. I > installed mySQL for our shared server. I also installed phpMyAdmin. Both > are running properly. But I am facing following problems > > 1) If there is any error in the script - It is not getting displayed - > screen is becoming blank, so it is becoming very difficult for me to make > out any mistake.
Check PHP.ini and make sure display_errors is ON.
> 2) I am trying to send email - but not getting any email. This is the
> script
> <?
> $mailBody = "This is one line \ n This is a second line \n\n this is a
> third line";
>
> $boolMail = mail ("manisha
aurica.com", "Test mail", $mailBody);
> print ("Email has been send ");
> ?>
>
> I am getting print statement but not the mail. Any extra settings are
> required ?
Just the settings in PHP.ini in the mail section. Ensure you are even using a PHP.ini to begin with, too. If there isn't one, PHP will use its own defaults.
Load up a page that has just <? Phpinfo(); ?> in it and in the first block shown, it'll tell you where PHP thinks it's PHP.ini file is. Edit that file if it's there. If it's not, then look for a PHP-ini.dist or PHP-ini.recommended in the files you downloaded and rename it to PHP.ini and copy it to that location.
---John Holmes...
attached mail follows:
>My server is running on shared server which has support for PHP 4.1.2. I >installed mySQL for our shared server. I also installed phpMyAdmin. Both >are running properly. But I am facing following problems > >1) If there is any error in the script - It is not getting displayed - >screen is becoming blank, so it is becoming very difficult for me to make >out any mistake.
Check the php.ini values (or use <?php phpinfo();?> to see what your values are for error_reporting and error_logging and display_errors.
Your errors may be going into the Apache error log or even some other separate log where they belong.
If so, your ISP is to be commended for their vigilance and Security focus.
>2) I am trying to send email - but not getting any email. This is the script > ><? >$mailBody = "This is one line \ n This is a second line \n\n this is a >third line";
For one thing use \r\n not just \n.
Spec.
>$boolMail = mail ("manisha
aurica.com", "Test mail", $mailBody);
>print ("Email has been send ");
>?>
>
>I am getting print statement but not the mail. Any extra settings are
>required ?
if ($boolMail){ print "Email has been queued.<BR>\n"; } else{ print "Couldn't even queue email, much less send it!<BR>\n"; }
Check your sendmail logs to see what's going on. Also check the sendmail and SMTP settings in php.ini (or <?php phpinfo();?> and see if they make sense.
Also ask your ISP if PHP (user 'nobody', probably) is even *ALLOWED* to send email. Maybe not. If they were paranoid enough to fix the logging, they may have dis-allowed PHP to send email.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
howdy,
i've got it all configured correctly .. well it doesn't spit any errors out on make but when i got to view a web page it opens a down load box ..so i added this
LoadModule php4_module libexec/libphp4.so
to httpd.conf as per the manual and restarted apache but it didn't start saying it couldn't find libphp.so which leads me to my question .. that file is created automatically correct?
i havent been able to find that file on my machine any where.. so i can't point it to another location ... any one got any ideas what i should do as i have not seen any info any where that will direct me in this situation...
Cheers
Peter "the only dumb question is the one that wasn't asked"
attached mail follows:
>howdy, > >i've got it all configured correctly .. well it doesn't spit any errors out >on make >but when i got to view a web page it opens a down load box ..so i added this > >LoadModule php4_module libexec/libphp4.so > >to httpd.conf as per the manual and restarted apache but it didn't start >saying it couldn't find libphp.so which leads me to my question .. that file >is created automatically correct? > >i havent been able to find that file on my machine any where.. so i can't >point it to another location ... any one got any ideas what i should do as i >have not seen any info any where that will direct me in this situation...
Do the "make install" again and pay attention to what scrolls by and see where it puts the libphp4.so file.
Then, make sure that's where Apache expects it.
the LoadModule directive acts in conjunction with the one above all the LoadModules that tells Apache where to start looking for Modules in the first place.
Some folks set that in httpd.conf to include the "libexec" part, so then your libexec in the LoadModule line is ending up "doubling" the libexec in the path and that ain't gonna work.
If there are any *working* LoadModule lines, you can try digging around to find them on your hard drive, and make sure libphp4.so is sitting next to them, and then do the LoadModule the same way as the working ones.
http://apache.org will explain all the stuff I just said in formal language. :-)
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Hello Folks, I have applied a patch from http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz for PHP 4.0.6. Is my patched PHP4.0.6 is compatible to PHP4.2.2. If not please list the features or bugs that are not fixed with my patch applied version.
Which one is advicable? 1.Either the PHP4.0.6 with patch from http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz OR 2.To directly go for PHP4.2.2
Any help is appreciated.
Advance thanks and regards, Senthil.
attached mail follows:
Hello,
On 07/29/2002 04:44 AM, Senthilvelavan wrote: > Hello Folks, > I have applied a patch from http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz > for PHP 4.0.6. Is my patched PHP4.0.6 is compatible to PHP4.2.2. If not please list the features or bugs that are not fixed with my patch applied version. > > Which one is advicable? > 1.Either the PHP4.0.6 with patch from http://www.php.net/do_download.php?download_file=rfc1867.c.diff-4.0.6.gz > OR > 2.To directly go for PHP4.2.2
If you do not need any features of the newer version, just stick to 4.0.6 with that patch applied.
--Regards, Manuel Lemos
attached mail follows:
Glory!
I have one Table (Transactions), having a Date Column, with date stored as YYYY-MM-DD
I have another Table (Holdings), having a Date Column, with date stored as YYYY-MM-DD
Now i'm joining the two tables, to get data from both the tables and display on the page. The query i'm using is something like this :
SELECT * FROM transactions,holdings where transactions.isinno=holdings.isinno AND transactions.clientid='$clientid' AND holdings.clbal!=0 GROUP BY holdings.isinno ORDER BY shares
This statement works fine, and for any given date, extracts Data from both the tables and displays in a particular row format.
I have to also to do some Calculations as i have Debit, Credit & Opening Balance of a day, and have to generate the Closing Balance.
Now for this purpose i'm facing a simple problem. The Data being picked up is of the same date from both the Tables. However, what is required is that the Data from the "Holdings" table needs to be picked up from a Date a day earlier then the Transactions Table Data.
For eg:- If i'm displaying Transactions Table Data of 2002-06-22, then the Holdings Data should be picked up of date 2002-06-21 !!
The thing is that i have Debit & Credit in Transactions Table, and the Closing Balance in Holdings Table. The Closing Balance of 21st is the Opening Balance of 22nd. So when i display the Transactions Table for 22nd, Debit & Credit of 22nd is Subtracted & Added to the Opening Balance of 21st to get the Closing Balance. So this is what i have to do. I need to pick up the Opening Balance from the Holdings Table of a Date Previous to the Transactions that i'm displaying.
How can i do this?
Thanks, T. Edison Jr.
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
On Mon, Jul 29, 2002 at 01:03:55AM -0700, Thomas Edison Jr. wrote: > > SELECT * FROM transactions,holdings where > transactions.isinno=holdings.isinno AND > transactions.clientid='$clientid' AND > holdings.clbal!=0 GROUP BY holdings.isinno ORDER BY > shares > > Now for this purpose i'm facing a simple problem. The > Data being picked up is of the same date from both the > Tables. However, what is required is that the Data > from the "Holdings" table needs to be picked up from a > Date a day earlier then the Transactions Table Data.
You don't have any JOIN's in there. Set up your JOIN syntax something like this:
...FROM transactions LEFT JOIN holdings ON (transactions.date = date_sub(holdings.date, INTERVAL 1 DAY))...
This probably isn't exactly what you need because I'm not really paying attention to the exact demands your request. Rather, I'm pointing you in the right direction for you to figure out what you need to do by reading the manual, hacking and searching newsgroup archives.
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
>PDF_set_text_pos($p, 80, 670); >PDF_show($p, "Requirements:"); > >works just fine outside of a function but if I put the same thing inside a >function like so > >function help() > { > PDF_set_text_pos($p, 80, 670); > PDF_show($p, "Test:"); > } > >I get this error: > >Warning: pdf_set_text_pos(): supplied argument is not a valid pdf object >resource in /var/www/html/form/test.php on line 16
$p is not "in scope" inside the function.
One of the purposes of a function is to isolate all your variables so that you can't possibly screw up somebody else's variables with your function and vice versa.
So $p is "empty" inside of help()
You can either:
Pass in $p as an argument (best) or declare it global:
function help($p){ ... }
function help(){ global $p; ... }
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hi > >I am building (or attemting to build) an msn messenger class. I am having >problems reading from the socket. > >I open a connection with fsockopen(), i then write commands to the socket >with fputs(). I am reading wth fgets(). > >It is all fine if I am reading one line returned by the server, the script >runs quickly. However is i wish to read multiple lines the script basically >stops. I am working with code like this to read multiple lines...
Maybe I'm just being goofy, but how do you expect PHP to know that it should stop?...
I mean, it's a socket, and it's probably still "open" and "waiting" to send/receive info, so when do you think PHP's fgets() should "stop"?...
I think there are probably specific tokens/lines/keywords in the MSN protocol that you're going to have to use to know when read() has finished getting a whole "chunk" of information...
What that token *IS*, I dunno. Only MS knows, I guess...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I just connected to my web server and found that there was a new file named >".Xauthority", which I didn't created. Does anyone know what this file is? >Can I delete it?
If you tried to run X (X-Windows) at some point, that file would be created, I think...
man X
might, eventually, if you dig, explain what it actually is.
You can probably look inside it, it's probably just text (or a directory full of text files). Most .X stuff that ends up cluttering (blech) up your home directory is just text.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>is it possible to have optional values in a PHP function? > >some of the built in ones have optional parameters.
Yes.
And it's documented in the manual: http://php.net/functions
And it's just like C anyway, mostly, so you could have tried it and had an answer faster than asking thousands of people.
You also can have an unlimited number of arguments and there are functions for "meta" information about the number of arguments.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>hi all!! >below is the display of one of my configuration of php on the first server..
>my question is that possible for me to hide out all the environment >variables such as user, hossttype.. editor... term etc.... and how?
Try this: <?php unset($_ENV); phpinfo(); ?>
Also, there *might* be arguments to phpinfo() that would display only specific sections or something...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Please cc me on answers, as I'm way behind in this list...
I have a perfectly good Ming (Flash) movie coming out of PHP, but it's a bit large...
I'd like to put this thing on a diet.
I figured I could do it with a Sprite for the tiny portion that's animated, but I'm not getting quite what I expect for output...
Here's the way it should look: http://tourbaby.com/scheduleswf.htm 350K
Here's the Sprite version: http://tourbaby.com/scheduleswf.htm?useSprite=1 80K
Here's the source: http://tourbaby.com/scheduleswf.phps
It seems to be skipping all the "nextframe" calls I make on the Sprite in the animation loop... What's up with that?
Am I just being bone-headed about something? (Probably, but what?)
The background "map" JPEG is only like 24K, but still I don't need to repeat that whole thing every frame...
PS Any way to get the text back to blank so I don't create/destroy 50 text objects? PPS Any way to diagnose a bloated Ming movie and determine where all the space is going? PPPS Anything else I could do to put this thing on a diet? PPPPS Any pointers to OpenSource text-to-speech applications would be quite useful as well.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
You would probably stand more chance of an answer on the ming-fun mailing list.
-Rasmus
On Mon, 29 Jul 2002, Richard Lynch wrote:
> Please cc me on answers, as I'm way behind in this list... > > I have a perfectly good Ming (Flash) movie coming out of PHP, but it's a bit > large... > > I'd like to put this thing on a diet. > > I figured I could do it with a Sprite for the tiny portion that's animated, > but I'm not getting quite what I expect for output... > > Here's the way it should look: > http://tourbaby.com/scheduleswf.htm > 350K > > Here's the Sprite version: > http://tourbaby.com/scheduleswf.htm?useSprite=1 > 80K > > Here's the source: > http://tourbaby.com/scheduleswf.phps > > It seems to be skipping all the "nextframe" calls I make on the Sprite in > the animation loop... What's up with that? > > Am I just being bone-headed about something? (Probably, but what?) > > The background "map" JPEG is only like 24K, but still I don't need to repeat > that whole thing every frame... > > PS Any way to get the text back to blank so I don't create/destroy 50 text > objects? > PPS Any way to diagnose a bloated Ming movie and determine where all the > space is going? > PPPS Anything else I could do to put this thing on a diet? > PPPPS Any pointers to OpenSource text-to-speech applications would be quite > useful as well. > > -- > Like Music? http://l-i-e.com/artists.htm > I'm looking for a PRO QUALITY two-input sound card supported by Linux (any > major distro). Need to record live events (mixed already) to stereo > CD-quality. Soundcard Recommendations? > Software to handle the recording? Don't need fancy mixer stuff. Zero (0) > post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo > audio-to-disk. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
>Hi All. > >I am having a weird problem... my PHP is outputting a "libphp4.a" and >"libphp4.la" modules and I can't get Apache to recognize this type of >file. Is there a way to tell PHP to generate a ".so" module? Or how can >I get Apache to use the .a and .la modules?
I *think* PHP outputs .so *ONLY* if you use --with-apxs, not --with-apache...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Does anyone have examples on how to use cookies with PHP?
Yes.
The manual has examples. Lots.
And there are a ton of them on every PHP code archive I've ever seen.
>I'm just getting >into this and would like to know the difference between >stored cookies and non-stored per session cookies.
Stored cookies have a "time limit"
Session cookies have no "time limit", so they just die when the browsers closes.
>Does PHP support both?
Yes. You'd have to work at it pretty hard and be pretty stupid about it to write a language that only supported one or the other...
Not even Microsoft could manage that one, mostly, I think.
Though you *DO* have to provide *BOTH* time out *and* path for some versions of IE, if you want a cookie to last. Just the time won't work. Stupid IE.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> I am running my PHP application running on apache webserver.I am using >Qmail(installed on Linux operating system) as an SMTP server..The problem >is..I am not able to send any mails from my application using Qmail.Whereas >I am able to send mails from my application using SendMail..My PHP >application is running on windows 2000 and the qmail is running on >Linux.
You mean PHP is installed on Win2K, and qmail lives on the Linux box, right? OPTION 1.
Or are you just telling us your browser is on Windows, which doesn't really matter to the sending of mail?... OPTION 2.
>The following is the technical information I am using in my application.....
>
>A) The mail configuration settings (in php.ini) are.
>
>1)SMTP = 192.168.10.24
>2)sendmail_from = sreedhar
cssolutionsinc.com
>3)sendmail_path = /var/qmail/bin/sendmail
>
>I tried with the following two options too..that didn't work out..
>
>sendmail_path = /var/qmail/bin/sendmail
>sendmail_path = /usr/sbin/sendmail
OPTION 1. The path is irrelevant if your sendmail and PHP aren't on the same box, almost for sure...
I don't see *how* PHP could possibly be expected/allowed to run an arbitrary program on some other computer than the one that it's living on...
OPTION 2. Assuming qmail's sendmail wrapper works just like sendmail, you probably need: sendmail_path = "/usr/qmail/bin/sendmail -t"
You may also want to check out other flags like -i
>B) And I am using php's inbuilt "mail()" function in my application as
>follows..
>
>mail("sreedhar
cssolutionsinc.com","test","test");
>
>Then when I tried from application I got the following message from Qmail
>server..
>
>"See http://pobox.com/~djb/docs/smtplf.html."
>
>When I have gone to the above link it is saying the following things the
>qmail expects :
>
>1) Every line in an Internet mail message is required to end with CR LF.
>The entire message ends with CR LF dot CR LF. 822bis specifically prohibits
>other uses of LF.
Yes, use \r\n, not just \n if you want to be kosher.
Though Un*x boxes usually fix it for you anyway.
>2)The mail clients discussed above are incorrectly ending lines with LF and, >in most cases, ending the entire message with LF dot LF. That's not CR LF >dot CR LF, so a server such as msn.com will sit there waiting for the rest >of the message. After a while it'll give up and drop the connection. Your >mail doesn't get through.
Same as 1.
>Some mail servers convert a bare LF into CR LF, and accept LF dot LF as the >end of a mail message.
Same as 1.
>I wonder whether the php mail() function handles the mail ...The format >qmail is expecting.
OPTION 1. Yes. But qmail isn't involved in this picture at all.
OPTION 2. It's almost for sure not that PHP isn't using \r\n Whatever is going wrong, it ain't that.
>I just want to know why the mails are not going through "qmail" from my >application where as my application is able to send mail using "sendmail" >with the above settings..
OPTION 1. I don't see how the qmail/sendmail matters if you are using SMTP to send the mail.
OPTION 2. The defaults for -t may be different for qmail/sendmail...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> $cache_file_name = "cache/$id/$tid". ($showall ? '_all.php' : '.php');
> $cache_dir_name= "cache/$id";
>
> if(!file_exists($cache_file_name) ||
filectime($cache_file_name) +
30 < time() ) {
If you may have loaded/altered the file system between calls to this directory/file, you need to use: http://php.net/clearstatcache
> if(!is_dir($cache_dir_name)) { > mkdir($cache_dir_name, 0777); > }
> $lock=
fopen($cache_file_name . '.lock','w');
> if(flock($lock,LOCK_EX)) {
> include('modules/rally_live/create_cache.php');
> flock($lock,LOCK_UN);
> }
> fclose($lock);
What happens if I don't get the lock?... You just skip all this code... I think you need some kind of while() loop to just keep trying until you *DO* get a lock...
Otherwise, you will sometimes blow right by here, read the file that the other script got a lock for, but hasn't created yet, and BAM!, there's your "sometimes empty" files that have the code in them when you go looking, because you have a race condition.
> } > clearstatcache();
Hmmmm. Might be okay for this to be only here, but I'd copy it above as well. *EVERYWHERE* you might need *current* file info.
> for($i=0;!file_exists($cache_file_name);$i++) { > if($i==3) die('<b>Cannot read cache file!</b>'); > clearstatcache(); > } > include($cache_file_name); // *sometimes includes empty file* > echo "<!-- File $cache_file_name included -->"; > >The 'create_cache.php' creates a php code, that later needs to be >executed. The problem is, the just created cache file seems to be empty >*sometimes* when included, however, if I look at it, it does contain >code. I do call fflush($cache_file) before closing it, so I don't see >why the file is empty. >If anyone can help me, I would be really glad.
I think it's just your locking mechanism isn't safe, as described above. You can probably get rid of the for loop now.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I've recently had a need to write a standalone script that needs to fork off >a number of children during its operation, and I'd like to use PHP since >I've already written most of the functions in a web application I did in >PHP. But, I'm now not so sure if that's feasible.
It can certainly be done, any number of ways...
>According to the docco, process control is supplied by the "pcntl" module >which isn't compiled into PHP by default (and doesn't appear to be compiled >into the 4.1.2 Red Hat RPMs that are on the machine). The documentation >also describes it as "experimental", although that could just be old >documentation...
The docos are almost for sure correct.
PHP's idea of "experimental" is roughly equivalent to Microsoft version 2.2 products, if that helps :-)
>The program would be a production system... before I proceed trying to >recompile support in, could I get some feedback on just how reliable it is? >Should I be trying to do this in another language instead?
If pcntl turns out to be unstable, or you just don't want to risk it, you could:
1. Use & in exec() which sometimes works depending on if the command you exec() binds stdout/stderr or not, which Apache/PHP are already using for the browser, so if it does, your & doesn't work. [At least, that's my working hypothesis...]
2. Have a shell "stub" that does the fork() for you, but do all the grungy work in PHP, which makes life easy.
3. Have the shell fork() off as many children you need to start with, or...
Well many more variations on #2 are possible really.
While you may lose a little bit of performance in the "fork" itself, that's probably not going to be a bottle-neck overall, unless you're just process-crazy or something...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Is there a way to change the value of a global variable when someon clicks a ><a href> URL link on a web page?
Not really...
Or, more properly, "Yes, but it wouldn't be the same global from PHP script you're thinking of"
Let's look at HTTP in slow-motion:
1. Browser requests URL. 2. Server gets URL request. 3. Server identifies request as PHP and starts PHP 4. PHP computes HTML and spews it out via Server and quits 5. Browser gets HTML 6. Browser displays HTML 7. User moves mouse 8. User clicks
As you can see PHP is not even in the picture after step 4.
You *COULD* have the click open up a whole 'nother HTTP connection, change a value in a database somewhere, and then return a whole new HTML page...
Step back and tell us what you are trying to do.
I suspect PHP is the wrong weapon entirely, or that you're trying to do something that is not really in the realm of "known safe technology"
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I am trying to figure out how to upgrade php from 4.1.2 (which is the >default that comes with redhat 7.3), to version 4.2.2. From the small amount >of documentation I have been able to find on the subject, it looks like I >need to download a rpm. Is this the best way to do it or would it be better >to try to use the install files off of php.net, and if the php.net install >files are the way to go, how would I go about installing them over the >current copy of php. I know this may not be the proper list for this >question but I am also sending this email to the redhat list in hopes that >someone from one of these two lists can point me in the right direction.
I recommend the tarball (php.net) install.
When switching from RPM to tarball, it's best to UNINSTALL the RPMs first, then install the tarball.
You can download it first safely.
You can even do all the stuff in the instructions UP TO the "make install" before you uninstall the RPM.
You may also need to install either "devel" RPMs for other packages you use with PHP, or uninstall the RPMs and install them from source as well. Something you expect to re-install a lot (Apache, MySQL, PHP) it's best to use tarball.
If you expect to buy a new computer before re-installing, use the RPM :-)
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>How can i enable PostgreSQL module? >I have installed PHP 4 on IIS5, Windows 2000
I don't *think* PostgreSQL runs under Windows, really...
You can maybe install the CygWin stuff (a Linux emulator under Windows) and get that to "work", but:
1. Don't expect good performance. CygWin ain't a Ferrari. 2. Don't even count on it not crashing... I don't think CygWin is really all that stable, LAST I HEARD.
It's been at least a year, maybe two, since I even looked into this, so I could be way out of date.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> I don't *think* PostgreSQL runs under Windows, really... > > You can maybe install the CygWin stuff (a Linux emulator under Windows) and > get that to "work", but:
Can anyone confirm that PG will run under CygWin? Will it communicate with PHP running on Windows, too? I'm just looking for a way to get familar with PG, nothing production level, so I don't care how slow it is or how often it crashes...
Or can PG be compiled for Windows?
---John Holmes...
attached mail follows:
> Suppose I'm opening a socket connection to a server on some >port, and I do some transactions, and generate html. But I 'm not >closing the file pointer(socket). Only after the user clicks 'logout' >or something should I close the file pointer. How do I do this?? >I'm not understanding how to keep track of the file pointer, >even after generating the html. Help.
You're not understanding it because you can't do that. :-)
When a single PHP script ends, *ALL* file pointers are closed. Period.
Otherwise, you'd have a zillion dangling file pointers hanging around, from users that never did log out, and just surfed away to some other site.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>1) Integration with Outlook (yes the application will only ever be run on >windows).
Define "Integration"... :-)
Does it need to read the user's Outlook mailbox files or something?
Or does it just need to send/receive email?
Or what?
I'll give as many answers as I can, but this is not really a well-defined question:
PHP can send mail just fine using SMTP servers, Pegasus command-line email, or any other email program that will run from MS-DOS and send email out.
You can use almost any program that accepts email, and configure it to EXECute PHP when it gets email matching whatever criteria that program knows how to match. I have no idea how you'd get MS Exchange (blech) to fire up an auto-responder, but once you know how to do that, doing: C:/path/to/php.exe -q C:/path/to/autoresponser.php should not be the hard part.
>2) Integration with Credit Checking agencies (UK).
This is usually just a question of using cURL to contact their server and spewing the right stuff at it to make it answer you nicely...
Some of those agencies will probably have a pre-packaged PHP script for you, so shop around for one that does, if you can.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>hmmmm. Ok. Can somebody explain this one? Why won't it work correctly? > >for($m=1;$m<=5;$m++){ > $div_idd[$m]=${'row->sub' . $m . 'd'}; >} > >Can it not be done with a 3 parter? The columns in the table that $row >gets, are sub1d, sub2d, sub3d, sub4d and sub5d. Or is it the "->" that is >messing it up? I have tried escaping them "row\-\>sub", but that didn't work. >What would I search for on the PHP site or where are directions located >that tells me how to use this type of putting a variable together. It >makes it hard to search for it if I don't know what it is called.
You want to search for "variable variables"
At a guess, you need:
$div_idd[$m] = $row->{'sub' . $m . 'd'};
For sure, you need to get the subXd part together before you get the -> or the $row involved.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> We have to upgrade our PHP to the latest stable version on Redhat Linux >7.3. We have lots of user using our PHP so what are all the precautions >and steps involved while doing this operations without disturbing their >existing program.
At a minimum, we gotta know what version you are *ON*...
For starters, you should *WARN* your clients of the impending upgrade.
Then *THEY* can prepare any known issues like register_globals etc.
Make 100% sure that you also keep all the extensions to PHP you already have. Maybe add a couple more. Maybe upgrade the old ones while you are at it.
You *ARE* going to install on a DEVELOPMENT box with no customers and test first, right?
Do a backup of the PRODUCTION box before installing, of course.
Upgrade very early Monday morning so that corporate customers: A) Don't lose a lot of stuff if you need to back off to your backup B) Are coming in to work anyway, so any problems you've created are solvable at their work-hours, not 4 am on a Sunday.
Most sites can be down for a few hours and just blame it on network errors or something... Though if there are mission-critical sites on that server... Well, you ought to have roll-over fail-safes in the first place, right? Upgrade one at a time, and be ready to roll-over fast.
Put yourself in your customer's shoes and ask yourself all the worst "What if...?"s
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I installed PHP when I installed Red Hat 7.2 without MySQL. I have now >added MySQL but I can't figure out how to enable it in PHP. Can anyone help?
There are three possibilities: 1. PHP already has MySQL support, and you're done. 2. You need to install a different PHP RPM or tarball to get MySQL. 3. You *have* MySQL support, but for a different version of MySQL than you installed.
<?php phpinfo();?>
Will tell you if you have MySQL support. Either you see MySQL (do a "Find...") somewhere on that web page, or you ain't got MySQL.
It will also tell you what *VERSION* of MySQL support you have.
You probably know what version of MySQL you just installed.
If those versions don't match up, do something to make them match -- Install older MySQL or newer PHP or whatever.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>There MUST be some creative way to call a user-defined PHP function from >an <a href> tag.
No, there mustn't :-)
>Does anyone have any suggestions? > >For example: > >====================================================================== ><html> ><a href="<?php joe(); ?>"> Click here to start "function joe()". </a> > ><?php >function joe() { > $temp1=10; > $temp2=20; > $result=$temp1+$temp2; > echo "The result of this function is: " . $result; >} >?> > ></html> >====================================================================== > >So, if the user clicks on the link, he'll see: "The result of this >function is: 20" > >Any ideas? Any help would be VERY much appreciated. Thanks!
See my post minutes ago about user clicking. If you can't find it, search for my name and "slow-motion"
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Actually, this works very similar to Javascript in that you can use javascript to parse the URL and thus read "values" from the previous page. PHP will declare the variables with the values based on the URL, you don't even have to parse it. If your URL/HREF is like this: www.url.com/?variable=Value&variable2=Value&variable3=value... Then on the receiving page, php will have those variables and values declared, just like a form was submitted. I'm sure there is some extra work you will need to if you are using PHP 4.2 with the globals off. I haven't moved up to that version yet.
On Friday, July 26, 2002, at 10:43 PM, Michael wrote:
> Basically, I have a php file with dozens of functions in it. I want ONE > of > them to get called when a link is clicked. > > Currently, I achieve this with the use of HTML forms. My form > generates a > list of options. And the user has to select an option, then click the > SUBMIT button.
-- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577
attached mail follows:
>Hi > >Can anyone recommend a good portal system / content management system >(polls, forums, etc.) I have tried phpnuke but am bound to the standard >layout of it i.e content in the centre and blocks on the left or right.
phpnuke has all kinds of skins and templates and whatnot with different layouts...
There are other choices, however... Is eGrail still around?
Try http://php.net/links.php -- I'll bet there are links there to PHP CMS systems. Or just Google for "PHP and CMS"
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I am wondering if anyone has created or know where I can get a code for >browsing files and directory in using php in linux. The one I am looking >for is file browsing capability that is similar to Window Explorer, >meaning you can expand and collapse directory. >I just don't want to re-invent the wheel. If anyone knows about this, >please let me know. I appreciate the help.
Are you browsing the files across an HTTP connection?
Cuz all the little triangles and stuff are gonna get dog-slow for most users...
Every single click will probably require another HTTP request...
At any rate, search the code archives listed at: http://php.net/links.php
If you are using PHP to do this locally, it seems kinda silly to do, but maybe a PHP-GTK solution is out there for it.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
On Mon, 2002-07-29 at 05:15, Richard Lynch wrote: > >I am wondering if anyone has created or know where I can get a code for > >browsing files and directory in using php in linux. The one I am looking > >for is file browsing capability that is similar to Window Explorer, > >meaning you can expand and collapse directory. > Are you browsing the files across an HTTP connection? > Cuz all the little triangles and stuff are gonna get dog-slow for most > users...
Yes, I am plannig to browse the files accross http conn. However, most of the user is going to be in the LAN, thus speed is not that much a problem. And I'm probably not going to use any image. Plus this is a part of bigger apps, and it just seems convenience to have something likt this. > Every single click will probably require another HTTP request...
Correct. I toy with the idea of using javascript instead, but that means I have to load everything at once to the client side. That is not really healthy, as it might crash the browser. But again, this is not the primary part of the apps.
> At any rate, search the code archives listed at: > http://php.net/links.php
Have not found anything so far. I might just start doing it myself. But Thanks for the reply.
Reuben D. Budiardja
attached mail follows:
>I am passing a value of checkboxes in a form to a new page like this (see >example here: http://www.gibsonusa.com/test/check/) >In a new page how can I pull the data from a MySQL database according to >each value I passed from a previous page? In other words: Assume that the >value of a checkbox equal to the ID of the record in a database. The value >of checkbox 1 (for example) is 12345 and the value of checkbox2 is 67890. >After passing those values to a new page how can I pull the rest of the >information from a database for those values?
<?php if (isset($chk) && is_array($chk)){ $ids = implode(', ', $chk); $query = "select whatever from sometable where id in ($ids)"; mysql_query($query, $connection) or error_log(mysql_error()); ... } ?>
By the way:
1. If you're Gibson the guitar maker, send me one :-) 2. There's no friggin' way I'm downloading a new version of IE just to view your site. Get real :-) 3. And on my *other* computer, IE isn't even an option. And your error page doesn't actually display any info about my browser.
You *really* need to support more than just the most recent version of IE if you expect to get traffic... :-)
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Hello, > >I need a user to save an image file to their disk. Normally when someone >clicks on an link to a .jpg file, the fil will display on the same browser >window, since it is capable of displaying such files. Now, I don't want >this to happen, I need to be able to show the user the "Save As.." dialog >when they click the link. I know it can be done bc I've seen it in >phpMyAdmin, when you want to save the database dump. If you dont click >"Save as file" it just displays the text in your browser.
<A HREF=download.php/whatever.jpg?filename=whatever.jpg>Download Whatever.jpg</A>
--------- download.php ----------------- <?php header("Content-type: application/octet-stream"); header("Content-length: " . filesize("/path/to/$filename")); readfile("/path/to/$filename"); ?>
NOTES: Some stupid browsers will *INSIST* on using the URL to "guess" what kind of file it is, and what default name to prompt with, no matter *what* headers you send. That's why the funky extra whatever.jpg is between the / and the ? in the link.
There are more headers like Content-disposition to convince even more browsers to do the right file name in the prompt.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> I am using a textarea to pass information to PHP. I want to be able to >include HTML tags inside the text area. I am using ln2br() to properly >convert line breaks to HTML. This is where my issue comes up. > >Lets say I have > ><ul> > <li>Blar</li> ></ul> > >ln2br() will crunch that and put out: ><ul><br /> > <li>Blar</li><br /> ></ul><br /> > >That creates a lot of white space when that HTML is rendered. How do I >tell PHP not to put line breaks in a situation like that?
You can't really have the user putting in HTML and then you adding in nl2br() as well...
If you're gonna let them type in HTML, just have them put in any line-breaks and <P> tags they need.
If they don't understand the BR or P tag, they won't be able to do any others either. :-)
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
On Mon, 2002-07-29 at 05:29, Richard Lynch wrote: > >That creates a lot of white space when that HTML is rendered. How do I > >tell PHP not to put line breaks in a situation like that? > > You can't really have the user putting in HTML and then you adding in > nl2br() as well... > > If you're gonna let them type in HTML, just have them put in any line-breaks > and <P> tags they need. > > If they don't understand the BR or P tag, they won't be able to do any > others either. :-) Yeah. Lucky for us, I am the user. So, I know what rules to follow. I was just hoping for some extra convenience.
Thanks!
-- Kevin Breit <mrproperximian.com>
attached mail follows:
>How can I make my form which entered by a user, then sent to a company >employee, secure, not vulnerable attack?
What kind of attack?...
Rule #1. NEVER trust data coming in from the user.
Things to maybe check: The email should be within a certain reasonable length.
Their subject should not contain newlines.
Their email should only contain ASCII characters? Or rip out any non-ASCII. Of course, that will screw international users... Kinda depends on your needs, and projected client base.
The email itself is, of course, inherently INSECURE in its transmission, and subject to forgery, spoofing, interception, or replacement, unless you PGP sign and encrypt it.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I am currently working on a website that is implemented using PHP and MySQL. > >The site currently has a simple search engine that allows a shopper to type >in a search string that is stored in $search. For example, if a shopper >types in 1972 Ford Mustang >$string ="1972 Ford Mustang" > >Using the following SQL statement: >SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% > >Records are returned that have this exact string and in this exact order >(I'm aware a wild card character is included on the front and back of the >string). > >My desire is to be able to logically AND each token of the search together >independent or the order of the tokens. >I want to return all records that have Mustang AND 1972 AND Ford. > >Since a shopper inputs the search string in advance I don't know how many >tokens will be used.
How about using OR and a ranked sorting so that the more words that match, the better?
<?php if (!isset($start)){ $start = 0; # Or is it 1? MySQL/PostgreSQL do it differently. Grrrr. } $words = explode(' ', $search); $query = "select whatever, 0 "; while (list(,$word) = each($words)){ if (trim($word)){ $query .= " + whatevercolumn LIKE '%$word%' "; } } $query .= " as score "; $query .= " from sometable "; $query .= " where score > 0 "; $query .= " order by score desc "; $query .= " limit $start, $limit "; ?>
Since LIKE returns TRUE/FALSE, when you "add them up" they turn into 1/0, and you get a one-point score for each matching word.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I 'm trying to work with file upload, I already read several sites who >refer that php will set the variable file_name automaticly,. > >I made 2 tries one on line 6 and other on line 7 of the atached code, but >both does not work. > >Why I receive the folowing errors, and how can I correct > >Notice: Undefined index: file_name in >d:\inetpub\wwwroot\impac\php\upfile.php on line 6 > >Successfully uploaded >Notice: Undefined variable: file_name in >d:\inetpub\wwwroot\impac\php\upfile.php on line 7
From the Manual:
$_FILES['userfile']['name']
Not $_FILES['userfile_name']
http://www.php.net/manual/en/features.file-upload.php
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> >Hi newsgroup friends, >my name is mike and im qite new to php. >i have one problem: i cant send date via a <form action="example.php" >method="post">. >so in the the php file called example, i write echo $nameofthefield, but the >data isnt send, so nothing is written in the browser! >what can i do?
Read about the recent change to register_globals in any of 40,000 emails or on the http://php.net site.
Or just use $_POST['nameofthefield']
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I am using PHP-4.1.1, postgresql on Linux. > >I want the following functionality, I dont know how to implement it. > >Each time a new user registeres, I want to create mail account by the name >he specifies and allocate him some space of the server, say 2mb. > >How this is incorporated ?
Woof.
DANGER WILL ROBINSON DANGER
If you allow PHP to create a user account with actual login, then *ANYBODY* else on the same server can upload a PHP file and create some accounts for themselves. With a little more work, they might even be able to create a 'root' account.
Do you *really* need this "feature"?
If so, you're going to *HAVE* to understand the Operating System and its security measures, and do the least INsecure thing you can and still make it work.
For starters, everything should be in SSL (HTTPS) so that you're not transmitting their new username/password in the clear.
Then, you've *GOT* to find some way of limiting the circumstances under which this creation of a new user can happen.
Things to keep in mind: You want it to happen *ONLY* in response to your PHP script, not just any old PHP script.
You only want it to happen for users in the database already, right?
I would suggest that the safest way might be to do this:
Use PHP CGI (do ./configure WITHOUT the --with-apxs or --with-apache part) and then write a command-line PHP script owned/readable/writable/executable by 'root' and *NOT* readable, and *CERTAINLY* not writable/executable by anybody else.
Then, you can simply have this script check for "new" users in the database that don't have email yet. Just add another column "has_email" and default it to '0', and set it to '1' after you set up their email in this script.
You can run it as a cron job, and it would look like this: <?php $query = 'select username from users where has_email = 0'; $newbies = mysql_query($query) or die(mysql_error()); # Okay to use or die() for a root cron job while (list($username) = mysql_fetch_row($newbies)){ # Use http://php.net/exec to create a mailbox. You are 'root' if (...successfully_created_mailbox_for_this_user()...){ $has_email[] = $username; } } # Note that we *ONLY* update the ones we *ACTUALLY* created mailboxes for # If a *NEW* user has been added in the past half-second, we leave them alone! if (is_array($has_email)){ $has_email = implode("', '", $has_email); $query = "update users set has_email = 1 where username in ('$has_email')"; mysql_query($query) or die(mysql_error()); } ?>
You *STILL* have the weakness that anybody that can break into your database can force a shell account to get created. But at least the HTTP and PHP side of it are relatively safe...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
> >I'm wondering what is a good general approach to enabling site-wide >searches on any topic on a 100% PHP-powered portal-type site for a >tertiary institution (yet to be built). Most if not all content will be >contained in a database, spread across potentially many different >tables. > >How can all this stuff be searched efficiently and effectively to >hopefully find the punter what they're looking for? Searching the >sometimes lengthy "main content" fields (eg. an academic paper) in every >table of the entire database for every search doesn't seem like the way to >go. But apart from attempting to add some kind of subjective "search >term" fields to the data, I can't see how else it can be done.
Google for "htdig and PHP" and see if maybe the answer is to not do it in PHP at all...
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>I'm using a regular expression (below) to check phone numbers. I'm getting >an error that I can't make sense of. > >$regex = "^((\(\d{3}(\) -))?*\d{3}(- )\d{4},?*)+$"; > >Output I'm getting = >Warning: REG_BADRPT in /home/basemen/public_html/verify_order.php on line 28 > >Anyone know what this means? I know it's not bitching about the phone >number, it's bitching about the expression. But why? Some thing wrong with >the expression? It works fine in PERL, which this is supposed to be >compatible with.
For starters, if Perl wants \ PHP needs \\ since \ is special in both languages.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Hi Richard:
On Mon, Jul 29, 2002 at 05:02:49AM -0500, Richard Lynch wrote: > > For starters, if Perl wants \ PHP needs \\ since \ is special in both > languages.
I'm curiuos what you're talking about. The manual says nothing about this in the PCRE section: Example 1. Examples of valid patterns * <\/\w+>/ * |(\d{3})-\d+|Sm http://www.php.net/manual/en/ref.pcre.php
The Pattern Syntax page has a backslashes section which states: In particular, if you want to match a backslash, you write "\\".
Then, all of my patterns work just fine w/o escaping the backslashes.
So, uh, what are you talking about? :)
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
>I'm making a website for a friend, and trying to do everything the right >way. I want to add slashes to EGPCS values. I know how to use this, >but one of the comments on the get_magic_quotes_gpc entry in the manual >points out that it wouldn't work with arrays in these values - and they >have a point. Does anyone have code that works with arrays in EGPCS >values? Thanks.
Something like this:
function array_add_slashes($data){ if (is_array($data)){ while (list($key, $value) = each($data)){ $result[$key] = array_add_slashes($value); } } else{ $result = addslashes($data); } return $result; }
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
>Do sessions not work when using an https connection? It seems I'm losing my >data between pages.
You will need to pass the Session ID from page to page any time the user "crosses" the HTTP/HTTPS boundary.
Actually, once you pass it, it will stick around on both, but you may want to be "sure" and synchronize by passing it on every boundary point.
But Cookies sent to the HTTPS are not on the HTTP and vice versa.
That ain't PHP, that's just how cookies work.
-- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk.
attached mail follows:
Hi all,
Sorry to be slightly OT, but I've prolly answered 1000 OT posts in the last year, and this IS related for all those without mycrypt, so...
I'm on a shared server which does not have mcrypt... not good, since i want to temporarily store credit card numbers in an encrypted manner, either in a MySQL database, or in a text file.
So I started google'ing for a class or something that someone may have written for two-way encryption WITH A KEY TO UNLOCK.
Couldn't find much, then did a search on MySQL.com, and found the ENCRYPT(), DECRYPT(), ENCODE() and DECODE() functions.
Am I barking up the wrong tree, or can these be used for storing sensitive information (credit card, etc etc) in a mysql table?
The MySQL manual isn't particularly in-depth about it all: http://www.mysql.com/doc/M/i/Miscellaneous_functions.html
I AM running in a linux environment (RedHat I think)...
Thanks in advance,
Justin French
attached mail follows:
Merhaba, Tolga, eger bu mesaj sana ulasirsa bana e-mail yollar misin :) ben tuba...
TUBA UĐRAŢ
utub
hotmail.com
_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
attached mail follows:
Hello there, I'm putting together a message board, and would like to automatically turn any instance of http://whatever into a link, without requiring the viewers to enter html. I'm thinking regex is probably the way to go with this, but I'm not really seeing how to do it. If someone could point me towards a solution, it would be greatly appreciated.
Thanks very much, Jesse Lawrence http://soniceast.d2g.ca/jesse/
______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca
attached mail follows:
<? $mem = "Hello world! http://www.helloworld.com\n
Hello world! ftp://ftp.server.com\n
Hello world www.helloworld.com";
// code starts here
$mem = preg_replace ("/\s+([http:|ftp:]{0,1}\S+\.\S+)/me", "' <A href=\"'.
(ereg('^[http:|ftp:]','\\1')
? '\\1\">\\1</A>'
: 'http://\\1\">http://\\1</A>')", $mem);
print ($mem);
?>
good luck,
"Jesse Lawrence" <lawrence_jesse
yahoo.ca> wrote in message
news:20020729121233.44517.qmail
web11308.mail.yahoo.com...
> Hello there, I'm putting together a message board, and > would like to automatically turn any instance of > http://whatever into a link, without requiring the > viewers to enter html. I'm thinking regex is probably > the way to go with this, but I'm not really seeing how > to do it. If someone could point me towards a > solution, it would be greatly appreciated. > > Thanks very much, > Jesse Lawrence > http://soniceast.d2g.ca/jesse/ > > ______________________________________________________________________ > Post your ad for free now! http://personals.yahoo.ca
attached mail follows:
On Mon, Jul 29, 2002 at 08:12:33AM -0400, Jesse Lawrence wrote: > would like to automatically turn any instance of > http://whatever into a link, without requiring the > viewers to enter html.
The mailing list archive: http://groups.google.com/groups?group=php.general
Good search terms: hyperlink "regular expression"
Yields this article: http://groups.google.com/groups?q=hyperlink+%22regular+expression%22+group:php.general&hl=en&lr=&ie=UTF-8&safe=off&selm=3A248B2C.13ED233C%40analysisandsolutions.com&rnum=2
Which has an excellent [shamelessly patting myself on the back] hyperlink regular expression for ereg*:
"(http://|https://|ftp://|gopher://|news:|mailto:)
([[:alnum:]/!#$%&'()*+,.:;=?
~-]+)([[:alnum:]/!#$%&'()*+:;=?
~-])"
Do note, if the last character of the URI is a "," or "." it assumes those are punctuation and leaves them off.
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
Pass your parameter as an array rather than a variable. Then you traverse the array to get all your values.
On Friday, July 26, 2002, at 09:38 PM, Mathieu Dumoulin wrote:
> Ok, here i made a function that can accept an unknown number of params. > > In fact, it's a data interface for a mysql database, when i call the > object's constructor it is in possibility to pass any number of table > names > from 1 to x. Now i got this other class called a data interfacer which > sends > a certain number of tables to the data interface constructor. I tried > doing: > > $interface = new data_interface($table1, eval("$table2, $table3, > $table4")); > $interface = eval("new data_interface($table1, $table2, $table3, > $table4)"); > > and various other tries. The thing is i can't know how many tables can > be > transfered from the data interfacer to the data_interface. So i could > make a > if..elseif...elseif until i reach something like 10 tables but still, > it's > not a good practice, i'm sure there is a way to emulate real parameters > when > they are needed and skip them in the call if you don't have them. > > Can anybody help me out? > > InsaneCoder > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577
attached mail follows:
Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/
I always thought it was a great resource, easy to use, and full of information. I have not found anything nearly as comparable for PHP so far.
Paul
attached mail follows:
www.phpbeginner.com http://www.zend.com/zend/tut/
. . .
"Paul Dionne" <PDionne
Speakeasy.net> wrote in message
news:20020729124215.53021.qmail
pb1.pair.com...
> Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/
>
> I always thought it was a great resource, easy to use, and full of
> information. I have not found anything nearly as comparable for PHP so
far.
>
> Paul
attached mail follows:
[snip] Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/ [/snip]
Jay
Monday is an awful way to spend 1/7th of your life
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
***************************************
* *
* Texas PHP Developers Meeting *
* Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* Interested? Contact; *
* jay.blanchard
niicommunications.com *
* *
***************************************
attached mail follows:
On Monday 29 July 2002 20:42, Paul Dionne wrote: > Is there a PHP counterpart to this site: http://www.4GuysFromRolla.com/ > > I always thought it was a great resource, easy to use, and full of > information. I have not found anything nearly as comparable for PHP so > far.
www.phpbuilder.com is probably the closest.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Yow! I'm imagining a surfer van filled with soy sauce! */
attached mail follows:
I'm having a total brain fart and can not seem to get the right logic for this...
I'm trying to format the output of a db query with alternating row colors, the thing is the usual if ($i%2) {} will not work here because the alternating colors do not necessarily fall on odd or even rows.
The one constant is that if ($row->show_title) is true the table row will have a background color then I need to make the rows after that alternate until if ($row->show_title) is true again.
Roughly I have the whole thing laid out like this right now:
echo "<table BORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"2\">\n"; while($row = mysql_fetch_object($result)) { if($row->show_company && $row->show_title && $row->show_month) { display month; } else if ($row->show_title) { display title; display first row with background color; } else { display rows with no background color; //right here needs to alternate <tr> background color } } echo "</table>";
I think I've been looking at his too long and I just have jello brain right now but I just can't seem to straighten this out in my head...
Thanks for the help...
-B
attached mail follows:
[snip] I'm trying to format the output of a db query with alternating row colors, the thing is the usual if ($i%2) {} will not work here because the alternating colors do not necessarily fall on odd or even rows. [/snip]
<?php $i = 0; while($exrows = mysql_fetch_object($dbcdrex)){ $bgcolor = ($i++ & 1) ? '#FFFFFF' : '#CCCCCC'; //other table stuff ?>
HTH!
Jay
Minds are like parachutes…they only function when OPEN
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
***************************************
* *
* Texas PHP Developers Meeting *
* Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* Interested? Contact; *
* jay.blanchard
niicommunications.com *
* *
***************************************
attached mail follows:
Isn't that the same thing essentially? See, from the time ($row->show_title) is true until it is true again is not a fixed number so the only constant is that if ($row->show_title) is true then the <tr> background color will be on. Then I need to alternate the background color between on and off until ($row->show_title) is true again. Then start the process over. So I'm sure my ignorance has prevented me from fully understanding what you tried to show me below but isn't that the same as saying: if ($i&1) { do this; } else { do this; } which is the same as if ($i%2) { etc..... }
???
-B
> -----Original Message-----
> From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
> Sent: Monday, July 29, 2002 9:19 AM
> To: 'Brian V Bonini'; php-general
lists.php.net
> Subject: RE: [PHP] Brain Fart- table formatting help
>
>
> [snip]
> I'm trying to format the output of a db query with alternating row colors,
> the thing is the usual
> if ($i%2) {} will not work here because the alternating colors do not
> necessarily fall on odd or even rows.
> [/snip]
>
> <?php
> $i = 0;
> while($exrows = mysql_fetch_object($dbcdrex)){
> $bgcolor = ($i++ & 1) ? '#FFFFFF' : '#CCCCCC';
> //other table stuff
> ?>
>
> HTH!
>
> Jay
>
> Minds are like parachutes…they only function when OPEN
>
> *************************************
> * Want to meet other PHP developers *
> * in your area? Check out: *
> * http://php.meetup.com/ *
> * No developer is an island ... *
> *************************************
>
> ***************************************
> * *
> * Texas PHP Developers Meeting *
> * Spring 2003 *
> * T Bar M Resort & Conference Center *
> * New Braunfels, Texas *
> * Interested? Contact; *
> * jay.blanchard
niicommunications.com *
> * *
> ***************************************
>
>
attached mail follows:
So only increase $i when $row->show_title is true.
if($row->show_title) { $i++; } $bgcolor = ($i & 1) ? '#FFFFFF' : '#CCCCCC';
---John Holmes...
----- Original Message -----
From: "Brian V Bonini" <b-bonini
cox.net>
To: "Jay Blanchard" <jay.blanchard
niicommunications.com>;
<php-general
lists.php.net>
Sent: Monday, July 29, 2002 10:26 AM
Subject: RE: [PHP] Brain Fart- table formatting help
> Isn't that the same thing essentially? See, from the time
($row->show_title)
> is true until it is true again is not a fixed number so the only constant
is
> that if ($row->show_title) is true then the <tr> background color will be
> on. Then I need to alternate the background color between on and off until
> ($row->show_title) is true again. Then start the process over. So I'm sure
> my ignorance has prevented me from fully understanding what you tried to
> show me below but isn't that the same as saying:
> if ($i&1) {
> do this;
> } else {
> do this;
> }
> which is the same as if ($i%2) { etc..... }
>
> ???
>
> -B
>
> > -----Original Message-----
> > From: Jay Blanchard [mailto:jay.blanchard
niicommunications.com]
> > Sent: Monday, July 29, 2002 9:19 AM
> > To: 'Brian V Bonini'; php-general
lists.php.net
> > Subject: RE: [PHP] Brain Fart- table formatting help
> >
> >
> > [snip]
> > I'm trying to format the output of a db query with alternating row
colors,
> > the thing is the usual
> > if ($i%2) {} will not work here because the alternating colors do not
> > necessarily fall on odd or even rows.
> > [/snip]
> >
> > <?php
> > $i = 0;
> > while($exrows = mysql_fetch_object($dbcdrex)){
> > $bgcolor = ($i++ & 1) ? '#FFFFFF' : '#CCCCCC';
> > //other table stuff
> > ?>
> >
> > HTH!
> >
> > Jay
> >
> > Minds are like parachutes.they only function when OPEN
> >
> > *************************************
> > * Want to meet other PHP developers *
> > * in your area? Check out: *
> > * http://php.meetup.com/ *
> > * No developer is an island ... *
> > *************************************
> >
> > ***************************************
> > * *
> > * Texas PHP Developers Meeting *
> > * Spring 2003 *
> > * T Bar M Resort & Conference Center *
> > * New Braunfels, Texas *
> > * Interested? Contact; *
> > * jay.blanchard
niicommunications.com *
> > * *
> > ***************************************
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
[snip] Isn't that the same thing essentially? See, from the time ($row->show_title) is true until it is true again is not a fixed number so the only constant is that if ($row->show_title) is true then the <tr> background color will be on. Then I need to alternate the background color between on and off until ($row->show_title) is true again. Then start the process over. So I'm sure my ignorance has prevented me from fully understanding what you tried to show me below but isn't that the same as saying: if ($i&1) { do this; } else { do this; } which is the same as if ($i%2) { etc..... } [/snip]
Ah, well... that was not clearly explained in your first post. You wanted alternating rows colors, and that is what I gave you. Let's see if I understand the question;
For each show_title there are multiple rows of data, but they do not match row counts from show to show? You want the alternating colors to begin with each show_title, in other words the row with the show_title in it shall always be gray, while others rows alternate between white and gray?
Jay
Madness takes its toll-please have exact change
************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************
***************************************
* *
* Texas PHP Developers Meeting *
* Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* Interested? Contact; *
* jay.blanchard
niicommunications.com *
* *
***************************************
attached mail follows:
What are good books/websites about sessions. I'm looking for more advanced stuff, I have the Luke Welling/Laura Tompson book, and have read the manual, but I still have issues that are unresolved.
Thanks
attached mail follows:
What issues? Just ask.
-Rasmus
On Mon, 29 Jul 2002, Petre wrote:
> What are good books/websites about sessions. > I'm looking for more advanced stuff, I have the Luke Welling/Laura > Tompson book, and have read the manual, but I still have issues that are > unresolved. > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
I have a DB that will take answers to an 82 question survey, but i have the survey divided into 4 html pages(forms) of 20 or so question per page. The people taking the survey are not required to fill out every question on the survey. i was wondering how i can insert the data into the db this way. For example, the first html page goes to question #24 the next starts at 25 an goes to 47. How can i enter 25 to 47 into the db and keep it all in numerical order when 1-24 are entered first? One more question, does anyone have any recommendations on how i can make it so the users can take page one of the survey and then come back and finish pages 2 (or something similar to this where they finish one of the pages and come back to finish the others later) later? Thanks in advance.
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
You can save the answers in sessions or cookies and then insert them all in one bunch.
Elias,
"Tyler Durdin" <linuxgeek23
hotmail.com> wrote in message
news:F34CIGj0gsmDzYbB1t90002848c
hotmail.com...
> I have a DB that will take answers to an 82 question survey, but i have
the
> survey divided into 4 html pages(forms) of 20 or so question per page. The
> people taking the survey are not required to fill out every question on
the
> survey. i was wondering how i can insert the data into the db this way.
For
> example,
> the first html page goes to question #24 the next starts at 25 an goes to
> 47. How can i enter 25 to 47 into the db and keep it all in numerical
order
> when 1-24 are entered first? One more question, does anyone have any
> recommendations on how i can make it so the users can take page one of the
> survey and then come back and finish pages 2 (or something similar to this
> where they finish one of the pages and come back to finish the others
later)
> later? Thanks in advance.
>
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
attached mail follows:
You can save each page of the survey to somekind of temporary table in the database, and assign a session_id to it. So everytime the user click "Go to Next Page", for example, the page actually submit the form, process it using php, save it in a temporary table and use session_id to identify it, and then the php can redirect to the next page.
The next time the user wants to go back to previous page, the page actually query the temporary database to see if there are any survey already in, and display them if there are, or put default values otherwise.
When the user get the last screen and click, for example, "Submit my Survey", then your page actually process all the data in the temporary table, fuss with it anyway you want, and put them in the main table, and delete all the entry in the temporary table that match with that session_id.
Just remember that session_id is your key to identity this session, so you need to pass that around between pages. This will allow multiple user accessing the same program.
This is better and saver than using cookies. Since using cookies, you're kind of at the mercy of the user. What happens if the user does not have the cookie turn on? what happens if the user suddently, for some unknown reason, want to delete all the cookies in the middle of doing the survey? I don't know for sure but they are also cookies limitation for storing data. So my advice, always try to use server side solution for something like this.
Hope this helps. Reuben D. Budiardja
On Mon, 2002-07-29 at 10:59, lallous wrote:
> You can save the answers in sessions or cookies and then insert them all in
> one bunch.
>
> Elias,
> "Tyler Durdin" <linuxgeek23
hotmail.com> wrote in message
> news:F34CIGj0gsmDzYbB1t90002848c
hotmail.com...
> > I have a DB that will take answers to an 82 question survey, but i have
> the
> > survey divided into 4 html pages(forms) of 20 or so question per page. The
> > people taking the survey are not required to fill out every question on
> the
> > survey. i was wondering how i can insert the data into the db this way.
> For
> > example,
> > the first html page goes to question #24 the next starts at 25 an goes to
> > 47. How can i enter 25 to 47 into the db and keep it all in numerical
> order
> > when 1-24 are entered first? One more question, does anyone have any
> > recommendations on how i can make it so the users can take page one of the
> > survey and then come back and finish pages 2 (or something similar to this
> > where they finish one of the pages and come back to finish the others
> later)
> > later? Thanks in advance.
> >
> >
> >
> > _________________________________________________________________
> > Chat with friends online, try MSN Messenger: http://messenger.msn.com
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
I download Patch for 4.2.1 to become to 4.2.2 I apply it :
cd /usr/local patch -p0 <path/to/patch
it seems the patch is correctly installed, but when the result of phpinfo() tells me that the installed version is 4.2.1 yet !
NEWS file is modified, etc, but i don't know if this patch is working.
I don't know too, if afterwards 'patch -p0 <path/to/patch' i have run ./configure make make install
I never have apply any patch for my php... Sorry for my poor english :P
attached mail follows:
Did you restart Apache? I am an Apache Newbie, but I would think you would need to simple restart apache to take the old PHP out of memory so it can load the new one?
Matt Babineau
MCWD / CCFD
-----------------------------------------
e: matt
criticalcode.com
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
-----Original Message-----
From: Sonket [mailto:mizter666
iespana.es]
Sent: Monday, July 29, 2002 10:15 AM
To: php-general
lists.php.net
Subject: [PHP] Patch 4.2.2
I download Patch for 4.2.1 to become to 4.2.2 I apply it :
cd /usr/local patch -p0 <path/to/patch
it seems the patch is correctly installed, but when the result of phpinfo() tells me that the installed version is 4.2.1 yet !
NEWS file is modified, etc, but i don't know if this patch is working.
I don't know too, if afterwards 'patch -p0 <path/to/patch' i have run ./configure make make install
I never have apply any patch for my php... Sorry for my poor english :P
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
yes, yes, and the version don't change...
Matt Babineau wrote:
> Did you restart Apache? I am an Apache Newbie, but I would think you
> would need to simple restart apache to take the old PHP out of memory so
> it can load the new one?
>
> Matt Babineau
> MCWD / CCFD
> -----------------------------------------
> e: matt
criticalcode.com
> p: 603.943.4237
> w: http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>
> -----Original Message-----
> From: Sonket [mailto:mizter666
iespana.es]
> Sent: Monday, July 29, 2002 10:15 AM
> To: php-general
lists.php.net
> Subject: [PHP] Patch 4.2.2
>
>
> I download Patch for 4.2.1 to become to 4.2.2
> I apply it :
>
> cd /usr/local
> patch -p0 <path/to/patch
>
> it seems the patch is correctly installed, but when the result of
> phpinfo() tells me that the installed version is 4.2.1 yet !
>
> NEWS file is modified, etc, but i don't know if this patch is working.
>
> I don't know too, if afterwards 'patch -p0 <path/to/patch' i have run
> ./configure
> make
> make install
>
> I never have apply any patch for my php...
> Sorry for my poor english :P
>
>
attached mail follows:
I have little problem with vpopmail functions from PHP 4.2.2. When I use vpopmail_auth_user ( "blah", "foo.bar.pl", "secret string" ); I get no correct return value ( echo vpopmail_auth_user ( "blah", "foo.bar.pl", "secret string" ); - give me no result ). This values are 100% good. I have Apache with suEXEC (VirtualHost -> User vpopmail, Group vchkpw).
Here's details:
My Apache: ./configure \ --enable-suexec \ --suexec-caller=www-data \ --suexec-docroot=/usr/local/apache \ --server-uid=www-data \ --server-gid=www-data \ --enable-module=log_referer \ --enable-module=usertrack \ --disable-module=imap \ --activate-module=src/modules/php4/libphp4.a \ --prefix=/usr/local/apache
cd src # ADD line "AddModule modules/php4/libphp4.a" in Configure ./Configure make cd .. make install My PHP:
./configure \ --enable-tokenizer \ --enable-track-vars \ --enable-ftp \ --enable-safe-mode \ --with-vpopmail="/home/vpopmail" \ --with-apache=${SRC_APACHE_DIR} \ --prefix=/usr/local
make;make install
infophp(); produce:
vpopmail version 5.2.1 vpopmail uid/gid php uid/gid/euid/egid 89/89 33/33/33/33 vpopmail dir /home/vpopmail vpopmail vadddomain /home/vpopmail/bin/vadddomain vpopmail vdeldomain /home/vpopmail/bin/vdeldomain vpopmail vaddaliasdomain /home/vpopmail/bin/vaddaliasdomain vpopmail valias support Enabled
UIDs and GIDs :
# cat /etc/group | grep 'vchkpw' vchkpw:x:89: # cat /etc/passwd | grep 'vpopmail' vpopmail:x:89:89::/home/vpopmail:/bin/bash # cat /etc/passwd | grep 'www-data' www-data:x:33:33:www-data:/var/www:/non
Is this problem of my configuration or broken code of php extensions ?
-----= Jakub Zawierucha teku(at)teku.ptc.pl.nospam - remove .nospam =---
attached mail follows:
I believethisto be one way to find out yesterday's date: $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y"));
However, I would like to have a snippet of code to tell me how to get the date of today - 10 days ago.
if today is jul 29, 2002, how do I get the date funtion to tell me 10 days ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from 29, but what happens if the date was jul 2, 2002. How do I get the correct date returned????
attached mail follows:
$ts = strtotime("-10 days");
On Mon, 29 Jul 2002, Christopher J. Crane wrote:
> I believethisto be one way to find out yesterday's date: > $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y")); > > However, I would like to have a snippet of code to tell me how to get the > date of today - 10 days ago. > > if today is jul 29, 2002, how do I get the date funtion to tell me 10 days > ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from > 29, but what happens if the date was jul 2, 2002. How do I get the correct > date returned???? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
On Mon, Jul 29, 2002 at 10:51:39AM -0400, Christopher J. Crane wrote: > I believethisto be one way to find out yesterday's date: > $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y")); > > However, I would like to have a snippet of code to tell me how to get the > date of today - 10 days ago.
You have a working example of how to get yesterday. Did you even try to rework it to get ten days ago by substituting "-10" for "-1"? What happened?
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409
attached mail follows:
----- Original Message -----
From: "Christopher J. Crane" <ccrane
inxdesign.com>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 5:51 PM
Subject: [PHP] Dates and Date()
> I believethisto be one way to find out yesterday's date: > $tomorrow = mktime (0,0,0,date("m") ,date("d")-1,date("Y")); > > However, I would like to have a snippet of code to tell me how to get the > date of today - 10 days ago. > > if today is jul 29, 2002, how do I get the date funtion to tell me 10 days > ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from > 29, but what happens if the date was jul 2, 2002. How do I get the correct > date returned????
All date functions handle correctly this case so echo strftime('%m:%d:%Y', gmmktime(0,0,0,7,2-10,2002)); will be: 06:22:2002 You can add/substract what you wish and will get correct results in case the the resulting timestamp is between 1.1.1970 and somewhere in year 2038.
Best regards, Andrey Hristov
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]