|
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 - 22:46:08 CDT
php-general Digest 30 Jul 2002 03:46:08 -0000 Issue 1494
Topics (messages 110185 through 110279):
Re: ENCRYPT() in MySQL
110185 by: Analysis & Solutions
110257 by: Richard Lynch
110270 by: Justin French
110276 by: Justin French
Array variable in Javascript & PHP
110186 by: Sheni R. Meledath
110187 by: Sheni R. Meledath
110189 by: Danny Shepherd
110190 by: Martin Clifford
Re: filling an array(2)
110188 by: Steve Buehler
Re: Table formatting <-- PARTIALY SOLVED
110191 by: César Aracena
110198 by: César Aracena
Re: Stopping Multiple Entries in mySQL DB
110192 by: Thomas Edison Jr.
110196 by: 1LT John W. Holmes
major problem using mv command to a directory
110193 by: electroteque
110259 by: Richard Lynch
Re: Brain Fart- table formatting help
110194 by: Brian V Bonini
110258 by: Richard Lynch
Re: PostgreSQL
110195 by: Danny Shepherd
Re: Help reg. create user and allocate space
110197 by: Rick Widmer
Re: Dates and Date()
110199 by: Christopher J. Crane
110201 by: Andrey Hristov
110202 by: Christopher J. Crane
110203 by: 1LT John W. Holmes
110204 by: Andrey Hristov
110205 by: Andrey Hristov
110207 by: 1LT John W. Holmes
110208 by: Christopher J. Crane
110209 by: Christopher J. Crane
Re: inserting info into db
110200 by: Rick Widmer
Disturbing parsing problems
110206 by: cteubner.ncw-av.com
110210 by: Analysis & Solutions
110211 by: cteubner.ncw-av.com
110212 by: Steve Edberg
110213 by: cteubner.ncw-av.com
Sendmail "return-path" from my virtual webhost
110214 by: Al
110222 by: Joel Boonstra
php.exe from command line
110215 by: Evan
110216 by: Andrey Hristov
110217 by: cteubner.ncw-av.com
110220 by: Evan
How would I do this?
110218 by: Tony Harrison
110260 by: Richard Lynch
Re: need help with uploading images
110219 by: Deadsam
110274 by: Tom Rogers
Preg replace & Query Problem
110221 by: Alex Beauclair
110261 by: Richard Lynch
comparing a variable to value in DB
110223 by: Tyler Durdin
110224 by: Kevin Stone
MYSQL natsort() ?
110225 by: Joel Colombo
110227 by: Kevin Stone
Auto Increment Problems....
110226 by: Georgie Casey
110232 by: cteubner.ncw-av.com
110253 by: Jome
ORDER BY from 2 tables
110228 by: Georgie Casey
110235 by: Philip Hallstrom
OT - javascript question..
110229 by: Kelly Meeks
110238 by: Martin Clifford
110254 by: Jome
110262 by: Richard Lynch
110271 by: Justin French
110272 by: Justin French
Help Please
110230 by: Varsha Agarwal
110231 by: Varsha Agarwal
110233 by: Dennis Moore
110236 by: 1LT John W. Holmes
110237 by: Martin Clifford
110239 by: Martin Clifford
110241 by: Varsha Agarwal
110243 by: Matt Schroebel
110244 by: Martin Clifford
110245 by: 1LT John W. Holmes
PHP Consulting Quote Format (fro mprevious discussion)
110234 by: Matt Babineau
PHP5?
110240 by: Chris Boget
110264 by: Tech Support
Public Scripts in a commercial product
110242 by: Chris Boget
110251 by: Jome
110263 by: Richard Lynch
110265 by: Tech Support
110266 by: Tech Support
Update of the problem w/ code - conditional image generation problem?!
110246 by: Alex Maslov
110247 by: Joseph Rosenblum
110279 by: Jason Wong
Passing PHP variables into javascript
110248 by: Bill Hudspeth
110268 by: Richard Lynch
Most compatible way to set cookies?
110249 by: Leif K-Brooks
Encrypting Passwords - Is it really necessary??
110250 by: Monty
110252 by: Jome
110255 by: Chris Wesley
110256 by: Danny Shepherd
110275 by: Michael Sims
Re: sessions and https
110267 by: Chris Shiflett
Re: libphp4.so
110269 by: Peter
Re: File Browser like Win Explorer in php
110273 by: Evgeny Chuykov
Credit Card Validation Solution updated
110277 by: Analysis & Solutions
Re: PHP-MySQL connection problem
110278 by: Manisha
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:
On Mon, Jul 29, 2002 at 10:06:29PM +1000, Justin French wrote:
>
> 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.
Uh, what are you going to do with the cc data that you need to store it?
> 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?
Should work.
--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:
>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
You're barking down the wrong well. :-)
If PHP can *DECRYPT* the data in your database, then it's not very secure AT ALL. It's just too easy for a hacker to get a script uploaded/installed and then run it and snatch all the cc #'s
To answer your question:
ENCRYPT will not help, as it's one-way. You could ask somebody to re-enter their CC# and see if it's the same as before or not, but not "un-do" the ENCRYPT.
Plain old ENCODE and DECODE don't even tell you which algorithm is used, so that's useless.
AES_ENCRYPT/AES_DECRYPT is using 128-bit encryption, which would be fine, but *ANYBODY* who manages to read your "password" (aka "key_string" in the arg_list) could snatch the CC#s. Since PHP can read the source to execute to get the password, that makes this suitable *ONLY* if: 1. You are using SSL (HTTPS) 2. You *NEVER* store the password anywhere -- It must be typed by a human into the web-page to store/retrieve the CC#s. That doesn't sound like what you want.
DES_ENCRYPT/DES_DECRYPT is using DES which doesn't totally suck, but, again, the issue is the des_key_files. If *THOSE* are secure from prying eyes, but MySQL can still read them somehow, it might be "okay"... But making it possible for MySQL to read them, but not "too open" for other users is somewhat of an oxymoron, maybe. I dunno enough about how MySQL accesses these files and if it starts as 'root' like Apache and then does 'su' or what, but I'd be very, very careful figuring out *exactly* how MySQL can read these files safely, but a rogue user should have *NO* *CHANCE* at getting to them.
Bottom line -- You've *GOT* to make sure you have no chinks in the armour.
-- 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 30/07/02 1:05 AM, Analysis & Solutions (danielc
analysisandsolutions.com)
wrote:
> On Mon, Jul 29, 2002 at 10:06:29PM +1000, Justin French wrote: >> >> 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. > > Uh, what are you going to do with the cc data that you need to store it?
I don't want to send it around in an email. So, when I get an order, I notify the staff via email, they jump online, go to a password protected part of the site, and retrieve the order, complete with decrypted CC#. THEN I can trash the CC# off the server.
If there's a smarter way, I'm ALL EARS :)
Justin French
attached mail follows:
on 30/07/02 7:45 AM, Richard Lynch (rich
phpbootcamp.com) wrote:
> You're barking down the wrong well. :-)
LMAO
> AES_ENCRYPT/AES_DECRYPT is using 128-bit encryption, which would be fine, > but *ANYBODY* who manages to read your "password" (aka "key_string" in the > arg_list) could snatch the CC#s. Since PHP can read the source to execute > to get the password, that makes this suitable *ONLY* if: > 1. You are using SSL (HTTPS) > 2. You *NEVER* store the password anywhere -- It must be typed by a human > into the web-page to store/retrieve the CC#s. > That doesn't sound like what you want.
Wouldn't I have this same problem with ANY string encrypted with a key? Either way the key has to be stored on the server in the most secure way possible.
They also mentioned with AES_* that you could set the key at connection, then NOT send it with each query.
I think AES_* is only available on MySQL 4+, so it's ruled out anyway.
> DES_ENCRYPT/DES_DECRYPT is using DES which doesn't totally suck, but, again, > the issue is the des_key_files. If *THOSE* are secure from prying eyes, but > MySQL can still read them somehow, it might be "okay"... But making it > possible for MySQL to read them, but not "too open" for other users is > somewhat of an oxymoron, maybe. I dunno enough about how MySQL accesses > these files and if it starts as 'root' like Apache and then does 'su' or > what, but I'd be very, very careful figuring out *exactly* how MySQL can > read these files safely, but a rogue user should have *NO* *CHANCE* at > getting to them.
DES_* requires MySQL to config'd with SSL, which it hasn't been, so this option is also shot down.
> Bottom line -- You've *GOT* to make sure you have no chinks in the armour.
Thanks *HEAPS* for your info. I emailed my ISP to bitch to them about all this s**t, and they're putting together a new Linux package at the moment which has mcrypt() support... so hopefully in a minth or so, things will be cool... otherwise, it'll be time to move hosts :)
Justin French
attached mail follows:
Hello:
In a form I am using a series of check boxes for a number of lists. Some calculations has to be done on the client side using Javascript depending upon the check box values. For this I am using a single variable name (array) for the check boxes in a list and another for the next list and so on. The format I have used is <input type="checkbox" name="list1" value="Education" onclick="addList()"> Education <input type="checkbox" name="list1" value="Profession" onclick="addList()"> Profession
I can access these variables from Javascript as list1[0] & list1[1]. (document.form.list1['0'].checked & document.form.list1['1'].checked
But when this form is submitted to the PHP script I am getting only the last value. list1 = 'Profession'. I am not getting an array of values. <? for ($i=0; $i<count($list1); $i++) { $listall .= '$list1[$i],'; } ?>
How can I accomplish both these operations? I cannot use single variables names for each item in the form, because it is more than 1000. Also I want to use both Javascript & PHP operations. Please help to solve this issue or suggest some other ways to accomplish this business logic.
Many Thanks in Advance & Best Regards
Sheni R Meledath
sheni
cyber-gear.com
attached mail follows:
Hello:
In a form I am using a series of check boxes for a number of lists. Some calculations has to be done on the client side using Javascript depending upon the check box values. For this I am using a single variable name (array) for the check boxes in a list and another for the next list and so on. The format I have used is <input type="checkbox" name="list1" value="Education" onclick="addList()"> Education <input type="checkbox" name="list1" value="Profession" onclick="addList()"> Profession
I can access these variables from Javascript as list1[0] & list1[1]. (document.form.list1['0'].checked & document.form.list1['1'].checked
But when this form is submitted to the PHP script I am getting only the last value. list1 = 'Profession'. I am not getting an array of values. <? for ($i=0; $i<count($list1); $i++) { $listall .= '$list1[$i],'; } ?>
How can I accomplish both these operations? I cannot use single variables names for each item in the form, because it is more than 1000. Also I want to use both Javascript & PHP operations. Please help to solve this issue or suggest some other ways to accomplish this business logic.
Many Thanks in Advance & Best Regards
Sheni R Meledath
sheni
cyber-gear.com
attached mail follows:
Try using:
<input type="checkbox" id="list1" name="list1[]" value="Education" onclick="addList()"> Education <input type="checkbox" id="list1" name="list1[]" value="Profession" onclick="addList()"> Profession
That's what I used when doing something pretty similar to you.
HTH
Danny.
----- Original Message -----
From: "Sheni R. Meledath" <sheni
cyber-gear.com>
To: "PHP Masters" <php-general
lists.php.net>
Sent: Monday, July 29, 2002 4:11 PM
Subject: [PHP] Array variable in Javascript & PHP
> Hello: > > In a form I am using a series of check boxes for a number of lists. Some > calculations has to be done on the client side using Javascript depending > upon the check box values. For this I am using a single variable name > (array) for the check boxes in a list and another for the next list and so > on. The format I have used is > <input type="checkbox" name="list1" value="Education" onclick="addList()"> > Education > <input type="checkbox" name="list1" value="Profession" onclick="addList()"> > Profession > > I can access these variables from Javascript as list1[0] & list1[1]. > (document.form.list1['0'].checked & document.form.list1['1'].checked > > But when this form is submitted to the PHP script I am getting only the > last value. list1 = 'Profession'. I am not getting an array of values. > <? > for ($i=0; $i<count($list1); $i++) > { > $listall .= '$list1[$i],'; > } > ?>
attached mail follows:
PHP cannot read a JavaScript array, simple as that. There are many workarounds, depending upon your situation. You can, for instance, create a function that is called onsubmit, that will take any values in checked checkboxes and put them into a comma-delimitted string inside a hidden form element. That string is then passed to the PHP page, where it can be parsed (ala implode/explode) and put into a new array.
I hope that made some sense :o)
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "Sheni R. Meledath" <sheni
cyber-gear.com> 07/29/02 11:18AM >>>
Hello:
In a form I am using a series of check boxes for a number of lists. Some calculations has to be done on the client side using Javascript depending upon the check box values. For this I am using a single variable name (array) for the check boxes in a list and another for the next list and so on. The format I have used is <input type="checkbox" name="list1" value="Education" onclick="addList()"> Education <input type="checkbox" name="list1" value="Profession" onclick="addList()"> Profession
I can access these variables from Javascript as list1[0] & list1[1]. (document.form.list1['0'].checked & document.form.list1['1'].checked
But when this form is submitted to the PHP script I am getting only the last value. list1 = 'Profession'. I am not getting an array of values. <? for ($i=0; $i<count($list1); $i++) { $listall .= '$list1[$i],'; } ?>
How can I accomplish both these operations? I cannot use single variables names for each item in the form, because it is more than 1000. Also I want to use both Javascript & PHP operations. Please help to solve this issue or suggest some other ways to accomplish this business logic.
Many Thanks in Advance & Best Regards
Sheni R Meledath
sheni
cyber-gear.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That did the trick. Thank you SO MUCH.
Steve
At 03:48 AM 7/29/2002 -0500, Richard Lynch wrote: > >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. > >-- >This message has been scanned for viruses and >dangerous content by MailScanner, and is >believed to be clean. >ow3
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ow3
attached mail follows:
Thnx a lot Martin and all, this worked. Anyway, apart of this being a logical solution (I almost kill myself for not thinking it before), why is that the FOR looping (before using that division operator) worked in such a strange way? Isn't it supposed to stop looping if nothing else is fetched from the DB?
Pardon my interest in learning, but this is how I am.
Thanks a lot, C.
> -----Original Message-----
> From: Martin Towell [mailto:martin.towell
world.net]
> Sent: Monday, July 29, 2002 2:05 AM
> To: 'César Aracena'; php-general
lists.php.net
> Subject: RE: [PHP] Re: Table formatting
>
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I just found a new problem when using the solution Martin tells me below... if I take out one record from the DB, leaving just 3 objects, the web page displays:
row1 = 2 objects in two columns row2 = 1 object in the first column and a *NOT DISPLAYED* image in the 2nd column... how can I override this fourth image from *TRYING TO* showing?
Thanx a lot, C.
> -----Original Message-----
> From: César Aracena [mailto:icaam
icaam.com.ar]
> Sent: Monday, July 29, 2002 12:39 PM
> To: 'Martin Towell'; php-general
lists.php.net
> Subject: RE: [PHP] Re: Table formatting <-- PARTIALY SOLVED
>
> Thnx a lot Martin and all, this worked. Anyway, apart of this being a
> logical solution (I almost kill myself for not thinking it before),
why
> is that the FOR looping (before using that division operator) worked
in
> such a strange way? Isn't it supposed to stop looping if nothing else
is
> fetched from the DB?
>
> Pardon my interest in learning, but this is how I am.
>
> Thanks a lot, C.
>
> > -----Original Message-----
> > From: Martin Towell [mailto:martin.towell
world.net]
> > Sent: Monday, July 29, 2002 2:05 AM
> > To: 'César Aracena'; php-general
lists.php.net
> > Subject: RE: [PHP] Re: Table formatting
> >
> > 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
> >
> > --
> > 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,
Ok i cant actully do this. I have many multiple entries already in the table which i do not wish to delete. And it won't alter table with these multiple entries.
So what i need is a PHP Engineered solution, where my PHP code would check for existing entries and deny entry....
Thanks, T. Edison Jr.
--- John Holmes <holmes072000
charter.net> wrote:
> > I just want my Adding Into Database script to
> check if
> > the Name/Country already exists, and if it does,
> it
> > shouldn't be allowed.
> >
> > If some with
> > Name : Jackson
> > Country : USA
> > exists in my DB, no one with same name/country
> should
> > be able to add his name/country in the DB.
>
> Have your database handle that, not PHP.
>
> When you create your table, make the combo of Name
> and Country unique.
>
> CREATE TABLE your_table {
> Name VARCHAR(15),
> Country VARCHAR(15),
> UNIQUE Name_Country (Name, Country)
> }
>
> Then you can have "Jackson, USA", "Jackson, UK",
> "Someone Else, USA",
> etc...just not the same combination at all.
>
> ---John Holmes...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
> Ok i cant actully do this. I have many multiple > entries already in the table which i do not wish to > delete. And it won't alter table with these multiple > entries. > > So what i need is a PHP Engineered solution, where my > PHP code would check for existing entries and deny > entry....
So do it...
SELECT 1 FROM your_table WHERE name = 'NAME FROM FORM' AND city = 'CITY FROM FORM'
If a row is returned, then a match is found and you shouldn't insert it again. If no row is returned, then there's no match and you can insert.
You'd be better off to clean up your database now, though...
---John Holmes...
> --- John Holmes <holmes072000
charter.net> wrote:
> > > I just want my Adding Into Database script to
> > check if
> > > the Name/Country already exists, and if it does,
> > it
> > > shouldn't be allowed.
> > >
> > > If some with
> > > Name : Jackson
> > > Country : USA
> > > exists in my DB, no one with same name/country
> > should
> > > be able to add his name/country in the DB.
> >
> > Have your database handle that, not PHP.
> >
> > When you create your table, make the combo of Name
> > and Country unique.
> >
> > CREATE TABLE your_table {
> > Name VARCHAR(15),
> > Country VARCHAR(15),
> > UNIQUE Name_Country (Name, Country)
> > }
> >
> > Then you can have "Jackson, USA", "Jackson, UK",
> > "Someone Else, USA",
> > etc...just not the same combination at all.
> >
> > ---John Holmes...
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
attached mail follows:
hi guys i have a big problem i need to fix , i was moving a tar ball to another dir , using mv ImageMagick-i686-pc-linux-gnu.tar.gz /home/usr, i now cannot move into the usr directory, it has somehow appended the tar ball into the driectory strucuture and cant undo this ? please help
attached mail follows:
>hi guys i have a big problem i need to fix , i was moving a tar ball to >another dir , using >mv ImageMagick-i686-pc-linux-gnu.tar.gz /home/usr, i now cannot move into >the usr directory, it has somehow appended the tar ball into the driectory >strucuture and cant undo this ? please help
Like, you probably never *HAD* a /home/usr directory in the first place, so you basically moved it into "/home" and re-named it "usr" instead of "ImageMagick..."
To be 100% certain, download the exact same tarball again and do:
diff /home/usr /new/downloaded/copy/of/ImageMagick...
If nothing comes back, you never had a /home/usr/
If it says the binary files are different, something is very, very, very wrong on your computer... Way beyond my ken to fix.
-- 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:
> 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? >
Sorry, I thougth I had explained it better.. But, yes, you have explained it well now...
attached mail follows:
>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";
$colors[0] = 'FF0000'; $colors[1] = '00FF00'; $color = 0; >while($row = mysql_fetch_object($result)) {
if ($row->show_title){ $color++; }
# Now you can use $color % 2 like usual.
> 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 >
-- 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:
Checkout this FAQ - http://www.ejip.net/faq/postgresql_win_setup_faq.jsp
HTH
Danny.
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000
charter.net>
To: "Richard Lynch" <rich
phpbootcamp.com>; "Hadi" <hadistation
yahoo.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 2:24 PM
Subject: Re: [PHP] Re: PostgreSQL
> > 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... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
At 04:55 AM 7/29/02 -0500, Richard Lynch wrote: > >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.
If this is on Linux, BSD or some UNIX, take a look at Qmail + Vpopmail and use a virtual domain so at least your email users aren't assigned shell accounts on the server.
Rick
attached mail follows:
Ok here is what I did. $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
Now I am wondering if there is a way to look for only the last day business
days and be returned in an array?
----- Original Message -----
From: "Andrey Hristov" <ahristov
icygen.com>
To: "Christopher J. Crane" <ccrane
inxdesign.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 10:59 AM
Subject: Re: [PHP] Dates and Date()
>
>
> ----- 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
>
>
>
attached mail follows:
Use while() with some counter that increments when you have bussiness day/ $counter = 0; $bdays = 0; while ($bdays<10){ if (in_array(gmstrftime('%u',gmmktime(0,0,0,7,2-($counter++),2002),array(1,2,3, 4,5)){ $bdays++; echo gmstrftime('%m/%d/%Y',gmmktime(0,0,0,7,2-($counter-1),2002); } }
HTH
Regards, Andrey
----- Original Message -----
From: "Christopher J. Crane" <ccrane
inxdesign.com>
To: "Andrey Hristov" <ahristov
icygen.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 7:00 PM
Subject: Re: [PHP] Dates and Date()
> Ok here is what I did.
> $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
>
> Now I am wondering if there is a way to look for only the last day
business
> days and be returned in an array?
> ----- Original Message -----
> From: "Andrey Hristov" <ahristov
icygen.com>
> To: "Christopher J. Crane" <ccrane
inxdesign.com>
> Cc: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 10:59 AM
> Subject: Re: [PHP] Dates and Date()
>
>
> >
> >
> > ----- 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
> >
> >
> >
>
>
>
>
attached mail follows:
very nice... thank you!
----- Original Message -----
From: "Andrey Hristov" <ahristov
icygen.com>
To: "Christopher J. Crane" <ccrane
inxdesign.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 12:04 PM
Subject: Re: [PHP] Dates and Date()
> Use while() with some counter that increments when you have bussiness day/
> $counter = 0;
> $bdays = 0;
> while ($bdays<10){
> if
>
(in_array(gmstrftime('%u',gmmktime(0,0,0,7,2-($counter++),2002),array(1,2,3,
> 4,5)){
> $bdays++;
> echo gmstrftime('%m/%d/%Y',gmmktime(0,0,0,7,2-($counter-1),2002);
> }
> }
>
> HTH
>
> Regards,
> Andrey
>
> ----- Original Message -----
> From: "Christopher J. Crane" <ccrane
inxdesign.com>
> To: "Andrey Hristov" <ahristov
icygen.com>
> Cc: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 7:00 PM
> Subject: Re: [PHP] Dates and Date()
>
>
> > Ok here is what I did.
> > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
> >
> > Now I am wondering if there is a way to look for only the last day
> business
> > days and be returned in an array?
> > ----- Original Message -----
> > From: "Andrey Hristov" <ahristov
icygen.com>
> > To: "Christopher J. Crane" <ccrane
inxdesign.com>
> > Cc: <php-general
lists.php.net>
> > Sent: Monday, July 29, 2002 10:59 AM
> > Subject: Re: [PHP] Dates and Date()
> >
> >
> > >
> > >
> > > ----- 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
> > >
> > >
> > >
> >
> >
> >
> >
>
>
>
attached mail follows:
> Ok here is what I did. > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days")); > > Now I am wondering if there is a way to look for only the last day business > days and be returned in an array?
What have you tried? How much longer do we have to hold your hand?
Not to be too rude or anything, but at least give it a few tries on your own, then post your code, what you thought would happen, what actually happened, and what help you need. That's how these things are supposed to work...
---John Holmes...
attached mail follows:
No problema. If you have access to icq you can use irc.php.net or capek.openprojects.net (or any other openproject's irc server) on #php channel.
Andrey
----- Original Message -----
From: "Christopher J. Crane" <ccrane
inxdesign.com>
To: "Andrey Hristov" <ahristov
icygen.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 7:08 PM
Subject: Re: [PHP] Dates and Date()
> very nice... thank you!
> ----- Original Message -----
> From: "Andrey Hristov" <ahristov
icygen.com>
> To: "Christopher J. Crane" <ccrane
inxdesign.com>
> Cc: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 12:04 PM
> Subject: Re: [PHP] Dates and Date()
>
>
> > Use while() with some counter that increments when you have bussiness
day/
> > $counter = 0;
> > $bdays = 0;
> > while ($bdays<10){
> > if
> >
>
(in_array(gmstrftime('%u',gmmktime(0,0,0,7,2-($counter++),2002),array(1,2,3,
> > 4,5)){
> > $bdays++;
> > echo gmstrftime('%m/%d/%Y',gmmktime(0,0,0,7,2-($counter-1),2002);
> > }
> > }
> >
> > HTH
> >
> > Regards,
> > Andrey
> >
> > ----- Original Message -----
> > From: "Christopher J. Crane" <ccrane
inxdesign.com>
> > To: "Andrey Hristov" <ahristov
icygen.com>
> > Cc: <php-general
lists.php.net>
> > Sent: Monday, July 29, 2002 7:00 PM
> > Subject: Re: [PHP] Dates and Date()
> >
> >
> > > Ok here is what I did.
> > > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
> > >
> > > Now I am wondering if there is a way to look for only the last day
> > business
> > > days and be returned in an array?
> > > ----- Original Message -----
> > > From: "Andrey Hristov" <ahristov
icygen.com>
> > > To: "Christopher J. Crane" <ccrane
inxdesign.com>
> > > Cc: <php-general
lists.php.net>
> > > Sent: Monday, July 29, 2002 10:59 AM
> > > Subject: Re: [PHP] Dates and Date()
> > >
> > >
> > > >
> > > >
> > > > ----- 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
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
The guy just wanted fast help. It is obvious that he is not advanced it time transformations and functions. I think that he didn't ask bad question. WHich are bad - his questions or "What the **** is php?". When he has more time he will take better look at the docs :)) Some people always experiment some not.
Kind regards, Andrey Hristov
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000
charter.net>
To: "Christopher J. Crane" <ccrane
inxdesign.com>; "Andrey Hristov"
<ahristov
icygen.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 7:12 PM
Subject: Re: [PHP] Dates and Date()
> > Ok here is what I did. > > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days")); > > > > Now I am wondering if there is a way to look for only the last day > business > > days and be returned in an array? > > What have you tried? How much longer do we have to hold your hand? > > Not to be too rude or anything, but at least give it a few tries on your > own, then post your code, what you thought would happen, what actually > happened, and what help you need. That's how these things are supposed to > work... > > ---John Holmes... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Maybe. You just see if to much around here where people will ask a lot of questions without ever doing any work themselves. Sometimes they get lucky and get an answer, sometimes they don't. I'm just trying to teach the guy not to take what he's getting here for granted...
Either way, I'm glad you helped him and he got it figured out...
---John Holmes...
----- Original Message -----
From: "Andrey Hristov" <ahristov
icygen.com>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 12:17 PM
Subject: Re: [PHP] Dates and Date()
> The guy just wanted fast help. It is obvious that he is not advanced it
> time transformations and functions. I think that he didn't ask bad
question.
> WHich are bad - his questions or "What the **** is php?".
> When he has more time he will take better look at the docs :)) Some people
> always experiment some not.
>
> Kind regards,
> Andrey Hristov
>
>
> ----- Original Message -----
> From: "1LT John W. Holmes" <holmes072000
charter.net>
> To: "Christopher J. Crane" <ccrane
inxdesign.com>; "Andrey Hristov"
> <ahristov
icygen.com>
> Cc: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 7:12 PM
> Subject: Re: [PHP] Dates and Date()
>
>
> > > Ok here is what I did.
> > > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
> > >
> > > Now I am wondering if there is a way to look for only the last day
> > business
> > > days and be returned in an array?
> >
> > What have you tried? How much longer do we have to hold your hand?
> >
> > Not to be too rude or anything, but at least give it a few tries on your
> > own, then post your code, what you thought would happen, what actually
> > happened, and what help you need. That's how these things are supposed
to
> > work...
> >
> > ---John Holmes...
> >
> >
> > --
> > 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:
Since you leave your name as 1LT, I am assuming that means 1st LT in what branch of the service...Army probably and the reserves no less. I am working on a huge project and write lets of code. Mostly MySql stuff. I did not know how to do this so I asked. Two people were nice enough to help out.
It seems you are stuck on yourself and thought I was asking you. There are many levels in this list with over 11000 posts. Some people help people because others ask for it. If I wanted you opinion, I would have asked for it.
I have received 11 emails from this list about your post and all thought you were being a jerk. If you didn't like what I was asking for you could have simply not read it or responded. Instead, you post your opinion to the entire group. You could have just sent it to me directly.
It's people like you who intimidate others from sending a post or worse replying to someone in fear of someone like you who thinks they are better then everyone else. The name of this list is not "EXPERTS" or "Only after you tried several times" it is general.
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000
charter.net>
To: "Christopher J. Crane" <ccrane
inxdesign.com>; "Andrey Hristov"
<ahristov
icygen.com>
Cc: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 12:12 PM
Subject: Re: [PHP] Dates and Date()
> > Ok here is what I did. > > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days")); > > > > Now I am wondering if there is a way to look for only the last day > business > > days and be returned in an array? > > What have you tried? How much longer do we have to hold your hand? > > Not to be too rude or anything, but at least give it a few tries on your > own, then post your code, what you thought would happen, what actually > happened, and what help you need. That's how these things are supposed to > work... > > ---John Holmes... > > >
attached mail follows:
Thank you again.
"Andrey Hristov" <ahristov
icygen.com> wrote in message
news:01ec01c2371b$77d35b20$1601a8c0
nik...
> The guy just wanted fast help. It is obvious that he is not advanced it
> time transformations and functions. I think that he didn't ask bad
question.
> WHich are bad - his questions or "What the **** is php?".
> When he has more time he will take better look at the docs :)) Some people
> always experiment some not.
>
> Kind regards,
> Andrey Hristov
>
>
> ----- Original Message -----
> From: "1LT John W. Holmes" <holmes072000
charter.net>
> To: "Christopher J. Crane" <ccrane
inxdesign.com>; "Andrey Hristov"
> <ahristov
icygen.com>
> Cc: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 7:12 PM
> Subject: Re: [PHP] Dates and Date()
>
>
> > > Ok here is what I did.
> > > $Hist_Time = gmstrftime('%m:%d:%Y', strtotime("-10 days"));
> > >
> > > Now I am wondering if there is a way to look for only the last day
> > business
> > > days and be returned in an array?
> >
> > What have you tried? How much longer do we have to hold your hand?
> >
> > Not to be too rude or anything, but at least give it a few tries on your
> > own, then post your code, what you thought would happen, what actually
> > happened, and what help you need. That's how these things are supposed
to
> > work...
> >
> > ---John Holmes...
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
attached mail follows:
At 01:56 PM 7/29/02 +0000, Tyler Durdin wrote: >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.
If I was doing it, I would probably INSERT a mostly empty record in the database when they start the survey. It would just have the info to identify the person. Then on each page of the survey you can UPDATE the fields for that page. If you want to allow them to make changes it should be pretty easy.
Rick
attached mail follows:
I added a few number_format() statements to previously working code (not having changed any {}s ) and it started getting parse errors, 'unexpected t_if, expected t_while'. In other words, it thinks the do statement shown below has been closed, and wants to hear about the while part.
I checked over the sets of braces about 10 times, but the only way to fix it ended up being to have an uneven number of braces - two close braces needed eliminating. I'm not going to post all the code unless it's necessary but here is the basic control structure. I've shown here what braces I commented out. All of the below is escaped in and out of HTML many times.
PHP 4.2.2 on Windows 2000 Professional. Is this a bug, or have people experienced weird problems with braces before?
Regards, Colin Teubner
if (){ do { if (){ while () {} if () ; else if (); else ; } if () {} if () { if { } // } if () { if { } // } } while (); if() {} //(4x) }
attached mail follows:
On Mon, Jul 29, 2002 at 12:19:50PM -0400, cteubner
ncw-av.com wrote:
>
> if (){
> do {
> if (){
> while () {}
> if () ;
> else if ();
> else ;
> }
I don't like one line if statements. Perhaps there's a problem in there. Makes things harder to see. I'd write it:
while () {} if () { } elseif () { }else { }
> if () {} > if () { > if {
Does your code have the () between the if and {?
> } > // }
> if () { > if {
Does your code have the () between the if and {?
> } > // } > } while (); > if() {} //(4x) > }
Also, your problem could be arising because of some unnoticed (, ), { or } in a command between your control statements.
--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:
Personally, I *love* one-line if statements :D However, I took your advice and used braces for all of them; same problem.
I have parentheses with all of my if's, before the braces - I just forgot to include a few here.
I haven't checked every () and [], but every {} is accounted for. The reason I refer to this problem as 'disturbing' is the fact that there are not equal numbers of open and close braces in *working* code. Regardless of other delimiters, that shouldn't be, right?
>I don't like one line if statements. Perhaps there's a problem in there. >Makes things harder to see. I'd write it: > > while () {} > if () { > } elseif () { > }else { > } > >Does your code have the () between the if and {? > } > // } > if () { > if { > >Also, your problem could be arising because of some unnoticed (, ), { or } >in a command between your control statements.
--Dan
attached mail follows:
At 12:19 PM -0400 7/29/02, <cteubner
ncw-av.com> wrote:
> I added a few number_format() statements to previously working code (not
>having changed any {}s ) and it started getting parse errors, 'unexpected
>t_if, expected t_while'. In other words, it thinks the do statement shown
>below has been closed, and wants to hear about the while part.
>
> I checked over the sets of braces about 10 times, but the only way to
>fix it ended up being to have an uneven number of braces - two close braces
>needed eliminating. I'm not going to post all the code unless it's
>necessary but here is the basic control structure. I've shown here what
>braces I commented out. All of the below is escaped in and out of HTML many
>times.
>
> PHP 4.2.2 on Windows 2000 Professional. Is this a bug, or have people
>experienced weird problems with braces before?
>
>Regards,
>Colin Teubner
>
>if (){
> do {
> if (){
> while () {}
> if () ;
> else if ();
> else ;
> }
I assume you mean
if () : else if (): else :
here (colon instead of semicolon)? AFAIK PHP doesn't allow the alternative syntax -
http://php.he.net/manual/en/control-structures.alternative-syntax.php
- with semicolons. Or do you really mean
if () {} else if () {} else {}
If you are using the alternative syntax, I recall several messages about people having problems nesting both forms of syntax. Try using all one style or the other.
Lastly, quadruple check that you haven't accidentally quoted or double-quoted a { or ( or something that you THOUGHT was part of PHP code; syntax highlighting editors can definitely help here.
-steve
> if () {} > if () { > if { > } > // } > if () { > if { > } > // } > } while (); > if() {} //(4x) >} > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
-- +------------------------------------------------------------------------+ | Steve Edberg sbedbergucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+
attached mail follows:
Sorry to double-post but this brought up something I didn't realize wasn't clear in my original post. When I say: if () ; I am using the one-line if/elseif/else syntax, which works like this:
if($foo) echo $bar; elseif($x) echo $y; else echo $z;
This is a self-contained if statement, as in C, which needs no colon or braces. This is the first mentioned syntax for if() in the PHP documentation. However, just to be 100% sure, I used braces anyway and still suffered the same problem.
I'm coding in Dreamweaver MX and all of the {}s appear the appropriate color, and seem to be in the appropriate places when I use the balance braces command. (ctrl+' for the uninitiated) Thanks, Colin Teubner
-----Original Message-----
From: Steve Edberg [mailto:sbedberg
ucdavis.edu]
I assume you mean
if () : else if (): else :
here (colon instead of semicolon)? AFAIK PHP doesn't allow the alternative syntax -
http://php.he.net/manual/en/control-structures.alternative-syntax.php
- with semicolons. Or do you really mean
if () {} else if () {} else {}
If you are using the alternative syntax, I recall several messages about people having problems nesting both forms of syntax. Try using all one style or the other.
Lastly, quadruple check that you haven't accidentally quoted or double-quoted a { or ( or something that you THOUGHT was part of PHP code; syntax highlighting editors can definitely help here.
-steve
> if () {} > if () { > if { > } > // } > if () { > if { > } > // } > } while (); > if() {} //(4x) >} > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php
-- +------------------------------------------------------------------------+ | Steve Edberg sbedbergucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+
attached mail follows:
Emails sent from my php scripts, using sendmail, all have a goofy "return-path" variable in the header.
Is there a way I can correct this, or does it require a change to the sendmail config file that I can't get to?
Thanks...........
attached mail follows:
> Emails sent from my php scripts, using sendmail, all have a goofy > "return-path" variable in the header. > > Is there a way I can correct this, or does it require a change to the > sendmail config file that I can't get to?
You should be able to use the fifth parameter ("additional parameters") that was added in PHP 4.0.5 to properly set the envelope-sender, which will cause the 'Return-Path' header to be set properly. Quick example:
<?
$to = 'You <you
yourdomain.com>';
$from = 'me
mydomain.com';
$subject = 'hey!';
$message = 'This is the message.';
mail($to, $subject, $message, "From: $from", "-f$from");
?>
Note that this doesn't do error checking on the status of the mail() command -- it's just a quick example. There also may be sendmail config things that prevent you from setting the Return-Path in this manner; that's out of my area of expertise, so if the above doesn't work, I'm not much more help...
Joel
-- [ joel boonstra | jboonstragospelcom.net ]
attached mail follows:
I've made a simple php file that creates a file named 'agent_1.txt' where the number is taken from $_GET["num"].
I've tried to run it in this way: http://localhost/agent.php?num=1 And it works perfectly
I thought that from from command line it would work so i tried this (WinXP + PHP 4.1.2):
c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1
BUT IT DOESN'T WORK!!!!! ?
Can someone help, please? Thenks in advance, Evan
attached mail follows:
Inspect $argc & $argv arrays (var_dump() them).
Andrey
----- Original Message -----
From: "Evan" <evan80
libero.it>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 8:06 PM
Subject: [PHP] php.exe from command line
> I've made a simple php file that creates a file named 'agent_1.txt' where > the number is taken from $_GET["num"]. > > I've tried to run it in this way: > http://localhost/agent.php?num=1 > And it works perfectly > > I thought that from from command line it would work so i tried this (WinXP + > PHP 4.1.2): > > c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1 > > BUT IT DOESN'T WORK!!!!! ? > > Can someone help, please? > Thenks in advance, > Evan > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Simple. Parameters of the type you described, with the ?, = and &, etc. are specific to URLs and are handled by CGI, common gateway interface, i.e. the web server. See the PHP documentation on $argc[] and $argv[] if you want to pass parameters on the command line.
http://us2.php.net/manual/en/features.commandline.php
Your question mark directly after the file name is confusing DOS. Parameters on the DOS command line need to be separated from the file name by a space.
Essentially, $argc is your argument count and $argv is an array of the values of the arguments.
You won't be able to use $_GET when working with variables from the command line. It wouldn't be wise to design one script that works from either the command line or the web browser, plus it would be a major pain in the ass.
Luck, Colin Teubner
-----Original Message-----
From: Evan [mailto:evan80
libero.it]
Sent: Monday, July 29, 2002 1:07 PM
To: php-general
lists.php.net
Subject: [PHP] php.exe from command line
I've made a simple php file that creates a file named 'agent_1.txt' where the number is taken from $_GET["num"].
I've tried to run it in this way: http://localhost/agent.php?num=1 And it works perfectly
I thought that from from command line it would work so i tried this (WinXP + PHP 4.1.2):
c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1
BUT IT DOESN'T WORK!!!!! ?
Can someone help, please? Thenks in advance, Evan
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I didn't thought about this, but it's logic (as always).
However I solved my problem: I've developed a really simple program with C++Builder6 (only ~15 lines of code :-P) that every X seconds calls the php file (agent.php). And finally it works!!!!!
Thanks for your help, Evan
<cteubner
ncw-av.com> ha scritto nel messaggio
news:1828995E4AA4A24789C16A4E3CE99A07112556
mailserver.ncw-av.com...
Simple. Parameters of the type you described, with the ?, = and &, etc. are
specific to URLs and are handled by CGI, common gateway interface, i.e. the
web server. See the PHP documentation on $argc[] and $argv[] if you want to
pass parameters on the command line.
http://us2.php.net/manual/en/features.commandline.php
Your question mark directly after the file name is confusing DOS. Parameters on the DOS command line need to be separated from the file name by a space.
Essentially, $argc is your argument count and $argv is an array of the values of the arguments.
You won't be able to use $_GET when working with variables from the command line. It wouldn't be wise to design one script that works from either the command line or the web browser, plus it would be a major pain in the ass.
Luck, Colin Teubner
-----Original Message-----
From: Evan [mailto:evan80
libero.it]
Sent: Monday, July 29, 2002 1:07 PM
To: php-general
lists.php.net
Subject: [PHP] php.exe from command line
I've made a simple php file that creates a file named 'agent_1.txt' where the number is taken from $_GET["num"].
I've tried to run it in this way: http://localhost/agent.php?num=1 And it works perfectly
I thought that from from command line it would work so i tried this (WinXP + PHP 4.1.2):
c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1
BUT IT DOESN'T WORK!!!!! ?
Can someone help, please? Thenks in advance, Evan
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi. I have a problem with my tab/lyric site, I need to create an artist page, where users can view all lyrics/tabs by a certain artist. Now because im likely to get guitar/drum/bass tabs / lyrics for the same song, I want to have a table with links as follows (e.g):
Blink 182 ---------
Whats my age again? Guitar Bass Drum Lyrics Buy at Amazon. Dammit Guitar Bass Drum Lyrics Buy at Amazon. MnMs Guitar Bass Drum Lyrics Buy at Amazon.
Now I know this would be simpler if I had them in different tables, but I have my reasons why I dont. Here is the setup of the table for storing tabs/lyrics..
CREATE TABLE `resources` ( `id` INT NOT NULL AUTO_INCREMENT, `type` TEXT NOT NULL, `title` VARCHAR(100) NOT NULL, `content` TEXT NOT NULL, `user_id` INT NOT NULL, `rating` INT DEFAULT '5' NOT NULL, `views` INT DEFAULT '0' NOT NULL, `date` TIMESTAMP NOT NULL, `artist_id` TEXT, `amazon` TEXT, INDEX (`id`), UNIQUE (`id`) );
I was thinking I could extract data and shove it into a temporary table, but that just creates other problems, I think. Anyone got any suggestions? Please?
attached mail follows:
>Blink 182 >--------- > >Whats my age again? Guitar Bass Drum Lyrics Buy >at Amazon. >Dammit Guitar Bass Drum Lyrics >Buy at Amazon. >MnMs Guitar Bass Drum Lyrics >Buy at Amazon. > >Now I know this would be simpler if I had them in different tables, but I >have my reasons why I dont. >Here is the setup of the table for storing tabs/lyrics.. > >CREATE TABLE `resources` ( >`id` INT NOT NULL AUTO_INCREMENT, >`type` TEXT NOT NULL, >`title` VARCHAR(100) NOT NULL, >`content` TEXT NOT NULL, >`user_id` INT NOT NULL, >`rating` INT DEFAULT '5' NOT NULL, >`views` INT DEFAULT '0' NOT NULL, >`date` TIMESTAMP NOT NULL, >`artist_id` TEXT, >`amazon` TEXT, >INDEX (`id`), >UNIQUE (`id`) >);
Is 'type' filled in with one of 'Guitar', 'Bass', 'Drum', 'Lyrics' ???
If so, you could do this:
create table types(type_id, type text not null); insert into types(type) values('Guitar'); insert into types(type) values('Bass'); insert into types(type) values('Drum');
You could then do:
select blah from resources left outer join types on resources.type = types.type where artist_id = 'Blink 182' order by title, type_id
Then your rows will just naturally "fill" the table.
Or, if you could live with the order being: 'Bass', 'Drum', 'Guitar', 'Lyrics' instead, you could use the table you have and do:
select blah from resources order by type where artist_id = 'Blink 182' order by title
Then, in your PHP script, you'll have to do:
$columns = array('Bass', 'Drum', 'Guitar', 'Lyrics'); $column = 0; $row = mysql_fetch_row(...); while($row){ if ($row['type'] == $columns[$column % count($columns)]){ echo "<A HREF blah blabh blah"; $row = mysql_fetch_row(...); } $column++; }
The technique here is to increase your $column so you know where to put the data, and to *ONLY* output a for and fetch a new row when you are in the correct column for that tablature.
-- 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:
maybe it would be easier to show you the part of code I'm using,
echo $HTTP_POST_FILES['uploadFile']['size'] . "::". $HTTP_POST_FILES['uploadFile']['name']['type'] . "::"; echo $HTTP_POST_FILES['uploadFile']['name'] . "::". $HTTP_POST_FILES['uploadFile']['tmp_name']; <br> */ ?> <?php /** first check that we have a name for the file: */ if($_POST['fileName'] == ""){ echo "You have to name the file before you can upload it!"; exit(); } /** Check for the size of the file*/ if($_FILES['uploadFile']['size'] == 0){ echo "File empty..."; exit(); } /** Check for the type of the image : only allow jpeg's */ if($_FILES['uploadFile']['name']['type']!="image/jpeg"){ echo "You can only upload jpg images."; exit(); } The one above is the one I'm having problems with, it should work by looking at it, it all makes sense, but it won't for some strange reason. I heard there is a difference in browsers to get it to work at time, so I tried using pjpeg instead and got the same result. If I can't get this to work somehow then I will be trying your method Oscar, which just means I'll have to change the code for it all, no big deal it's not much of a change anyhow, if it was pages upon pages then it would be lol. Thanks for all your help guys, and the security issue I never even realized, so I guess I'll have to go hunting for away to resolve that too if I'm going to use it for all users instead of administration uploading. Your help is much appreciated Sam
attached mail follows:
Hi,
Tuesday, July 30, 2002, 3:52:23 AM, you wrote: D> maybe it would be easier to show you the part of code I'm using,
D> } D> /** Check for the type of the image : only allow jpeg's */ D> if($_FILES['uploadFile']['name']['type']!="image/jpeg"){ D> echo "You can only upload jpg images."; D> exit(); D> } D> The one above is the one I'm having problems with, it should work by looking D> at it, it all makes sense, but it won't for some strange reason. I heard D> there is a difference in browsers to get it to work at time, so I tried D> using pjpeg instead and got the same result. If I can't get this to work D> somehow then I will be trying your method Oscar, which just means I'll have D> to change the code for it all, no big deal it's not much of a change anyhow, D> if it was pages upon pages then it would be lol. D> Thanks for all your help guys, and the security issue I never even realized, D> so I guess I'll have to go hunting for away to resolve that too if I'm going D> to use it for all users instead of administration uploading. D> Your help is much appreciated D> Sam Try it this way, it will check if it is a jpeg and it has a horizontal and vertical size so you can be pretty sure it is an image file. (you do not need the gd package for getimagesize())
/** Check for the type of the image : only allow jpeg's */ $im = getimagesize($_FILES['uploadFile'); if(!($im[2] == 2 && $im[0] > 0 && $im[1] > 0)){ echo "You can only upload jpg images."; exit(); }
-- regards, Tom
attached mail follows:
Hi,
I'm having trouble with preg_replace and a mysql query. Here's my code :
$query = $db->query("SELECT style FROM ".$table_styles." WHERE id = '1'"); $r = $db->fetch_array($query); $style_1 = $r[style];
$query = $db->query("SELECT id, name, description FROM ".$table_categories.""); while($r = $db->fetch_row($query)) {
$category_id = $r[0]; $category_name = $r[1]; $category_description = $r[2];
$style_1 = preg_replace('/\[url\]/', "index.php?catID=$category_id", $style_1); $style_1 = preg_replace('/\[title\]/', "$category_name", $style_1);
echo "$style_1\n"; echo "<BR>\n";
}
This is the schema for $table_styles
+----+-------------+-------------------------------------------------+------ -----------------------+ | id | name | description | style | +----+-------------+-------------------------------------------------+------ -----------------------+ | 1 | Title Links | The style for the title links on the main page. | <a href="[url]">[title]</a> | +----+-------------+-------------------------------------------------+------ -----------------------+
This is the schema for $table_categories
+----+------+------------------------------------------+-----------+-------- --+ | id | name | description | picture | comments | +----+------+------------------------------------------+-----------+-------- --+ | 1 | PHP | PHP is a powerful open source language. | icon3.gif | 0 | | 2 | ASP | ASP is microsoft's dynamic web language.| icon2.gif | 0 | +----+------+------------------------------------------+-----------+-------- --+
The script should loop and replace [url] and [title] with the relative id and name from $table_categories, however when it is run, it gives out :
<a href="index.php?catID=1">PHP</a> <BR> <a href="index.php?catID=1">PHP</a> <BR>
I'm really not sure what's going on, can anyone help me ?
Alex
attached mail follows:
> $style_1 = preg_replace('/\[url\]/', "index.php?catID=$category_id", >$style_1); > $style_1 = preg_replace('/\[title\]/', "$category_name", $style_1);
Why use preg at all?
http://php.net/str_replace will do it faster/easier...
-- 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 have a column in my DB named username and i am trying to compare a session ID called $username to the field in my DB called username. The way i had done it before was SELECT * from tablename WHERE Tablename.username == $username, but this does not seem to be working is there a better way to do this? Also, I would like to know how to tell if a field is blank. For example, if my SELECT statement comes back and there is no data in the username column how can i check for this?
_________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com
attached mail follows:
No trust me you're on the right track. You don't need the double == operator in the SQL query. Try something like this...
$query = "SELECT * FROM membersWHERE username = '$username'"; $result = mysql_query($query, $db); if (mysql_num_rows($result) == 0) { echo "The username <i>$username</u> does not exist."; exit; }
To check for blank fields simply ask "... WHERE username = ''".
-Kevin
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23
hotmail.com>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 12:46 PM
Subject: [PHP] comparing a variable to value in DB
> I have a column in my DB named username and i am trying to compare a session > ID called $username to the field in my DB called username. The way i had > done it before was SELECT * from tablename WHERE Tablename.username == > $username, but this does not seem to be working is there a better way to do > this? Also, I would like to know how to tell if a field is blank. For > example, if my SELECT statement comes back and there is no data in the > username column how can i check for this? > > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
This is a mysql question, cause i can do it with a natsort in php. question is can u do it directly in the MYSQL SELECT ? I am wondering if the SELECT statement can have a natural order by.
Table has 5 rows. field name "number" values : 10 2 15 30 150
a regular order by "number": generates results 10,15,150,2,30
i need a natural sort.... 2,10,15,30,150
is there a way to sort FLOAT valuse like this using an order by with a combo of other functions or something ?
Thanks Joel
attached mail follows:
I know that MySQL will do a natural sort on INT fields becuase I often use an integer for my index. But I don't know about a FLOAT field. Seems like it should doesn't it? Sorry I don't have a direct answer for you. You might want to check www.mysql.com if you haven't already. -Kevin
----- Original Message -----
From: "Joel Colombo" <joel
graphicon.nu>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 1:27 PM
Subject: [PHP] MYSQL natsort() ?
> This is a mysql question, cause i can do it with a natsort in php. > question is can u do it directly in the MYSQL SELECT ? > I am wondering if the SELECT statement can have a natural order by. > > Table has 5 rows. > field name "number" > values : > 10 > 2 > 15 > 30 > 150 > > a regular order by "number": generates results 10,15,150,2,30 > > i need a natural sort.... > 2,10,15,30,150 > > is there a way to sort FLOAT valuse like this using an order by with a combo > of other functions or something ? > > Thanks > Joel > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
rite,
my primary key column ("id") is set to auto_increment as usual which is very handy. But when I delete a row, the auto_increment just keeps incrementing and there's this 'hole' left where I deleted the row!
Apart from this looking ugly, it poses another problem. In my PHP script where I can add new rows, I query the table, checking how many rows in the table altogether and set the new id as the next number, but this doesnt work if theres 'holes' in the id field, as the new record tries to overwrite another id.
So I've 2 questions 1) Can the next auto_increment value be 'set' by a SQL query???? 2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in the ID column??
TIA
attached mail follows:
-----Original Message-----
>From: Georgie Casey [mailto:webmaster
filmfind.tv]
>Apart from this looking ugly, it poses another problem. In my PHP script
>where I can add new rows, I query the table, checking how many rows in the
>table altogether and set the new id as the next number, but this doesnt work
>if theres 'holes' in the id field, as the new record tries to overwrite
>another id.
The entire purpose of auto_increment is that you do NOT have to 'set' id when you add new records to the field. Don't reference your 'id' field in the insert statement at all.
>So I've 2 questions >1) Can the next auto_increment value be 'set' by a SQL query????
No. The next auto_increment value is the same as max(id) + 1. However, just because a column is auto_increment doesn't mean you can't specify an id when you add a new record, if you like.
>2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in the ID >column?? Not with SQL by itself. You'd need to SELECT id FROM table, then use PHP to figure out how to fill in the hole.
However, none of this should be a problem; simply allow those holes to exist and find some other way of numbering your records.
attached mail follows:
> my primary key column ("id") is set to auto_increment as usual which is very > handy. But when I delete a row, the auto_increment just keeps incrementing > and there's this 'hole' left where I deleted the row!
This is the way it should be, and it's like that for a reason - if you have other tables with relations to the ID in the original table, you may cause some headaches when the holes are filled up by new rows and they become related to those other tables.
> Apart from this looking ugly, it poses another problem. In my PHP script > where I can add new rows, I query the table, checking how many rows in the > table altogether and set the new id as the next number, but this doesnt work > if theres 'holes' in the id field, as the new record tries to overwrite > another id.
You may find the function mysql_insert_id() useful. If you'd like to count the number of rows in a table you can SELECT COUNT(*) FROM table;
> 1) Can the next auto_increment value be 'set' by a SQL query????
That's done automagically, and it's probably best to leave it that way.
> 2) Can I get a SQL query to INSERT INTO the first 'hole' it finds in the ID > column??
It's possible but not recommended, you can just search through the rows and see where there's a hole.
-Jome
attached mail follows:
i assume this is a simple question...
how can I SELECT * FROM 2 different tables in the same query, ORDER BYing the 'hits' column, which both tables have.
eg, 2 tables i have are similiar and i want to merge them and then select everything ordering by hits
attached mail follows:
See if your database supports the UNION clause...
On Mon, 29 Jul 2002, Georgie Casey wrote:
> i assume this is a simple question... > > how can I SELECT * FROM 2 different tables in the same query, ORDER BYing > the 'hits' column, which both tables have. > > eg, 2 tables i have are similiar and i want to merge them and then select > everything ordering by hits > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Sorry for the off topic post, but this is by far the most experienced list I've found.
I've got a php page that show all the .gif and .jpeg files in an directory via a form based drop down menu.
On the same page, I've also got a link that opens a new window, and allows the user to upload an image to that same directory.
Is there any way, when the upload window is closed, to force a reload of the other page, so the dynamic pop-up reflects the recent upload?
Thanks in advance,
Kelly
attached mail follows:
<?php
echo "<body onunload=\"opener.window.location='$PHP_SELF';\">\n\n";
?>
Something similar will work fine.
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> Kelly Meeks <info
rightangleinc.com> 07/29/02 04:00PM >>>
Sorry for the off topic post, but this is by far the most experienced list I've found.
I've got a php page that show all the .gif and .jpeg files in an directory via a form based drop down menu.
On the same page, I've also got a link that opens a new window, and allows the user to upload an image to that same directory.
Is there any way, when the upload window is closed, to force a reload of the other page, so the dynamic pop-up reflects the recent upload?
Thanks in advance,
Kelly
attached mail follows:
>Is there any way, when the upload window is closed, to force a reload of the other page, so the dynamic pop-up reflects >the recent upload?
This link may help some: http://www.hwg.org/resources/faqs/jsFAQ.html#popup-talk
Please don't poste OT-questions though, there is better mailing lists if you want to find javascript-gurus.
-Jome
attached mail follows:
>Sorry for the off topic post, but this is by far the most experienced list >I've found. > >I've got a php page that show all the .gif and .jpeg files in an directory >via a form based drop down menu. > >On the same page, I've also got a link that opens a new window, and allows >the user to upload an image to that same directory. > >Is there any way, when the upload window is closed, to force a reload of >the other page, so the dynamic pop-up reflects the recent upload?
You could: Use a META tag in the directory window to for a reload <HEAD> <META HTTP-EQUIV=REDIRECT CONTENT="20;URL=<?=$PHP_SELF?>"> </HEAD>
Maybe convince the CLOSE button that it's: ACTION=http://example.com/directory.php?nocache==mt_rand()?> TARGET="directory_window" Dunno how that jives with JavaScript's window closing code.
-- 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:
Yes, this is way OT....
you can refer back to the original window with
opener
(or it may me window.opener)
I used it once to change the location of the parent window with something like:
<SCRIPT language="JavaScript"> <!-- function blah(url,close) { opener.location = url; window.close(); } // --> </SCRIPT>
<A HREF="javascript:blah('something_else.html');">show me something else</A>
I'm thinking opener.location.reload() or opener.location.reload(1) or opener.location.replace('my_url') might do the same job, but if you know what URL the script should refresh to (ie, load the same URL again), then the function above should work as is.
Justin French
on 30/07/02 6:00 AM, Kelly Meeks (info
rightangleinc.com) wrote:
> Sorry for the off topic post, but this is by far the most experienced list > I've found. > > I've got a php page that show all the .gif and .jpeg files in an directory via > a form based drop down menu. > > On the same page, I've also got a link that opens a new window, and allows the > user to upload an image to that same directory. > > Is there any way, when the upload window is closed, to force a reload of the > other page, so the dynamic pop-up reflects the recent upload? > > Thanks in advance, > > Kelly >
attached mail follows:
on 30/07/02 6:11 AM, Martin Clifford (MLC1
nrc.gov) wrote:
> <?php > > echo "<body onunload=\"opener.window.location='$PHP_SELF';\">\n\n"; > > ?> > > Something similar will work fine.
Wouldn't the $PHP_SELF be that of the popped-up window, not of the opener?
Justin French
attached mail follows:
Hi, I am trying to run a sample program. It connects to a postgres database verifies user name and password and if correct, displays the login screen. But in that program wherever there there are setcookies() or header() functions, I get following error
Warning: Cannot add header information - headers already sent by (output started at var/www/html/processing.php:5) in /var/www/html/common.php on line 63
I checked the settings of my browser, it can accept all cookies. Someone help please!!!
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
Hi, I am trying to run a sample program. It connects to a postgres database verifies user name and password and if correct, displays the login screen. But in that program wherever there there are setcookies() or header() functions, I get following error
Warning: Cannot add header information - headers already sent by (output started at var/www/html/processing.php:5) in /var/www/html/common.php on line 63
I checked the settings of my browser, it can accept all cookies. Someone help please!!!
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
you cannot print or echo anything back to the browser before running the header() function...
----- Original Message -----
From: "Varsha Agarwal" <agarwal_varsha
yahoo.com>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 4:00 PM
Subject: [PHP] Help Please
> Hi, > I am trying to run a sample program. It connects to a > postgres database verifies user name and password and > if correct, displays the login screen. > But in that program wherever there there are > setcookies() or header() functions, I get following > error > > Warning: Cannot add header information - headers > already sent by (output started at > var/www/html/processing.php:5) in > /var/www/html/common.php on line 63 > > I checked the settings of my browser, it can accept > all cookies. > Someone help please!!! > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
> Hi, > I am trying to run a sample program. It connects to a > postgres database verifies user name and password and > if correct, displays the login screen. > But in that program wherever there there are > setcookies() or header() functions, I get following > error > > Warning: Cannot add header information - headers > already sent by (output started at > var/www/html/processing.php:5) in
> /var/www/html/common.php on line 63
Read the error message. Output started at var/www/html/processing.php:5. that means line 5 of that file output something to the browser, after which, you cannot send any cookies or headers.
---John Holmes...
attached mail follows:
You can't send headers after the page has left the server. If you try to write to the HTML file in ANY way, even a hard return in your code, then you are telling the server that the headers have been completed and should be sent to the client (browser).
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> Varsha Agarwal <agarwal_varsha
yahoo.com> 07/29/02 04:00PM >>>
Hi,
I am trying to run a sample program. It connects to a
postgres database verifies user name and password and
if correct, displays the login screen.
But in that program wherever there there are
setcookies() or header() functions, I get following
error
Warning: Cannot add header information - headers already sent by (output started at var/www/html/processing.php:5) in /var/www/html/common.php on line 63
I checked the settings of my browser, it can accept all cookies. Someone help please!!!
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
That's not entirely correct, though. If you are using output bufferng, then you can. Also, for example, say this is your file, with the makeshift line representing the top of the text editor:
¯------------Start------------
<?php header("Location: index.php?msg=blah"); ?> ¯-------------End------------
That will produce the same error as before, since a hard return was entered before the parser began it's work, therefore finishing the headers and sending the data to the client for rendering. Hope this clears something up :o)
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "Dennis Moore" <dmoore
ravens-nest.com> 07/29/02 04:18PM >>>
you cannot print or echo anything back to the browser before running the
header() function...
----- Original Message -----
From: "Varsha Agarwal" <agarwal_varsha
yahoo.com>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 4:00 PM
Subject: [PHP] Help Please
> Hi, > I am trying to run a sample program. It connects to a > postgres database verifies user name and password and > if correct, displays the login screen. > But in that program wherever there there are > setcookies() or header() functions, I get following > error > > Warning: Cannot add header information - headers > already sent by (output started at > var/www/html/processing.php:5) in > /var/www/html/common.php on line 63 > > I checked the settings of my browser, it can accept > all cookies. > Someone help please!!! > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi, I did not find any print or echo stetement in the sample example before hearder or setcookie function. Is there any way to find out what really is causing error or trace the program. Actually i am very new to this cookies and all stuff. Is there any way of tracing the program? I am using it on red hat 7.3.
--- Dennis Moore <dmoore
ravens-nest.com> wrote:
> you cannot print or echo anything back to the
> browser before running the
> header() function...
>
>
>
>
> ----- Original Message -----
> From: "Varsha Agarwal" <agarwal_varsha
yahoo.com>
> To: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 4:00 PM
> Subject: [PHP] Help Please
>
>
> > Hi,
> > I am trying to run a sample program. It connects
> to a
> > postgres database verifies user name and password
> and
> > if correct, displays the login screen.
> > But in that program wherever there there are
> > setcookies() or header() functions, I get
> following
> > error
> >
> > Warning: Cannot add header information - headers
> > already sent by (output started at
> > var/www/html/processing.php:5) in
> > /var/www/html/common.php on line 63
> >
> > I checked the settings of my browser, it can
> accept
> > all cookies.
> > Someone help please!!!
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - Feel better, live better
> > http://health.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
> -----Original Message-----
> From: Varsha Agarwal [mailto:agarwal_varsha
yahoo.com]
> Sent: Monday, July 29, 2002 4:27 PM
> To: Dennis Moore; php-general
lists.php.net
> Subject: Re: [PHP] Help Please
>
>
> Hi,
> I did not find any print or echo stetement in the
> sample example before hearder or setcookie function.
> Is there any way to find out what really is causing
> error or trace the program. Actually i am very new to
> this cookies and all stuff. Is there any way of
> tracing the program? I am using it on red hat 7.3.
Read the message php sent. The answer is there (line 63):
||| vvv
Warning: Cannot add header information - headers already sent by (output started at var/www/html/processing.php:5) in /var/www/html/common.php on line 63
attached mail follows:
Copy and paste the code (minus and indisclosurables) and we can take a look at it :o)
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> Varsha Agarwal <agarwal_varsha
yahoo.com> 07/29/02 04:27PM >>>
Hi,
I did not find any print or echo stetement in the
sample example before hearder or setcookie function.
Is there any way to find out what really is causing
error or trace the program. Actually i am very new to
this cookies and all stuff. Is there any way of
tracing the program? I am using it on red hat 7.3.
--- Dennis Moore <dmoore
ravens-nest.com> wrote:
> you cannot print or echo anything back to the
> browser before running the
> header() function...
>
>
>
>
> ----- Original Message -----
> From: "Varsha Agarwal" <agarwal_varsha
yahoo.com>
> To: <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 4:00 PM
> Subject: [PHP] Help Please
>
>
> > Hi,
> > I am trying to run a sample program. It connects
> to a
> > postgres database verifies user name and password
> and
> > if correct, displays the login screen.
> > But in that program wherever there there are
> > setcookies() or header() functions, I get
> following
> > error
> >
> > Warning: Cannot add header information - headers
> > already sent by (output started at
> > var/www/html/processing.php:5) in
> > /var/www/html/common.php on line 63
> >
> > I checked the settings of my browser, it can
> accept
> > all cookies.
> > Someone help please!!!
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - Feel better, live better
> > http://health.yahoo.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
>
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Show us the first 6 lines of processing.php.
---John Holmes...
----- Original Message -----
From: "Varsha Agarwal" <agarwal_varsha
yahoo.com>
To: "Dennis Moore" <dmoore
ravens-nest.com>; <php-general
lists.php.net>
Sent: Monday, July 29, 2002 4:27 PM
Subject: Re: [PHP] Help Please
> Hi,
> I did not find any print or echo stetement in the
> sample example before hearder or setcookie function.
> Is there any way to find out what really is causing
> error or trace the program. Actually i am very new to
> this cookies and all stuff. Is there any way of
> tracing the program? I am using it on red hat 7.3.
>
> --- Dennis Moore <dmoore
ravens-nest.com> wrote:
> > you cannot print or echo anything back to the
> > browser before running the
> > header() function...
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Varsha Agarwal" <agarwal_varsha
yahoo.com>
> > To: <php-general
lists.php.net>
> > Sent: Monday, July 29, 2002 4:00 PM
> > Subject: [PHP] Help Please
> >
> >
> > > Hi,
> > > I am trying to run a sample program. It connects
> > to a
> > > postgres database verifies user name and password
> > and
> > > if correct, displays the login screen.
> > > But in that program wherever there there are
> > > setcookies() or header() functions, I get
> > following
> > > error
> > >
> > > Warning: Cannot add header information - headers
> > > already sent by (output started at
> > > var/www/html/processing.php:5) in
> > > /var/www/html/common.php on line 63
> > >
> > > I checked the settings of my browser, it can
> > accept
> > > all cookies.
> > > Someone help please!!!
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Health - Feel better, live better
> > > http://health.yahoo.com
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit:
> > http://www.php.net/unsub.php
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
I seem to remember a previous thread about quotes and how much other
people are charging etc for PHP development. Someone posted a link to a
quote they had recently done, I am looking for a standard format that I
can use to send out my quotes with. Does anyone have anything like this
or remember the thread, I can't seem to find it.
Matt Babineau
MCWD / CCFD
-----------------------------------------
e: <mailto:matt
criticalcode.com> matt
criticalcode.com
p: 603.943.4237
w: <http://www.criticalcode.com/> http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
attached mail follows:
In the following article:
http://www.computerwoche.de/index.cfm?pageid=254&artid=38819&category=84
Zeev says that PHP5 is expected as early as 1stQ next year. Is there anything anywhere that discusses the new version and any new possible features?
Chris
attached mail follows:
You could join the developer's list and just read. I joined just to keep up with what's coming in future releases and it's also pretty interesting. They are constantly talking about what features/bugs need work and when they want to do a release and who will be on vacation and can't help and blah blah blah. I wouldn't recommend asking many questions though unless you want to get flamed. :-)
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Chris Boget" <chris
wild.net>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 3:23 PM
Subject: [PHP] PHP5?
> In the following article: > > http://www.computerwoche.de/index.cfm?pageid=254&artid=38819&category=84 > > Zeev says that PHP5 is expected as early as 1stQ next year. Is there anything > anywhere that discusses the new version and any new possible features? > > Chris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
If someone is going to be using scripts that they grabbed from a public forum (PHP Builder, PHPClasses, etc) in a commercial product (that is going to be compiled with the Zend encoder and released), what is the protocol, if any? Do you have to get permission from the author or anything? I've read a bit of the GNU Public liscence but I didn't come away knowing any more than went I started reading it. So I figure I'd ask here where I'm sure many of you have this type of experience.
Chris
attached mail follows:
> If someone is going to be using scripts that they grabbed > from a public forum (PHP Builder, PHPClasses, etc) in a > commercial product (that is going to be compiled with the > Zend encoder and released), what is the protocol, if any? > Do you have to get permission from the author or anything?
That depends on the type of license (of course). Some licenes are pretty hard to understand and you may have to ask a lawyer. However, there is an easy way: just ask the author of the script you're thinking about including in your product. He can probably tell you real quick (and free of charge) if you can use it in your commercial product.
-Jome
attached mail follows:
>If someone is going to be using scripts that they grabbed >from a public forum (PHP Builder, PHPClasses, etc) in a >commercial product (that is going to be compiled with the >Zend encoder and released), what is the protocol, if any? >Do you have to get permission from the author or anything? >I've read a bit of the GNU Public liscence but I didn't come >away knowing any more than went I started reading it. So >I figure I'd ask here where I'm sure many of you have this >type of experience.
If the source code in question has *NO* licensing/copyright notice, the author of the source holds the copyright, and you can't use it legally.
If the source code in question was published under GNU, you're bound by the GNU license, which I *THINK* let's you use it in a commercial release... You'd have to read up on the "examples" of what GNU does/doesn't allow. I think the FSF site might have some clear examples.
PHPBuilder itself may or may not require authors to agree that their source is under some particular license. You'd have to check each site to see for sure.
If in doubt, contact the author. Worst that can happen is they want some money, or you have to come up with a different solution. Odds are really really good that there is an alternative solution "out there" to almost *ANY* of the publicly available code in those forums, or that you could dig into them for the core of what they do and write your own from scratch.
-- 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 are many types of licensing and it really depends on what the author licensed it under. Most are GPL. Normally the first few lines of the LICENSE file typically included with the dist will explain the details of the license. If there is not one always assume that if you use any part of it in a commercial work you must also provide the original source code and the original license. This does *not* mean that you have to include *your* source code, but only the original source code. Some licenses are even more free than that but that is the standard.
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Chris Boget" <chris
wild.net>
To: "PHP General" <php-general
lists.php.net>
Sent: Monday, July 29, 2002 3:29 PM
Subject: [PHP] Public Scripts in a commercial product
> If someone is going to be using scripts that they grabbed > from a public forum (PHP Builder, PHPClasses, etc) in a > commercial product (that is going to be compiled with the > Zend encoder and released), what is the protocol, if any? > Do you have to get permission from the author or anything? > I've read a bit of the GNU Public liscence but I didn't come > away knowing any more than went I started reading it. So > I figure I'd ask here where I'm sure many of you have this > type of experience. > > Chris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
Uhhh.... but you really should ask the author too. ;-)
Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: "Tech Support" <jgrill
web-1hosting.net>
To: "Chris Boget" <chris
wild.net>; "PHP General"
<php-general
lists.php.net>
Sent: Monday, July 29, 2002 5:38 PM
Subject: Re: [PHP] Public Scripts in a commercial product
> There are many types of licensing and it really depends on what the author
> licensed it under. Most are GPL. Normally the first few lines of the
LICENSE
> file typically included with the dist will explain the details of the
> license. If there is not one always assume that if you use any part of it
in
> a commercial work you must also provide the original source code and the
> original license. This does *not* mean that you have to include *your*
> source code, but only the original source code. Some licenses are even
more
> free than that but that is the standard.
>
> Jim Grill
> Support
> Web-1 Hosting
> http://www.web-1hosting.net
> ----- Original Message -----
> From: "Chris Boget" <chris
wild.net>
> To: "PHP General" <php-general
lists.php.net>
> Sent: Monday, July 29, 2002 3:29 PM
> Subject: [PHP] Public Scripts in a commercial product
>
>
> > If someone is going to be using scripts that they grabbed
> > from a public forum (PHP Builder, PHPClasses, etc) in a
> > commercial product (that is going to be compiled with the
> > Zend encoder and released), what is the protocol, if any?
> > Do you have to get permission from the author or anything?
> > I've read a bit of the GNU Public liscence but I didn't come
> > away knowing any more than went I started reading it. So
> > I figure I'd ask here where I'm sure many of you have this
> > type of experience.
> >
> > Chris
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Thank everyone for suggestions.
I followed through on them but unsuccessfully. I looked for any mistake but couldn't find it. I tried commenting out lines in chunks and one by one, without any effect.
the problem stays the same, if the conditional statement is present then image is not generated, otherwise the code works and is generating an image. Also, the image is generating only in Netscape browzer?! Internet Explorer does not display the image at all, never, with or without conditional.
Is their some trick i need to know to display images both in netscape and iexplorer?
if smone would give it a shot i would be very thankfull! thnks in advance for your help.
---file counter.php --- <?php session_start();
//get stats info /* if ($_SERVER["QUERY_STRING"] != NULL ) { $from_page = $_GET["fp"]; $scr_width = $_GET["wd"]; $scr_height = $_GET["ht"]; $color_palt = $_GET["cl"]; $platform = $_GET["pl"]; $java = $_GET["jv"]; $taint = $_GET["tn"]; }//fi */ /* $this_page = $_SERVER["PHP_SELF"]; $address = $_SERVER["REMOTE_ADDR"]; $lang = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
if (!isset($from_page)) $from_page = $_SERVER["HTTP_REFERER"];
*/ // $bwzr_info = $_SERVER["HTTP_USER_AGENT"];
/* echo("previous page = $from_page <br>"); echo("current page = $this_page <br>"); echo("address = $address <br>"); echo("screen width = $scr_width <br>"); echo("screen height = $scr_height <br>"); echo("color pallette = $color_palt <br>"); echo("platform = $platform <br>"); echo("language = $lang <br>"); echo("browzer info = $bwzr_info <br>"); echo("java enabled = $java <br>"); echo("taint enabled = $taint <br>"); */ //--- LOG DATA INTO DATABASE ---// // todo //
//this is the begining of troublesome conditional statment if ( false ) { //echo("we here"); //$image = ImageCreate(1,1); //$navyblue = ImageColorAllocate($image, 0, 0, 0); //ImageFilledRectangle($image, 0, 0, 1, 1, $navyblue); } esle {
$web_uniqe_kount = sprintf("%07d", $_SESSION['web_uniqe_count']); $web_total_kount = sprintf("%07d", $_SESSION['web_total_count']); $web_print_kount = sprintf("%07d", $_SESSION['web_print_count']);
$office_uniqe_kount = sprintf("%07d", $_SESSION['office_uniqe_count']); $office_total_kount = sprintf("%07d", $_SESSION['office_total_count']); $office_print_kount = sprintf("%07d", $_SESSION['office_print_count']);
$uniqe_str = "Uniqe"; $total_str = "Total"; $print_str = "Print";
$web_head = "Web"; $office_head = "Office";
$header_length = 6; $column_length = 9;
$spacer = 1;
$font_size = 1; $charHeight = ImageFontHeight($font_size); $charWidth = ImageFontWidth($font_size);
$head_cell_Width = ($charWidth * $header_length) + (2 * $spacer); $numb_cell_Width = ($charWidth * $column_length) + (2 * $spacer); $cell_Height = $charHeight + (4 * $spacer);
$row_Width = $head_cell_Width + (2 * $numb_cell_Width); $row_Height = $cell_Height;
$column_Width = $numb_cell_Width; $column_Height = $cell_Height * 4;
$horizontalMargin = 1; $verticalMargin = 1;
$image_Width = $row_Width + (2 * horizontalMargin); $image_Height = $column_Height + (2 * verticalMargin);
//create blank image template with specified dimmentions $image = ImageCreate($image_Width, $image_Height);
//initiate color pallete to be used $black = ImageColorAllocate($image, 0, 0, 0); $white = ImageColorAllocate($image, 255, 255, 255); $red = ImageColorAllocate($image, 255, 0, 0);
//fill image background with black color ImageFilledRectangle($image, 0, 0, $imageWidth, $imageHeight, $black);
//set line style for the image $line_style = array($black, $black, $black, $black, $black, $red, $red, $red); ImageSetStyle($image, $line_style);
//--- DRAW THE IMAGE ---//
//draw the table $drawCoordinateX = $horizontalMargin; $drawCoordinateY = $verticalMargin + $cell_Height; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $image_Width-$horizontalMargin, $drawCoordinateY, IMG_COLOR_STYLED); $drawCoordinateY += $cell_Height; //ImageLine($image, $drawCoordinateX, $drawCoordinateY, $image_Width-$horizontalMargin, $drawCoordinateY, IMG_COLOR_STYLED); $drawCoordinateY += $cell_Height; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $image_Width-$horizontalMargin, $drawCoordinateY, IMG_COLOR_STYLED);
$drawCoordinateY = $verticalMargin; $drawCoordinateX = $horizontalMargin + $head_cell_Width; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $drawCoordinateX, $image_Height-$verticalMargin, IMG_COLOR_STYLED); $drawCoordinateX += $numb_cell_Width; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $drawCoordinateX, $image_Height-$verticalMargin, IMG_COLOR_STYLED);
ImageColorTransparent($image, $red);
//draw column headers $drawCoordinateX = $horizontalMargin + $head_cell_Width + $spacer; $drawCoordinateY = $verticalMargin + (2*$spacer); ImageString($image, $font_size, $drawCoordinateX+$numb_cell_Width-$spacer-$spacer-($charWidth*strlen($web_head)), $drawCoordinateY, $web_head, $white); $drawCoordinateX += $numb_cell_Width; ImageString($image, $font_size, $drawCoordinateX+$numb_cell_Width-$spacer-$spacer-($charWidth*strlen($office_head)), $drawCoordinateY, $office_head, $white);
//draw row headers $drawCoordinateX = $horizontalMargin + $spacer; $drawCoordinateY = $verticalMargin + $cell_Height + (2*$spacer); ImageString($image, $font_size, $drawCoordinateX, $drawCoordinateY, $uniqe_str, $white); $drawCoordinateY += $cell_Height; ImageString($image, $font_size, $drawCoordinateX, $drawCoordinateY, $total_str, $white); $drawCoordinateY += $cell_Height; ImageString($image, $font_size, $drawCoordinateX, $drawCoordinateY, $print_str, $white);
//draw the web stats $drawCoordinateX = $horizontalMargin + $head_cell_Width + $spacer; $drawCoordinateY = $verticalMargin + $cell_Height + (2*$spacer); $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($web_uniqe_kount)); ImageString($image, $font_size, $textCoordinateX, $drawCoordinateY, $web_uniqe_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($web_total_kount)); ImageString($image, $font_size, $textCoordinateX, $drawCoordinateY, $web_total_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($web_print_kount)); ImageString($image, $font_size, $textCoordinateX, $drawCoordinateY, $web_print_kount, $white);
//draw the office stats $drawCoordinateX = $horizontalMargin + $head_cell_Width + $numb_cell_Width + $spacer; $drawCoordinateY = $verticalMargin + $cell_Height + (2*$spacer); $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($office_uniqe_kount)); ImageString($image, $fonr_size, $textCoordinateX, $drawCoordinateY, $office_uniqe_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($office_total_kount)); ImageString($image, $fonr_size, $textCoordinateX, $drawCoordinateY, $office_total_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($office_print_kount)); ImageString($image, $fonr_size, $textCoordinateX, $drawCoordinateY, $office_print_kount, $white);
}//end of troublesome conditional stament
//interlace the image //ImageInterlace($image, 1);
//set background blak color to be transparent - NOT SUPPORTED on JPEG //ImageColorTransparent($image, $black);
//header("Content-type: image/jpeg"); //imagejpeg($image, "", 100);
header("Content-Type: image/png"); //header("Content-Disposition: inline; filename=counter.php"); ImagePng($image);
//have to destroy the image, otherwise will starve web-server of memory ImageDestroy($image);
?> --- end of counter.php file ---
Richard Lynch wrote:
> >I have a problem with conditional image generation. If I generate an > >image without any conditional statments, then everything works fine. But > >if i introduce conditional statment, then no image is generated in > >either case of the condition. > > > >Has anyone dealt with this dilema before? > > There's nothing "wrong" with the conditional idea, but you've just got a > mistake somewhere in your code. > > Surf to the image generation URL (the stuff you put after SRC= in your IMG > tag) and see what error messages you've got. > > -- > 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 you know you have a typo in that conditional there? Was that your real code? You misspelled 'else' as 'esle'.
-Joseph Rosenblum President, 25th Street Networks Get Easy, Reliable PHP Web Hosting at: http://www.25thstreet.net
-----Original Message-----
From: Alex Maslov [mailto:oiss
andromeda.rutgers.edu]
Sent: Monday, July 29, 2002 1:41 PM
To: php-general
lists.php.net
Subject: [PHP] Update of the problem w/ code - conditional image
generation problem?!
Thank everyone for suggestions.
I followed through on them but unsuccessfully. I looked for any mistake but couldn't find it. I tried commenting out lines in chunks and one by one, without any effect.
the problem stays the same, if the conditional statement is present then image is not generated, otherwise the code works and is generating an image. Also, the image is generating only in Netscape browzer?! Internet Explorer does not display the image at all, never, with or without conditional.
Is their some trick i need to know to display images both in netscape and iexplorer?
if smone would give it a shot i would be very thankfull! thnks in advance for your help.
---file counter.php --- <?php session_start();
//get stats info /* if ($_SERVER["QUERY_STRING"] != NULL ) { $from_page = $_GET["fp"]; $scr_width = $_GET["wd"]; $scr_height = $_GET["ht"]; $color_palt = $_GET["cl"]; $platform = $_GET["pl"]; $java = $_GET["jv"]; $taint = $_GET["tn"]; }//fi */ /* $this_page = $_SERVER["PHP_SELF"]; $address = $_SERVER["REMOTE_ADDR"]; $lang = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
if (!isset($from_page)) $from_page = $_SERVER["HTTP_REFERER"];
*/ // $bwzr_info = $_SERVER["HTTP_USER_AGENT"];
/* echo("previous page = $from_page <br>"); echo("current page = $this_page <br>"); echo("address = $address <br>"); echo("screen width = $scr_width <br>"); echo("screen height = $scr_height <br>"); echo("color pallette = $color_palt <br>"); echo("platform = $platform <br>"); echo("language = $lang <br>"); echo("browzer info = $bwzr_info <br>"); echo("java enabled = $java <br>"); echo("taint enabled = $taint <br>"); */ //--- LOG DATA INTO DATABASE ---// // todo //
//this is the begining of troublesome conditional statment if ( false ) { //echo("we here"); //$image = ImageCreate(1,1); //$navyblue = ImageColorAllocate($image, 0, 0, 0); //ImageFilledRectangle($image, 0, 0, 1, 1, $navyblue); } esle {
$web_uniqe_kount = sprintf("%07d", $_SESSION['web_uniqe_count']); $web_total_kount = sprintf("%07d", $_SESSION['web_total_count']); $web_print_kount = sprintf("%07d", $_SESSION['web_print_count']);
$office_uniqe_kount = sprintf("%07d", $_SESSION['office_uniqe_count']); $office_total_kount = sprintf("%07d", $_SESSION['office_total_count']); $office_print_kount = sprintf("%07d", $_SESSION['office_print_count']);
$uniqe_str = "Uniqe"; $total_str = "Total"; $print_str = "Print";
$web_head = "Web"; $office_head = "Office";
$header_length = 6; $column_length = 9;
$spacer = 1;
$font_size = 1; $charHeight = ImageFontHeight($font_size); $charWidth = ImageFontWidth($font_size);
$head_cell_Width = ($charWidth * $header_length) + (2 * $spacer); $numb_cell_Width = ($charWidth * $column_length) + (2 * $spacer); $cell_Height = $charHeight + (4 * $spacer);
$row_Width = $head_cell_Width + (2 * $numb_cell_Width); $row_Height = $cell_Height;
$column_Width = $numb_cell_Width; $column_Height = $cell_Height * 4;
$horizontalMargin = 1; $verticalMargin = 1;
$image_Width = $row_Width + (2 * horizontalMargin); $image_Height = $column_Height + (2 * verticalMargin);
//create blank image template with specified dimmentions $image = ImageCreate($image_Width, $image_Height);
//initiate color pallete to be used $black = ImageColorAllocate($image, 0, 0, 0); $white = ImageColorAllocate($image, 255, 255, 255); $red = ImageColorAllocate($image, 255, 0, 0);
//fill image background with black color ImageFilledRectangle($image, 0, 0, $imageWidth, $imageHeight, $black);
//set line style for the image $line_style = array($black, $black, $black, $black, $black, $red, $red, $red); ImageSetStyle($image, $line_style);
//--- DRAW THE IMAGE ---//
//draw the table $drawCoordinateX = $horizontalMargin; $drawCoordinateY = $verticalMargin + $cell_Height; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $image_Width-$horizontalMargin, $drawCoordinateY, IMG_COLOR_STYLED); $drawCoordinateY += $cell_Height; //ImageLine($image, $drawCoordinateX, $drawCoordinateY, $image_Width-$horizontalMargin, $drawCoordinateY, IMG_COLOR_STYLED); $drawCoordinateY += $cell_Height; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $image_Width-$horizontalMargin, $drawCoordinateY, IMG_COLOR_STYLED);
$drawCoordinateY = $verticalMargin; $drawCoordinateX = $horizontalMargin + $head_cell_Width; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $drawCoordinateX, $image_Height-$verticalMargin, IMG_COLOR_STYLED); $drawCoordinateX += $numb_cell_Width; ImageLine($image, $drawCoordinateX, $drawCoordinateY, $drawCoordinateX, $image_Height-$verticalMargin, IMG_COLOR_STYLED);
ImageColorTransparent($image, $red);
//draw column headers $drawCoordinateX = $horizontalMargin + $head_cell_Width + $spacer; $drawCoordinateY = $verticalMargin + (2*$spacer); ImageString($image, $font_size, $drawCoordinateX+$numb_cell_Width-$spacer-$spacer-($charWidth*strlen($we b_head)), $drawCoordinateY, $web_head, $white); $drawCoordinateX += $numb_cell_Width; ImageString($image, $font_size, $drawCoordinateX+$numb_cell_Width-$spacer-$spacer-($charWidth*strlen($of fice_head)), $drawCoordinateY, $office_head, $white);
//draw row headers $drawCoordinateX = $horizontalMargin + $spacer; $drawCoordinateY = $verticalMargin + $cell_Height + (2*$spacer); ImageString($image, $font_size, $drawCoordinateX, $drawCoordinateY, $uniqe_str, $white); $drawCoordinateY += $cell_Height; ImageString($image, $font_size, $drawCoordinateX, $drawCoordinateY, $total_str, $white); $drawCoordinateY += $cell_Height; ImageString($image, $font_size, $drawCoordinateX, $drawCoordinateY, $print_str, $white);
//draw the web stats $drawCoordinateX = $horizontalMargin + $head_cell_Width + $spacer; $drawCoordinateY = $verticalMargin + $cell_Height + (2*$spacer); $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($web_uniqe_kount)); ImageString($image, $font_size, $textCoordinateX, $drawCoordinateY, $web_uniqe_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($web_total_kount)); ImageString($image, $font_size, $textCoordinateX, $drawCoordinateY, $web_total_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($web_print_kount)); ImageString($image, $font_size, $textCoordinateX, $drawCoordinateY, $web_print_kount, $white);
//draw the office stats $drawCoordinateX = $horizontalMargin + $head_cell_Width + $numb_cell_Width + $spacer; $drawCoordinateY = $verticalMargin + $cell_Height + (2*$spacer); $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($office_uniqe_kount)); ImageString($image, $fonr_size, $textCoordinateX, $drawCoordinateY, $office_uniqe_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($office_total_kount)); ImageString($image, $fonr_size, $textCoordinateX, $drawCoordinateY, $office_total_kount, $white);
$drawCoordinateY += $cell_Height; $textCoordinateX = $drawCoordinateX + $numb_cell_Width - (2 * $spacer) - ($charWidth*strlen($office_print_kount)); ImageString($image, $fonr_size, $textCoordinateX, $drawCoordinateY, $office_print_kount, $white);
}//end of troublesome conditional stament
//interlace the image //ImageInterlace($image, 1);
//set background blak color to be transparent - NOT SUPPORTED on JPEG //ImageColorTransparent($image, $black);
//header("Content-type: image/jpeg"); //imagejpeg($image, "", 100);
header("Content-Type: image/png"); //header("Content-Disposition: inline; filename=counter.php"); ImagePng($image);
//have to destroy the image, otherwise will starve web-server of memory ImageDestroy($image);
?> --- end of counter.php file ---
Richard Lynch wrote:
> >I have a problem with conditional image generation. If I generate an > >image without any conditional statments, then everything works fine. But > >if i introduce conditional statment, then no image is generated in > >either case of the condition. > > > >Has anyone dealt with this dilema before? > > There's nothing "wrong" with the conditional idea, but you've just got a > mistake somewhere in your code. > > Surf to the image generation URL (the stuff you put after SRC= in your IMG > tag) and see what error messages you've got. > > -- > 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:
On Tuesday 30 July 2002 04:47, Joseph Rosenblum wrote: > Do you know you have a typo in that conditional there? Was that your > real code? You misspelled 'else' as 'esle'.
(To OP): If you're going to post code that you want someone to debug, please copy & paste. Introducing spurious typos wastes everybody's time.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* CHUBBY CHECKER just had a CHICKEN SANDWICH in downtown DULUTH! */
attached mail follows:
I am having a problem passing a variable from PHP to Javascript and getting my JS function to recognize a form element object. I am trying to use the selection of a particular option in a dropdown menu to control the visibility of another form control element (another select box). In other words, when the user selects the third option in the menu named "petsubtype" , the menu named "chonpetsub" should become visible. Similarly, if the third option is deselected, the latter menu should once again disappear. When I click on any of the options in the first menu (i.e., "petsubtype"), I get a Javascript warning that says "elementname.length is null or not an object". Any help would be greatly appreciated.
Thanks in advance, Bill
//************************************************************************** ***************************
function PetSubToggle(id, elementname, form) {
alert("Function call here successful");
for(var i=0; i<form.elementname.length; i++){
//alert("starting to cycle through loop");
if (form.elementname.options[i].selected == true){
//alert("a selected choice is true");
if(i==3){
if(document.getElementById(id).style.visibility){
if(document.getElementById(id).style.getAttribute("visibility")=="hidden"){
document.getElementById(id).style.setAttribute("visibility",visible)}
else if(document.getElementById(id).style.getAttribute("visibility")=="visible"){
document.getElementById(id).style.setAttribute("visibility",hidden)}
else {
alert("Your browser does not support proper display of this menu, please upgrade or change browsers.")};
}
}
}
}
return false
}
</SCRIPT>
<!-- //************************************************************************** ****************************
-->
<SCRIPT language="php">
require 'dhtml_functions.inc';
require 'meteor_data_arrays.inc';
//************************************************************************** ****************************
$petsubname="petsubtype"; //used below to assign an name the the petsub div id
$elementname="chonpet"; //add column for petrologic types
$elementsarray="$chon_pet"; //an associative array
echo "<form>";
echo "<table><tr><td>";
echo "<select name='$petsubname'
id='$elementname'
multiple
size='5'
onChange='PetSubToggle($petsubname, $elementname, this.form)'>";
//display petro types in option list, beginning with select all
echo "<option value='$chon_pet[8]' selected>$chon_pet[8]</option>";
echo "<option value='$chon_pet[1]'>$chon_pet[1]</option>";
echo "<option value='$chon_pet[2]'>$chon_pet[2]</option>";
echo "<option value='$chon_pet[3]'>$chon_pet[3]</option>";
echo "<option value='$chon_pet[4]'>$chon_pet[4]</option>";
echo "<option value='$chon_pet[5]'>$chon_pet[5]</option>";
echo "<option value='$chon_pet[6]'>$chon_pet[6]</option>";
echo "<option value='$chon_pet[7]'>$chon_pet[7]</option>";
echo "</select>";
//************************************************************************** ****************************
echo "</td><td>";
echo "<div id='$petsubname' style='position:relative;left:0px;top:0px;visibility:hidden'>";
echo "<select name='chonpetsub' id='chonpetsub' multiple size='5'>";
echo "<option value='1'>3.1</option>";
echo "<option value='2'>3.2</option>";
echo "<option value='3'>3.3</option>";
echo "<option value='4'>3.4</option>";
echo "<option value='5'>3.5</option>";
echo "<option value='6'>3.6</option>";
echo "<option value='7'>3.7</option>";
echo "<option value='8'>3.8</option>";
echo "<option value='9'>3.9</option>";
echo "<option value='10'>All Types</option>";
echo "</select>";
echo "</div>";
echo "</td></tr></table></form>";
//************************************************************************** ****************************
</SCRIPT>
attached mail follows:
>echo "<option value='$chon_pet[7]'>$chon_pet[7]</option>";
JavaScript won't let you use [] in a name, so you'll have to refer to the elements by number.
-- 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 use cookies for logins (I would use sessions, but the free host this site is on doesn't support them). With all of the bugs in various browsers influencing cookies, what does everyone think is the most compatible way to set cookies?
attached mail follows:
Is it really necessary to store passwords encrypted in a mySQL DB for a membership site if you're not storing sensitive info such as credit card numbers? How much security does that offer, really, and for whom?
The reason I ask is because I'm trying to implement a "forgot password" feature on a membership site. But if I store passwords encrypted, I can't just send the password to their e-mail address, I have to generate a new one before sending it, which essentially locks that member out of the site until they get their new password. This has the potential to be abused by a vindictive person. All they need to know is the member's username or e-mail address and they can keep re-generating new passwords (locking the member out of their own account) for a member to annoy them.
If the password wasn't encrypted, I could just e-mail their existing password. The only annoyance then would be someone sending this password over and over to another user, but, at least they won't get 20 new passwords and be locked out of their account as a result.
If anyone else has dealt with this issue, I'd appreciate your insight.
Thanks!
Monty
attached mail follows:
> Is it really necessary to store passwords encrypted in a mySQL DB for a > membership site if you're not storing sensitive info such as credit card > numbers? How much security does that offer, really, and for whom?
The most important reason in my humble opinion is that users may use the same password for serveral sites and therefor he or she can feel safe that his password isn't abused, even if a hacker grabs the database. For passwords under 128 chars, md5() is a pretty good solution.
> The reason I ask is because I'm trying to implement a "forgot password" > feature on a membership site. But if I store passwords encrypted, I can't > just send the password to their e-mail address, I have to generate a new one > before sending it, which essentially locks that member out of the site until > they get their new password. This has the potential to be abused by a > vindictive person. All they need to know is the member's username or e-mail > address and they can keep re-generating new passwords (locking the member > out of their own account) for a member to annoy them. > > If the password wasn't encrypted, I could just e-mail their existing > password. The only annoyance then would be someone sending this password > over and over to another user, but, at least they won't get 20 new passwords > and be locked out of their account as a result.
This can be more or less resolved, there's almost impossible to fully protect your site from abuse but you could for example implement something like max one new password per day. Another way could be to add an additional detail, like postal code or something which is easy for user to determine but (probably) not for other people.
My $0.02
-Jome
attached mail follows:
On Mon, 29 Jul 2002, Monty wrote:
> Is it really necessary to store passwords encrypted in a mySQL DB for a > membership site if you're not storing sensitive info such as credit card > numbers? How much security does that offer, really, and for whom?
I'm going to go with "YES" on this one. The problem with being able to retrieve actual passwords from your database is this: Most people re-use passwords across multiple applications. So, while you may fully intend to stash passwords access to only your application, you may actually be storing passwords to people's online banks, work logons, pr0n sites, etc.
You can save yourself a lot of time in the future by taking a little time now to make sure that plain-text passwords are not retrievable from your application/database. If your database server were to be compromised, you can rest assured that you didn't leak any passwords. Otherwise, you'll have to really worry that somebody didn't walk away with a list of names, usernames and passwords that could be used elsewhere.
> The reason I ask is because I'm trying to implement a "forgot password" > feature on a membership site. But if I store passwords encrypted, I can't > just send the password to their e-mail address, I have to generate a new one > before sending it, which essentially locks that member out of the site until > they get their new password. This has the potential to be abused by a > vindictive person. All they need to know is the member's username or e-mail > address and they can keep re-generating new passwords (locking the member > out of their own account) for a member to annoy them.
While this is true, what I've found in practice is that this rarely happens (actually hasn't happend yet, for my sites ... knock on wood). If you find that this becomes a problem, some logic around how often, and by what method passwords can be changed may help alleviate the problem.
g.luck, ~Chris
attached mail follows:
Ok, here's how I do it:
1. User clicks the lost password page: 2. Email is sent to user's registered email address. Email contains a url to the newpassword page and has a validation code. This validation code is also stored in the userinfo table (it's the MD5 of current date + time + random chars). 3. User clicks link and is taken to page. 4. If the supplied validation code checks out, the user gets to pick a new password there and then. 5. If the user didn't want to change the password (i.e.. the abuse scenario you talked of) they simply ignore the email - no change occurs.
So : The passwords can be encrypted in the database. The system is difficult to abuse. Passwords are never sent out over email. User gets to choose own password.
Well it works for me anyway :)
HTH
Danny.
----- Original Message -----
From: "Monty" <monty3
hotmail.com>
To: <php-general
lists.php.net>
Sent: Monday, July 29, 2002 10:30 PM
Subject: [PHP] Encrypting Passwords - Is it really necessary??
> Is it really necessary to store passwords encrypted in a mySQL DB for a > membership site if you're not storing sensitive info such as credit card > numbers? How much security does that offer, really, and for whom? > > The reason I ask is because I'm trying to implement a "forgot password" > feature on a membership site. But if I store passwords encrypted, I can't > just send the password to their e-mail address, I have to generate a new one > before sending it, which essentially locks that member out of the site until > they get their new password. This has the potential to be abused by a > vindictive person. All they need to know is the member's username or e-mail > address and they can keep re-generating new passwords (locking the member > out of their own account) for a member to annoy them. > > If the password wasn't encrypted, I could just e-mail their existing > password. The only annoyance then would be someone sending this password > over and over to another user, but, at least they won't get 20 new passwords > and be locked out of their account as a result. > > If anyone else has dealt with this issue, I'd appreciate your insight. > > Thanks! > > Monty > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
On Mon, 29 Jul 2002 17:30:48 -0400, you wrote:
>Is it really necessary to store passwords encrypted in a mySQL DB for a >membership site if you're not storing sensitive info such as credit card >numbers? How much security does that offer, really, and for whom? [...] >The reason I ask is because I'm trying to implement a "forgot password" >feature on a membership site. [...]
My two cents...
I'm generally in favor of encrypting passwords, for the same reason that another poster mentioned: People use the same password for multiple accounts/sites/etc. I know that I do. And if I knew that I just signed up for some account/service and the people hosting it were storing my password in plain text, I would be a bit perturbed. I would think them at least amateurish, probably careless, and possibly untrustworthy.
With that said, sometimes plain text passwords are called for. But when you use them make *certain* you inform the user when they sign up. For example, many mailing lists store passwords in plain text and email you a reminder, with your password, at a certain interval. These mailing lists usually warn you in advance to not use one of your secure passwords, since it will occasionally be emailed in plain text. This is an example of where storing in plain text is fine, because mailing lists aren't critical things, and the convience of being able to remind people what their password is outweighs any security concerns.
If you decide that you want to encrypt the passwords, but you still want a secure way to remind people what their password is, you can either use the unique authorization code method that one other poster mentioned (I have some Perl code that handles that for a project I'm working on, if you're interested), OR you can use the secret question secret answer method. This is where you ask the user to enter a secret question such as mother's maiden name, favorite color, etc. and also to enter the answer. Then later you can ask them the question and compare their answer to determine if they are who they say they are...
HTH
attached mail follows:
Richard Lynch wrote:
>But Cookies sent to the HTTPS are not on the HTTP and vice versa. > >That ain't PHP, that's just how cookies work. >
Are you sure about this? That's definitely not how the specification reads (assuming I'm interpreting what you're trying to say correctly), and that is not what my experience has shown either.
A secure cookie will only be transmitted when the request is being sent over a secure connection, but an ordinary cookie does not carry this restriction and would thus not care whether the connection was secure. As someone else suggested, if the domain name is changing, then that is the access restriction that is keeping the cookie from being sent, not whether the connection is secure.
Happy hacking.
Chris
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. > :-)
Ok i followed what you have suggested and Apache didn't spit out anything on libphp4.so so I am lead to beleave it wasn't created..
my apache config like was
#./configure --enable-module=most --enable-shared=max --activate-module=src/ modules/php4/libphp4.a
cheers Peter
attached mail follows:
Look at the HTML_TreeMenu http://pear.php.net/package-info.php?pacid=77.
>>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.
RL> Are you browsing the files across an HTTP connection?
RL> Cuz all the little triangles and stuff are gonna get dog-slow for most RL> users...
RL> Every single click will probably require another HTTP request...
RL> At any rate, search the code archives listed at: RL> http://php.net/links.php
RL> If you are using PHP to do this locally, it seems kinda silly to do, but RL> maybe a PHP-GTK solution is out there for it.
-- Best regards, Evgeny mailto:geckabaik.ru
attached mail follows:
Hi Folks:
I'm happy to announce the latest versions of my Credit Card Validation Solution. This includes a new JSP Edition and reworking the PHP and Perl Editions into an Object Oriented paradigm.
If you're using a version prior to the following, please upgrade: Ed. Ver URI ---- --- --- JSP 4.2 http://www.analysisandsolutions.com/code/ccvs-jsp.htm Perl 4.7 http://www.analysisandsolutions.com/code/ccvs-pl.htm PHP 4.4 http://www.analysisandsolutions.com/code/ccvs-ph.htm
An older version of it is also available for Visual Basic at http://www.analysisandsolutions.com/code/ccvs-vb.htm
If you're not familliar with these scripts, here's a quick description:
It ensures credit card numbers are keyed in correctly. Includes checks that the length is correct, the first four digits are within accepted ranges, the number passes the Mod 10 Checksum and that you accept the given type of card. Just to be clear, this process does not check with banks or credit card companies to see if the card number given is actually associated with a good account. It just checks to see if the number matches the expected format.
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:
Hi, I tried to display phpinfo and I am getting following values
display_errors On On display_startup_errors On On
error_append_string no value no value error_log no value no value error_prepend_string no value no value error_reporting 1 1
(Still there is no display of error)
sendmail_from me
localhost.com me
localhost.com
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
short_open_tag On On
SMTP localhost localhost
I changed the script as follows, now it is giving error that - can not even queue - btw where the queue is stored ? and where can I see the sendmail log ?
<? $mailBody = "This is test email";
$boolMail = mail ("manisha
aurica.com", "Test mail subj from local linux
server - PHP", $mailBody);
if ($boolMail){
print "Email has been queued.";
}
else{
print "Can not even queue email";
}
?>
I tried giving mail directly from sendmail going to /usr/sbin - I am not sure how to give commands in unix but I tried following block,
---------------------------
shell>cd /usr/sbin
shell>sendmail manisha
From: manisha
aurica.com
To: manisha
aurica.com
Subject: Test from new aurica
kl;efkvg;lkf
rkfkrjek
sdjkfjsd
^D - to terminate it
message given - Failed to send message to any users
--------------------------------
Now how shall I proceed ?
Thanks and regards Manisha
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]