OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 3 Jun 2003 13:16:35 -0000 Issue 2095

php-general-digest-helplists.php.net
Date: Tue Jun 03 2003 - 08:16:35 CDT


php-general Digest 3 Jun 2003 13:16:35 -0000 Issue 2095

Topics (messages 149864 through 149953):

affiliate program? please share your experience - i need as much as possible
        149864 by: hui zhang

Supplied argument is not a valid MySQL result resource
        149865 by: Kurosh Burris
        149868 by: John W. Holmes
        149876 by: Hugh Danaher
        149881 by: Kurosh Burris
        149884 by: Kurosh Burris

How to delete a line in a TXT-file
        149866 by: poetbox
        149893 by: Jason Wong
        149927 by: poetbox

Re: A recommended barcode program
        149867 by: Manuel Lemos

Session to Secure Form
        149869 by: Ralph
        149914 by: Marek Kilimajer

Classes vs. functions?
        149870 by: Vijay Avarachen
        149877 by: Steven Walker
        149890 by: olinux

Re: Planning a new job
        149871 by: Jaap van Ganswijk
        149873 by: Ralph
        149938 by: Adam Reiswig

write to a CSV file
        149872 by: hui zhang
        149911 by: Marek Kilimajer

session not persisting
        149874 by: Eric D.

php session not persisting
        149875 by: Eric D.
        149889 by: Jason Wong
        149949 by: Ed Gorski

IDENTIFICATON
        149878 by: Dale

LoadModule Help
        149879 by: tmcclelland
        149894 by: sven

Re: What Visual PHP Edit ?
        149880 by: agus
        149941 by: Miles Thompson

Broken links report
        149882 by: Kjell Hansen
        149883 by: Kjell Hansen
        149895 by: Ernest E Vogelsinger
        149896 by: John Coggeshall

Re: Cookies and Sessions: What's the Best Recipe?
        149885 by: Monty
        149887 by: Justin French
        149925 by: Ford, Mike [LSS]
        149933 by: Justin French

MOUNT RAID !!!!
        149886 by: nabil

How to remove empty Session Var from URL
        149888 by: Monty

Auto refresh
        149891 by: Kurosh Burris
        149898 by: Jakob Mund

Re: Cookie security
        149892 by: SLanger.spirit21.de

on-line
        149897 by: Diana Castillo

Re: foreach and mysql_fetch_array problem
        149899 by: Bix
        149910 by: Marek Kilimajer
        149915 by: Bix
        149916 by: Bix
        149921 by: Marek Kilimajer
        149948 by: Bix

Validating user input
        149900 by: Shaun
        149902 by: electroteque
        149903 by: John Coggeshall
        149909 by: Sichta Daniel
        149928 by: Ford, Mike [LSS]

getimagesize
        149901 by: Diana Castillo
        149904 by: electroteque
        149906 by: John Coggeshall

Problem on Date Function
        149905 by: Jack
        149907 by: Jason Wong
        149908 by: sven
        149931 by: George Nicolae

determine action of a form dynamically?
        149912 by: Mukta Telang
        149913 by: Jon Haworth

heavy traffic portal site
        149917 by: Adrian Teasdale
        149919 by: Mark
        149923 by: Adrian Teasdale

Re: CR in MySQL?
        149918 by: Ford, Mike [LSS]

Re: regex problem
        149920 by: Ford, Mike [LSS]

Re: Shipping Rates
        149922 by: Ford, Mike [LSS]

Re: general questions
        149924 by: Ford, Mike [LSS]

Problem with PHP
        149926 by: Roman Duriancik

Full path to download !!!
        149929 by: fr r
        149930 by: fr r

downloading XML file
        149932 by: Sichta Daniel
        149935 by: Marek Kilimajer

Link to a Site
        149934 by: Mishari
        149936 by: Marek Kilimajer
        149946 by: Marek Kilimajer
        149947 by: Mishari

Variables changes their values
        149937 by: Svein Larsen
        149939 by: Jay Blanchard
        149940 by: John W. Holmes
        149942 by: Svein Larsen

How to echo raw post message using php://input
        149943 by: XiongWei

Secure Page Problem
        149944 by: Ralph

convert seconds to hours, minutes, seconds
        149945 by: Chinmoy Barua
        149950 by: Jon Haworth
        149951 by: Bas Jobsen
        149952 by: Jakob Mund
        149953 by: John W. Holmes

Administrivia:

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

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

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

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

attached mail follows:


Any people can recommend to me any affiliate programs, such as php affiliate
and others in the hotscripts/php/affilate category? share your experience?
thanks.

Sorry if you see this post by me before. My original post was followed and
"answered" by non related response and it is not answered.

Thanks! I tried everywhere. But it seems not too many help on the
affiliate program topics.

Thanks again.

attached mail follows:


Hi Everyone,

I'm trying to get a very simple "sum" of the values in an MySQL database
field column. I have very little experience with PHP and SQL, but I learn
quickly. :) Our resident PHP expert who built the full script is really
busy, so I've been trying to do this myself. The farthest I could get from
just reading various posts in other forums was:

$SelectQuery = new Query ("SELECT SUM(GiftSubscriptions) AS GiftSubs FROM
Registration");
$Result = mysql_query($SelectQuery);
$Value = mysql_fetch_array($Result);
echo $Value['GiftSubs'];

However, I'm getting this error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource

Can someone tell me what's wrong with this part of the code?

Thanks,
Kurosh

attached mail follows:


> I'm trying to get a very simple "sum" of the values in an MySQL
database
> field column. I have very little experience with PHP and SQL, but I
learn
> quickly. :) Our resident PHP expert who built the full script is
really
> busy, so I've been trying to do this myself. The farthest I could get
> from
> just reading various posts in other forums was:
>
> $SelectQuery = new Query ("SELECT SUM(GiftSubscriptions) AS GiftSubs
FROM
> Registration");
> $Result = mysql_query($SelectQuery);
> $Value = mysql_fetch_array($Result);
> echo $Value['GiftSubs'];
>
> However, I'm getting this error:
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result
> resource
>
> Can someone tell me what's wrong with this part of the code?

You're query is failing. Use mysql_error() to find out why (probably
because you need a GROUP BY clause).

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

attached mail follows:


try something simpler and see if it passes:

$SelectQuery="SELECT SUM(GiftSubscriptions) AS GiftSubs FROM Registration";
$Result = mysql_query($SelectQuery) or die("Something died in here!
".mysql_error());

----- Original Message -----
From: "Kurosh Burris" <kuroshrogers.com>
To: <php-generallists.php.net>
Sent: Monday, June 02, 2003 7:54 PM
Subject: [PHP] Supplied argument is not a valid MySQL result resource

> Hi Everyone,
>
> I'm trying to get a very simple "sum" of the values in an MySQL database
> field column. I have very little experience with PHP and SQL, but I learn
> quickly. :) Our resident PHP expert who built the full script is really
> busy, so I've been trying to do this myself. The farthest I could get
from
> just reading various posts in other forums was:
>
> $SelectQuery = new Query ("SELECT SUM(GiftSubscriptions) AS GiftSubs FROM
> Registration");
> $Result = mysql_query($SelectQuery);
> $Value = mysql_fetch_array($Result);
> echo $Value['GiftSubs'];
>
> However, I'm getting this error:
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
> resource
>
> Can someone tell me what's wrong with this part of the code?
>
> Thanks,
> Kurosh
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hi Hugh,

Thanks, so far so good... no error messages. What next to get it to display
the total properly?

BTW, I changed "$SelectQuery" to "$TestSub" since "$SelectQuery" is used
repeatedly in this script, and I figured it might conflict if I didn't use
the "new Query" part.

Kurosh

-----Original Message-----
From: Hugh Danaher [mailto:hdanaherearthlink.net]
Sent: Tuesday, June 03, 2003 12:53 AM
To: Kurosh Burris
Cc: php-generallists.php.net
Subject: Re: [PHP] Supplied argument is not a valid MySQL result resource

try something simpler and see if it passes:

$SelectQuery="SELECT SUM(GiftSubscriptions) AS GiftSubs FROM Registration";
$Result = mysql_query($SelectQuery) or die("Something died in here!
".mysql_error());

----- Original Message -----
From: "Kurosh Burris" <kuroshrogers.com>
To: <php-generallists.php.net>
Sent: Monday, June 02, 2003 7:54 PM
Subject: [PHP] Supplied argument is not a valid MySQL result resource

> Hi Everyone,
>
> I'm trying to get a very simple "sum" of the values in an MySQL database
> field column. I have very little experience with PHP and SQL, but I learn
> quickly. :) Our resident PHP expert who built the full script is really
> busy, so I've been trying to do this myself. The farthest I could get
from
> just reading various posts in other forums was:
>
> $SelectQuery = new Query ("SELECT SUM(GiftSubscriptions) AS GiftSubs FROM
> Registration");
> $Result = mysql_query($SelectQuery);
> $Value = mysql_fetch_array($Result);
> echo $Value['GiftSubs'];
>
> However, I'm getting this error:
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
> resource
>
> Can someone tell me what's wrong with this part of the code?
>
> Thanks,
> Kurosh
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hi Hugh,

I added back in the other two lines, and it's working now... not sure why,
though.

Thanks,
Kurosh

-----Original Message-----
From: Hugh Danaher [mailto:hdanaherearthlink.net]
Sent: Tuesday, June 03, 2003 12:53 AM
To: Kurosh Burris
Cc: php-generallists.php.net
Subject: Re: [PHP] Supplied argument is not a valid MySQL result resource

try something simpler and see if it passes:

$SelectQuery="SELECT SUM(GiftSubscriptions) AS GiftSubs FROM Registration";
$Result = mysql_query($SelectQuery) or die("Something died in here!
".mysql_error());

----- Original Message -----
From: "Kurosh Burris" <kuroshrogers.com>
To: <php-generallists.php.net>
Sent: Monday, June 02, 2003 7:54 PM
Subject: [PHP] Supplied argument is not a valid MySQL result resource

> Hi Everyone,
>
> I'm trying to get a very simple "sum" of the values in an MySQL database
> field column. I have very little experience with PHP and SQL, but I learn
> quickly. :) Our resident PHP expert who built the full script is really
> busy, so I've been trying to do this myself. The farthest I could get
from
> just reading various posts in other forums was:
>
> $SelectQuery = new Query ("SELECT SUM(GiftSubscriptions) AS GiftSubs FROM
> Registration");
> $Result = mysql_query($SelectQuery);
> $Value = mysql_fetch_array($Result);
> echo $Value['GiftSubs'];
>
> However, I'm getting this error:
>
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
> resource
>
> Can someone tell me what's wrong with this part of the code?
>
> Thanks,
> Kurosh
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Hi all,
  I've been having trouble to delete a line from a TXT-file for days.
  The content of the text file just like below:
---------------------------begin==>
00145|test|line1
00255|test|line1
01143|test|line1
00469|test|line1
10146|test|line1
--------------------------<==end

Every line begins with a random number.I read the file (named THIS.TXT) from a simple program just like this:

---------------------------begin==>
$news=file("this.txt");
$num=count($news);

echo "<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 width=100% bgColor=#efefef border=1>";
for($i=0;$i<$num;$i++)
{
$message=explode("|",$news[$i]);
$id=$message[0];
$title=$message[1];
$time=$message[3];
$bgcol = (($i % 2) == 0) ? "CCCCCC": "EEEEEE";
echo "<tr bgcolor='#{$bgcol}'><td>¡ù <a href=zcfgcont.php?id=$id>$title</a></td><td>";
echo "<a href=del.php>DELETE THIS LINE</a>";//HOW TO WRITE THIS LINE??HOW TO achieve the function?
echo "</td></tr>";
}
echo "</table>";
--------------------------<==end
#################################################
*********The PROBLEM is:How to WRITE A FILE named del.php or WRITE A FUNCTION() to delete this line?
My opinion is to read the content to a array and write any line but" $id=$id" line,but I delete all the content by this,what should I do?
It's the first time I ask a question by the MAIL-LIST,my Enlish is poor,sorry.
Thank you very much in advance.

 

                                 

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡phplistenorth.com.cn
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-03

attached mail follows:


On Tuesday 03 June 2003 11:11, poetbox wrote:

> I've been having trouble to delete a line from a TXT-file for days.
> The content of the text file just like below:
> ---------------------------begin==>
> 00145|test|line1
> 00255|test|line1
> 01143|test|line1
> 00469|test|line1
> 10146|test|line1
> --------------------------<==end
>
> Every line begins with a random number.I read the file (named THIS.TXT)
> from a simple program just like this:
>
> ---------------------------begin==>
> $news=file("this.txt");
> $num=count($news);
>
> echo "<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 width=100%
> bgColor=#efefef border=1>"; for($i=0;$i<$num;$i++)
> {
> $message=explode("|",$news[$i]);
> $id=$message[0];
> $title=$message[1];
> $time=$message[3];
> $bgcol = (($i % 2) == 0) ? "CCCCCC": "EEEEEE";
> echo "<tr bgcolor='#{$bgcol}'><td>¡ù <a
> href=zcfgcont.php?id=$id>$title</a></td><td>"; echo "<a href=del.php>DELETE
> THIS LINE</a>";//HOW TO WRITE THIS LINE??HOW TO achieve the function? echo
> "</td></tr>";
> }
> echo "</table>";
> --------------------------<==end
> #################################################
> *********The PROBLEM is:How to WRITE A FILE named del.php or WRITE A
> FUNCTION() to delete this line? My opinion is to read the content to a
> array and write any line but" $id=$id" line,but I delete all the content
> by this,what should I do? It's the first time I ask a question by the
> MAIL-LIST,my Enlish is poor,sorry. Thank you very much in advance.

  "... but I delete all the content by this" Why?

In del.php you would read in the file using file() then write out any lines
not beginning with $id. So something like:

$news=file("this.txt");
$fp = fopen('outputfile', 'w');
foreach ($news as $line) {
  if (strpos($line, $_GET['id']) !== 0) {
    fwrite($fp, $line);
  }
}
fclose($fp);

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Rule of Creative Research:
        (1) Never draw what you can copy.
        (2) Never copy what you can trace.
        (3) Never trace what you can cut out and paste down.
*/

attached mail follows:


Jason Wong,ÄúºÃ£¡
 Let me go back to have a try,thank you very much!:)

 Some people told me to use unset(mixed var [,mixed var [,...]]) to delete it ,but I cannot understand anything about it .
        

======= 2003-06-03 16:04:00 £º=======

>On Tuesday 03 June 2003 11:11, poetbox wrote:
>
>> I've been having trouble to delete a line from a TXT-file for days.
>> The content of the text file just like below:
>> ---------------------------begin==>
>> 00145|test|line1
>> 00255|test|line1
>> 01143|test|line1
>> 00469|test|line1
>> 10146|test|line1
>> --------------------------<==end
>>
>> Every line begins with a random number.I read the file (named THIS.TXT)
>> from a simple program just like this:
>>
>> ---------------------------begin==>
>> $news=file("this.txt");
>> $num=count($news);
>>
>> echo "<TABLE borderColor=#ffffff cellSpacing=0 cellPadding=0 width=100
>> bgColor=#efefef border=1>"; for($i=0;$i<$num;$i++)
>> {
>> $message=explode("|",$news[$i]);
>> $id=$message[0];
>> $title=$message[1];
>> $time=$message[3];
>> $bgcol = (($i 2) == 0) ? "CCCCCC": "EEEEEE";
>> echo "<tr bgcolor='#{$bgcol}'><td>¡ù <a
>> href=zcfgcont.php?id=$id>$title</a></td><td>"; echo "<a href=del.php>DELETE
>> THIS LINE</a>";//HOW TO WRITE THIS LINE??HOW TO achieve the function? echo
>> "</td></tr>";
>> }
>> echo "</table>";
>> --------------------------<==end
>> #################################################
>> *********The PROBLEM is:How to WRITE A FILE named del.php or WRITE A
>> FUNCTION() to delete this line? My opinion is to read the content to a
>> array and write any line but" $id=$id" line,but I delete all the content
>> by this,what should I do? It's the first time I ask a question by the
>> MAIL-LIST,my Enlish is poor,sorry. Thank you very much in advance.
>
> "... but I delete all the content by this" Why?
>
>In del.php you would read in the file using file() then write out any lines
>not beginning with $id. So something like:
>
>$news=file("this.txt");
>$fp = fopen('outputfile', 'w');
>foreach ($news as $line) {
> if (strpos($line, $_GET['id']) !== 0) {
> fwrite($fp, $line);
> }
>}
>fclose($fp);
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.biz
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>------------------------------------------
>Search the list archives before you post
>http://marc.theaimsgroup.com/?l=php-general
>------------------------------------------
>/*
>Rule of Creative Research:
> (1) Never draw what you can copy.
> (2) Never copy what you can trace.
> (3) Never trace what you can cut out and paste down.
>*/
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

= = = = = = = = = = = = = = = = = = = =
                        

 
                                 
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡phplistenorth.com.cn
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-03

attached mail follows:


Hello,

On 06/02/2003 09:30 PM, Todd Cary wrote:
> I would like to have a reccommendation for a PHP class that generates a
> barcode.

Have you seen these?

Class: Barcode128 pattern compute class
http://www.phpclasses.org/barcode128

Class: BarcodeI25
http://www.phpclasses.org/barcode

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

attached mail follows:


I'm setting up a payment form on same server but different domain name,
and I need to pass the customers id that I have stored in a session so
that I can use it on the secure form to query the database for the
customers order.

What would be the best way for me to go about this?

attached mail follows:


If you can access the session data on the other domain, pass the session
id as a hidden form field.

Ralph wrote:
> I'm setting up a payment form on same server but different domain name,
> and I need to pass the customers id that I have stored in a session so
> that I can use it on the secure form to query the database for the
> customers order.
>
> What would be the best way for me to go about this?
>
>
>

attached mail follows:


I have been mostly using function in my php code, and lately I have been
curious about classes. I have a vague idea of classes from my C++ class
that I took a few years back. Can someone please explain to me when is a
class useful over a set of functions? I have seen very few code with
classes, so pretty much always stayed away from it.

Thanks,
Vijay Avarachen

attached mail follows:


> Can someone please explain to me when is a class useful over a set of
> functions?
Almost always. Object oriented programming offers many many advantages
(that I cannot get into depth on here). There are a few exceptions
where you would not use classes, such as utility functions like max()
and min() that would be used generically.

The most basic purpose of a class is to define your own 'type' of
object. When you create a class you are encapsulating an 'idea' into a
set of attributes and behaviors specific to that type.

Designing classes not only offers a great way of organizing code but
inevitably forces you to think thoroughly about the logical separation
of code and to refine more and more towards an idealized type with well
defined and sensible behavior. Conversely non-object oriented
programming tends to lack in clarity and intended usage, making it
difficult and confusing to use, getting exponentially worse for complex
problems.

Classes have methods (functions) that are designed to work specifically
on members of that class or perform operations directly related to it.
Plain functions, however, have a tendency to be vague and complicated
by argument lists. Furthermore they are easier to be misused and can be
prone to latent errors.

In the end, it's like driving a car: the engine is neatly hidden under
the hood and you don't care or want to know about the internal workings
of it. You just want to get in, turn the key and drive. Classes are no
different... they provide a simplified user-friendly interface to
complex things. It's luxury in programming :)

I would suggest getting some books to learn further, and just start
using classes.

Steven J. Walker
Walker Effects
www.walkereffects.com
stevewalkereffects.com

On Monday, June 2, 2003, at 08:31 PM, Vijay Avarachen wrote:

> I have been mostly using function in my php code, and lately I have
> been
> curious about classes. I have a vague idea of classes from my C++
> class
> that I took a few years back. Can someone please explain to me when
> is a
> class useful over a set of functions? I have seen very few code with
> classes, so pretty much always stayed away from it.
>
> Thanks,
> Vijay Avarachen
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


Here is an excellent article describing
classes/objects - what they are and are not.

http://phpmag.net/itr/online_artikel/psecom,id,284,nodeid,114.html

olinux

> > Can someone please explain to me when is a class
> useful over a set of
> > functions?

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

attached mail follows:


At 2003-06-03 09:15 +0930, Tim Burgan wrote:
>I'm wondering what processes everyone has before quoting a web programming /
>design job?
>
>Do you have a face-to-face meeting with the client?
>
>What questions do you ask?
>
>What information should be found-out about the job?
>
>Do I then go away and draw up a quote? or a quote and a proposal?
>
>Any help would be wonderful, thanks.

Have a look at:
http://www.hwg.org/ - The HTML Writers Guild

More specifically:
http://www.hwg.org/resources/ - FAQ's etc.
http://archives.hwg.org/hwg-business/ - Business aspects mailing list archive

Greetings,
Jaap

attached mail follows:


Tim,

This is really beyond the scope of this list, but I can help then it
doesn't matter. :-)

A few months ago I was asking myself the same questions you are asking
now. I found the following articles:

http://www.sitepoint.com/article/913

http://www.sitepoint.com/article/677

http://www.sitepoint.com/article/693

http://www.sitepoint.com/article/909

There is some valuable info on this site, you might want to look through
the rest of the articles under Sell Your Services, category:

http://www.sitepoint.com/cat/85

And if you want a book on the subject, take a look at:

Web ReDesign - Workflow the Works
By Kelly Goto & Emily Cotler

http://www.amazon.com/exec/obidos/tg/detail/-/0735710627/qid=1054614092/
sr=8-1/ref=sr_8_1/102-6577267-6528106?v=glance&s=books&n=507846

Hope this helps. Good luck.

Ralph

-----Original Message-----
From: Tim Burgan [mailto:burganiprimus.com.au]
Sent: Monday, June 02, 2003 4:45 PM
To: PHP Lists
Subject: [PHP] Planning a new job

Hello,

I'm wondering what processes everyone has before quoting a web
programming /
design job?

Do you have a face-to-face meeting with the client?

What questions do you ask?

What information should be found-out about the job?

Do I then go away and draw up a quote? or a quote and a proposal?

Any help would be wonderful, thanks.

Tim Burgan
burganiprimus.com.au

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

attached mail follows:


Tim, check out http://www.fusebox.org (there site is currently down for
some unknown reason) and check out the FLiP cycle area. If you are a
PHP developer you would do well to at least use part of the methodology
in your site development process. Especially wireframing and
prototypying. They have a number of articles on both as well.

-Adam Reiswig (KliK)

Tim Burgan wrote:
> Hello,
>
> I'm wondering what processes everyone has before quoting a web programming /
> design job?
>
> Do you have a face-to-face meeting with the client?
>
> What questions do you ask?
>
> What information should be found-out about the job?
>
> Do I then go away and draw up a quote? or a quote and a proposal?
>
> Any help would be wonderful, thanks.
>
>
> Tim Burgan
> burganiprimus.com.au
>
>

attached mail follows:


we have a php function fgetcsv to read from a csv file.

is there any scripts available to do the reverse, write to a csv file.

thanks

attached mail follows:


search phpclasses.org

hui zhang wrote:
> we have a php function fgetcsv to read from a csv file.
>
> is there any scripts available to do the reverse, write to a csv file.
>
> thanks
>
>
>

attached mail follows:


Hi,

I have two very simple php scripts and the second srcipt is not seeing the
variables session_registered by the first script.
I'm running the latest version of php. And have both "register_globals" and
"track_vars" set to "ON".

Well, the first script prints out the session var fine, but not the second
one. What is wrong? Is there something else I overlooked? Thanks for your
help!

1st script - page1.php:

<?

  session_start();
  session_register("sess_var");

  $sess_var = "Hello world!";

  echo "The content of \$sess_var is $sess_var<br>";

?>
<a href = "page2.php">Next page</a>

2nd script - page2.php:

<?

  session_start();

  echo "The content of \$sess_var is $sess_var<br>";

  session_unregister("sess_var");
?>

attached mail follows:


Hi,

I have two very simple php scripts and the second srcipt is not seeing the
variables session_registered by the first script.
I'm running the latest version of php. And have both "register_globals" and
"track_vars" set to "ON".

Well, the first script prints out the session var fine, but not the second
one. What is wrong? Is there something else I overlooked? Thanks for your
help!

1st script - page1.php:

<?

  session_start();
  session_register("sess_var");

  $sess_var = "Hello world!";

  echo "The content of \$sess_var is $sess_var<br>";

?>
<a href = "page2.php">Next page</a>

2nd script - page2.php:

<?

  session_start();

  echo "The content of \$sess_var is $sess_var<br>";

  session_unregister("sess_var");
?>

attached mail follows:


On Tuesday 03 June 2003 12:28, Eric D. wrote:

> I have two very simple php scripts and the second srcipt is not seeing the
> variables session_registered by the first script.
> I'm running the latest version of php. And have both "register_globals" and
> "track_vars" set to "ON".

It's best to state the specific version of PHP you're using rather than just
'latest' (as it could mean different things to different people at different
times).

> Well, the first script prints out the session var fine, but not the second
> one. What is wrong? Is there something else I overlooked? Thanks for your
> help!

If you're using PHP > 4.1.0 then you ought to be using $_SESSION for all your
session needs -- see manual for examples.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I have a map of the United States. It's actual size. I spent last summer
folding it. People ask me where I live, and I say, "E6".
                -- Steven Wright
*/

attached mail follows:


Do you have cookies enabled on your browser? If not then you will need to
make sure that you compile or change your php.ini to reflect that (ie with
trans-sid).

ed

-----Original Message-----
From: Jason Wong [mailto:php-generalgremlins.biz]
Sent: Tuesday, June 03, 2003 3:42 AM
To: php-generallists.php.net
Subject: Re: [PHP] php session not persisting

On Tuesday 03 June 2003 12:28, Eric D. wrote:

> I have two very simple php scripts and the second srcipt is not seeing the
> variables session_registered by the first script.
> I'm running the latest version of php. And have both "register_globals"
and
> "track_vars" set to "ON".

It's best to state the specific version of PHP you're using rather than just

'latest' (as it could mean different things to different people at different

times).

> Well, the first script prints out the session var fine, but not the second
> one. What is wrong? Is there something else I overlooked? Thanks for your
> help!

If you're using PHP > 4.1.0 then you ought to be using $_SESSION for all
your
session needs -- see manual for examples.

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I have a map of the United States. It's actual size. I spent last summer
folding it. People ask me where I live, and I say, "E6".
                -- Steven Wright
*/

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

attached mail follows:


I have the following scenario:

I have this timeclock program that my employees access by logging into and
the program pretty much allows them to clock-in and clock-out. The problem
is that I noticed some of the employees were clocking-in and clocking-out
from their home. The main problem is that the machine at work that the
employees use to access this program does not have a static ip address. Is
there any way to access the mac address in php.

Any ideas?

thanks,
Dale

attached mail follows:


Hi all,

As you will guess from this question I'm new to all this. Firstly I hope
this is the right list.
 I have installed the latest version of Apache, and the latest version of
PHP, on Windows 2000. I can start the server fine but as soon as I change
the httpd.conf file and add the LoadModule section the server refuses to
start.

I wonder if anyone can shed any light on this. I can run PHP under IIS 5.0
which I have installed and tried, but would prefer to use Apache. IIS has
been fully removed from the machine before the installation of Apache.

Hope someone can help.

King Regards

Tim

**********************************************************************
This email message and any files transmitted with it are confidential
and intended solely for the use of addressed recipient(s). If you have
received this email in error please notify the Spotless IS Support Centre (61 3 9269 7241) immediately who will advise further action.

This footnote also confirms that this email message has been scanned
for the presence of computer viruses.
**********************************************************************

attached mail follows:


do you have an exact error message?

so far i can only point you to some often made mistakes:

- did you copy php4ts.dll to c:\winnt\system32
- did you copy php.ini.dist to c:\winnt, renamed it to php.ini and modified
it?

 - in httpd.conf added these two lines?
    LoadModule php4_module PHP_DIR/sapi/php4apache2.dll
    AddType application/x-httpd-php .php
    (note the apache2 module)

ciao SVEN

"Tmcclelland" <tmcclellandspotless.com.au> schrieb im Newsbeitrag
news:MABBIJIHDMILLCOJACGMCECPCPAA.tmcclellandspotless.com.au...
> Hi all,
>
> As you will guess from this question I'm new to all this. Firstly I hope
> this is the right list.
> I have installed the latest version of Apache, and the latest version of
> PHP, on Windows 2000. I can start the server fine but as soon as I change
> the httpd.conf file and add the LoadModule section the server refuses to
> start.
>
> I wonder if anyone can shed any light on this. I can run PHP under IIS 5.0
> which I have installed and tried, but would prefer to use Apache. IIS has
> been fully removed from the machine before the installation of Apache.
>
> Hope someone can help.
>
> King Regards
>
> Tim
>
>
>
> **********************************************************************
> This email message and any files transmitted with it are confidential
> and intended solely for the use of addressed recipient(s). If you have
> received this email in error please notify the Spotless IS Support Centre
(61 3 9269 7241) immediately who will advise further action.
>
> This footnote also confirms that this email message has been scanned
> for the presence of computer viruses.
> **********************************************************************
>
>

attached mail follows:


hi everyone,
i want to know what the good software for PHP Editor Programing, like Visual Age For Java, or Visual .NET from Microsoft...

attached mail follows:


The "editor" topic has been beat to death, please check the archive.

However, PHP is code, all code, there's no "visual" component. All a visual
editor would give you is a prettier interface; be more concerned about an
editor that lets YOU write quickly and efficiently, whether it be vim,
emacs, UltraEdit, EditPlus, Jedit, Notepad, Pico, Joe or something fancier
like HTMLKit or BlueFish. (PHPEdit seems to be reported as still buggy.)

Cheers - Miles

PS I KNOW someone's favourite, absolute best editor has been left out. Pls
forgive.

At 12:01 PM 6/3/2003 +0700, agus wrote:
>hi everyone,
>i want to know what the good software for PHP Editor Programing, like
>Visual Age For Java, or Visual .NET from Microsoft...

attached mail follows:


Hi,
On a link page I have I'd like to show if the links are valid (=exists)
I tried to do a pOpen (http://www.whatever.com/index.html,"r") and if it
exists everything is fine but if it's not there I get a warning "failed to
create stream: HTTP request failed! HTTP/1.1 404 Object Not Found"
Opening the file is actually not necessary, I'm checking for existence. But
it's the only way I've found. Is there a better way to do this?

I'm using PHP4 on a w2k workstation

Thanx
/Kjell

attached mail follows:


Thanx Chris,
this is exactly what I do. And I get
"Warning: fopen(http://www.whatever.com/index.html) [function.fopen]: failed
to create stream: HTTP request failed! HTTP/1.1 404 Object Not Found"

I don't want to get the warning. I know I can switch it off but there are
other warnings I would like to see.

Somehow I just want to check for "HTTP/1.1 404 Object Not Found" and if
found show it as a broken link.

/Kjell

> -----Original Message-----
> From: Chris Kay [mailto:Chris.Kaytechex.com.au]
> Sent: Tuesday, June 03, 2003 08:48
> To: Kjell Hansen
> Subject: RE: [PHP] Broken links report
>
>
>
> Try
>
> $p = pOpen (http://www.whatever.com/index.html,"r")
>
> if ( $p ) {
> print("Worked");
> } else {
> print("Failed");
> }
>
> ---------------------------------------------------------
> Chris Kay
> Techex Communications
> Website: www.techex.com.au Email: chris.kaytechex.net.au
> Telephone: 1300 88 111 2 - Fax: 1300 882 221
> ---------------------------------------------------------
>
> -----Original Message-----
> From: Kjell Hansen [mailto:kjell.hansensaj.fi]
> Sent: Tuesday, 3 June 2003 3:42 PM
> To: php-generallists.php.net
> Subject: [PHP] Broken links report
>
> Hi,
> On a link page I have I'd like to show if the links are valid (=exists)
> I tried to do a pOpen (http://www.whatever.com/index.html,"r") and if it
> exists everything is fine but if it's not there I get a warning "failed
> to
> create stream: HTTP request failed! HTTP/1.1 404 Object Not Found"
> Opening the file is actually not necessary, I'm checking for existence.
> But
> it's the only way I've found. Is there a better way to do this?
>
> I'm using PHP4 on a w2k workstation
>
> Thanx
> /Kjell
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


At 07:55 03.06.2003, Kjell Hansen said:
--------------------[snip]--------------------
>Thanx Chris,
>this is exactly what I do. And I get
>"Warning: fopen(http://www.whatever.com/index.html) [function.fopen]: failed
>to create stream: HTTP request failed! HTTP/1.1 404 Object Not Found"
>
>I don't want to get the warning. I know I can switch it off but there are
>other warnings I would like to see.
>
>Somehow I just want to check for "HTTP/1.1 404 Object Not Found" and if
>found show it as a broken link.
--------------------[snip]--------------------

You can't do it that way. If a web page is missing, the webserver will
transmit the error page for code 404. You cannot rely that this will always
the string you're looking for, and you cannot be sure that a regular page a
link points to will _not_ contain this string.

Just to omit the warning, you may use the silent-error notation
    fopen($url, 'r');
but this will always work unless the host portion of the URL cannot be
resolved.

You need to employ a method where you receive the MIME headers additional
to the page body. Have a look at cURL
(http://www.php.net/manual/en/ref.curl.php) how to do this.

HTH,

--
>O Ernest E. Vogelsinger
   (\) ICQ #13394035
    ^ http://www.vogelsinger.at/

attached mail follows:


On Tue, 2003-06-03 at 04:06, Ernest E Vogelsinger wrote:
> At 07:55 03.06.2003, Kjell Hansen said:
> --------------------[snip]--------------------
> >I don't want to get the warning. I know I can switch it off but there are
> >other warnings I would like to see.
> --------------------[snip]--------------------
>
> Just to omit the warning, you may use the silent-error notation
> fopen($url, 'r');
> but this will always work unless the host portion of the URL cannot be
> resolved.

Another alternative is to look into the track_errors INI directive which
will populate the $php_errormsg variable with the last error that
occurred... in that case something like the following could be done:

        $fr = fopen("http://www.coggeshall.org/myfile.php",'r');
        if(!$fr) {
                echo "The error that occurred was $php_errormsg";
                // Do test on the error message here
        }

Although that won't be absolutely full-proof (since there is no absolute
which says that the error message "failed to open stream: HTTP request
failed! HTTP/1.0 404 Not Found" is going to be identical in new PHP
versions) it is an option to consider.

John
--
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
John Coggeshall
john at coggeshall dot org http://www.coggeshall.org/
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

attached mail follows:


>> I have a member site that uses sessions. People who have their browser
>> cookies turned off, however, cannot use our site. I read somewhere that to
>> avoid this, I'd have to manually append the PHPSESSID var to every URL when
>> redirecting in a script.
>
> One way around this would be to write a simple wrapper function which does
> this for you automatically:
>
> <?
> // UNTESTED
> function redirectWithSession($location)
> {
> $sid = session_id();
> $sname = session_name();
> header("Location: {$location}?{$sname}={$sid}");
> }
> ?>
>
> Then (after testing the above code thoroughly) you just need to do a batch
> search and replace on your whole site source for 'header("Location: ' with
> 'redirectWithSession(', and everything should be cool.... I think. Please
> test all thoroughly :)

Justin, I took your suggestion and tried out the above on some test files. I
made some slight mods, but, it works perfectly. The only thing I don't like
about this solution is that the session ID is appended to the end of the URL
for everyone, even if they have cookies enabled. (I have trans-sid enabled).
Is there any reliable way to avoid this, or is this just a small side-effect
of making the site accessible to all?

Thanks!

Monty

attached mail follows:


Hmmmm,

Theory only here:

If there is a GET value of PHPSESSID (or whatever your sessions are named),
then the user is more than likely taking advantage of trans-sid (sid's in
the URLs), and cookies are not available.

So, we only want to append the sid to URLs in a redirect IF the sid is found
in the URL already. If there is no SID in the URL, then perhaps we can
assume it doesn't need to be this time????

<?
// UNTESTED
function redirectWithSession($location)
    {
    $sid = session_id();
    $sname = session_name();
    if($_GET[$sname])
        {
        header("Location: {$location}?{$sname}={$sid}");
        }
    else
        {
        header("Location: {$location}");
        }
    }
?>

Again, please test thoroughly, because I haven't thought through the
instances where this might break something really... maybe there aren't
any!!

Justin

on 03/06/03 5:02 PM, Monty (monty3hotmail.com) wrote:

>>> I have a member site that uses sessions. People who have their browser
>>> cookies turned off, however, cannot use our site. I read somewhere that to
>>> avoid this, I'd have to manually append the PHPSESSID var to every URL when
>>> redirecting in a script.
>>
>> One way around this would be to write a simple wrapper function which does
>> this for you automatically:
>>
>> <?
>> // UNTESTED
>> function redirectWithSession($location)
>> {
>> $sid = session_id();
>> $sname = session_name();
>> header("Location: {$location}?{$sname}={$sid}");
>> }
>> ?>
>>
>> Then (after testing the above code thoroughly) you just need to do a batch
>> search and replace on your whole site source for 'header("Location: ' with
>> 'redirectWithSession(', and everything should be cool.... I think. Please
>> test all thoroughly :)
>
>
> Justin, I took your suggestion and tried out the above on some test files. I
> made some slight mods, but, it works perfectly. The only thing I don't like
> about this solution is that the session ID is appended to the end of the URL
> for everyone, even if they have cookies enabled. (I have trans-sid enabled).
> Is there any reliable way to avoid this, or is this just a small side-effect
> of making the site accessible to all?
>
> Thanks!
>
> Monty
>
>
>
>

attached mail follows:


> -----Original Message-----
> From: Justin French [mailto:justinindent.com.au]
> Sent: 03 June 2003 06:34
> To: Monty; php-generallists.php.net
> Subject: Re: [PHP] Cookies and Sessions: What's the Best Recipe?
>
>
> Hmmmm,
>
> Theory only here:
>
> If there is a GET value of PHPSESSID (or whatever your
> sessions are named),
> then the user is more than likely taking advantage of
> trans-sid (sid's in
> the URLs), and cookies are not available.
>
> So, we only want to append the sid to URLs in a redirect IF
> the sid is found
> in the URL already. If there is no SID in the URL, then
> perhaps we can
> assume it doesn't need to be this time????

Guys, that's exactly what the SID predefined constant is for -- it's defined
only when a session is active, and it has the value
<sessionname>=<sessionid> (e.g. PHPSESSID=1afd764ecb938274) if and only if
the session id was passed in the URL -- otherwise it contains the empty
string. So you can safely do:

    header("Location: {$location}?".SID);

and get the desired result.

attached mail follows:


on 03/06/03 9:43 PM, Ford, Mike [LSS] (M.Fordlmu.ac.uk)
wrote:

>> -----Original Message-----
>> From: Justin French [mailto:justinindent.com.au]
>> Sent: 03 June 2003 06:34
>> To: Monty; php-generallists.php.net
>> Subject: Re: [PHP] Cookies and Sessions: What's the Best Recipe?
>>
>>
>> Hmmmm,
>>
>> Theory only here:
>>
>> If there is a GET value of PHPSESSID (or whatever your
>> sessions are named),
>> then the user is more than likely taking advantage of
>> trans-sid (sid's in
>> the URLs), and cookies are not available.
>>
>> So, we only want to append the sid to URLs in a redirect IF
>> the sid is found
>> in the URL already. If there is no SID in the URL, then
>> perhaps we can
>> assume it doesn't need to be this time????
>
> Guys, that's exactly what the SID predefined constant is for -- it's defined
> only when a session is active, and it has the value
> <sessionname>=<sessionid> (e.g. PHPSESSID=1afd764ecb938274) if and only if
> the session id was passed in the URL -- otherwise it contains the empty
> string. So you can safely do:
>
> header("Location: {$location}?".SID);
>
> and get the desired result.

Good point... except I had some problems with SID a while back... must do
some re-testing... can't remember much about it now.

Thanks mike.

Justin

attached mail follows:


I have one hard SCSI installed on it redhat 7.3, and I add a two other SCSI
hardisk with an RAID controller , and I need to copy some files form the
RAID , how can I mount them??
How to mount a RAID???

attached mail follows:


I noticed that for users with cookies turned off, once they log out (in
which I unset and destroy all session vars) and are returned to the Log-in
page, all of my links have an empty PHPSESSID= tag at the end like this:

    <a href="help.php?PHPSESSID=">

This prevents someone from logging in again immediately unless they first
leave the site then come back to clear the empty PHPSESSID var from all the
URLS. How can I make this stop?

Thanks

Monty

attached mail follows:


Hi Everyone,

I'm now trying to add an "auto refresh" in a .php file, so that it
automatically refreshes the same page every 15 mins. Is there an upper
limit to the header() function? It seemed to work fine when it was set to
"5" seconds, but is not working with "900".

Here's the code:

header( 'refresh: 900; url=.' );

Thanks,
Kurosh

attached mail follows:


My advice to you is to use javascript..

"Kurosh Burris" <kuroshrogers.com> schrieb im Newsbeitrag
news:20030603080216.19692.qmailpb1.pair.com...
> Hi Everyone,
>
> I'm now trying to add an "auto refresh" in a .php file, so that it
> automatically refreshes the same page every 15 mins. Is there an upper
> limit to the header() function? It seemed to work fine when it was set to
> "5" seconds, but is not working with "900".
>
> Here's the code:
>
> header( 'refresh: 900; url=.' );
>
> Thanks,
> Kurosh
>
>

attached mail follows:


[snip]
Can I trust every
browser to check for old cookies on startup and eliminate them? And still,
even if I can, wouldn't the cookie be intact to read on the harddrive
until
the browser is started again? I was thinking about slicing the username
and
password strings in two, and storing the halves in cookies and server
sessions respectively, e.g.:

Username = Admin -> Cookieusername = Ad, Sessionusername = min
Password = Secret -> Cookiepassword = Sec, Sessionpassword = ret
[/snip]

Never trust any program that is not running on your system. How do you
know that your user is actually running a browser and not some self
written program? So the most important lesson is never to trust anything
that is not under your control....
You should never store the password in the cookie. Better is to send some
sort of id as the cookie and use that id to retrieve some sort of database
record for password comparison. That way the password user combination is
always under your control.
If you depend on tight security your best bet is to authenticate the user
eachtime he reenters your page and not use cookies for authentication at
all. This can be a pain but is by far the safest. Even better of course
would be some certificate authentication. This could be very bothersome to
program though.
If you must save the password as a cookie ( I DO NOT RECOMMEND THIS AT
ALL) at least encrypt it with a hash function like crypt using a different
salt for each user. Then compare the hash value to a stored
passwordhashvalue on your server.

Regards
Stefan Langer

attached mail follows:


en línea da errores el funcionamiento de esta pagina , pruébalo también en
netscape.
http://res.interhotel.com/reservas/diana/site/admin/ProviderPriority.php
gracias,
diana

attached mail follows:


I'm fine with using while loops, use them for most of my listing work, but I
wanted to try using a foreach loop instead but it seemed not to work as
expected. For ym table generation, I need the $key to do some maths on in
order to get my table looking right. All the guts are done, but for some
reason, when usng a foreach loop, foreach (mysql_fetch_array($result) as
$key => $value) $value is not an array of the fields. Whereas with a while
loop, it works fine. Is this a problem with foreach?

If it is, i'll stick to while, but with a counter to generate a key.

"Justin French" <justinindent.com.au> wrote in message
news:BB0233DA.28970%justinindent.com.au...
> This is correct:
>
> while($myrow = mysql_fetch_array($result))
> {
> // ...
> }
>
> The iteration of the while loop represents one returned row from the mysql
> result, with $myrow being an array of values returned.
>
> Rather than a SELECT * query, let's look at a something where we know the
> column names:
>
> <?
> $sql = "
> SELECT first, surname, age
> FROM employee
> WHERE age >= 18
> LIMIT 50
> ";
> $result = mysql_query($sql);
> while($myrow = mysql_fetch_array($result))
> {
> echo "Name: {$myrow['first']} {$myrow['surname']}. Age:
> {$myrow['age']}<br />";
> }
> ?>
>
>
> Now, given the above code, what else do you need to do?
>
>
> Justin
>
>
>
>
> on 03/06/03 8:25 AM, Bix (phpbix.cc) wrote:
>
> > Hi all,
> >
> > I am trying to build up a table using values from a db as follows...
> >
> > mysql_select_db($db, $sql_connection);
> > $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
> > $limit",$sql_connection);
> > $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
> > width=\"370\">\n";
> > foreach(mysql_fetch_array($result) as $key => $article){
> > //stuff
> > }
> >
> > now if I use a while loop ie:
> >
> > while ($array = mysql_fetch_array($result)){
> > //stuff
> > }
> >
> > all the matched rows are processed, however with the foreach model,
$article
> > isnt an array, it is the first row all merged together.
> >
> > Any ideas?
> >
> > ;o)
> >
> >
>

attached mail follows:


Try:

Bix wrote:
> Hi all,
>
> I am trying to build up a table using values from a db as follows...
>
> mysql_select_db($db, $sql_connection);
> $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
> $limit",$sql_connection);
> $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
> width=\"370\">\n";
while($row=mysql_fetch_array($result)) {
        foreach($row as $key => $article){
                //stuff
        }
}
> now if I use a while loop ie:
>
> while ($array = mysql_fetch_array($result)){
> //stuff
> }
>
> all the matched rows are processed, however with the foreach model, $article
> isnt an array, it is the first row all merged together.
>
> Any ideas?
>
> ;o)
>
>
>

attached mail follows:


I need to access the row by colum name...

eg:

$row['id'] $row['title'] $row['detail']

My table gen script puts the relelvant fields into the right boxes, and my
maths works from the $key to put <tr>s in the right place.

So i need a loop that will loop as many times as there are rows, so while
works fine, but i also need a key, so that is why i wanted to use
foreach(mysql_fetch_array($result) as $key => $value) but my problem arises
when i try and access $value in the foreach loop, it is not an array of the
row, but all the values in the row imploded together.

"Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
news:3EDC6E99.7010206webglobe.sk...
> Try:
>
> Bix wrote:
> > Hi all,
> >
> > I am trying to build up a table using values from a db as follows...
> >
> > mysql_select_db($db, $sql_connection);
> > $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
> > $limit",$sql_connection);
> > $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
> > width=\"370\">\n";
> while($row=mysql_fetch_array($result)) {
> foreach($row as $key => $article){
> //stuff
> }
> }
> > now if I use a while loop ie:
> >
> > while ($array = mysql_fetch_array($result)){
> > //stuff
> > }
> >
> > all the matched rows are processed, however with the foreach model,
$article
> > isnt an array, it is the first row all merged together.
> >
> > Any ideas?
> >
> > ;o)
> >
> >
> >
>

attached mail follows:


I need to access the row by colum name...

eg:

$row['id'] $row['title'] $row['detail']

My table gen script puts the relelvant fields into the right boxes, and my
maths works from the $key to put <tr>s in the right place.

So i need a loop that will loop as many times as there are rows, so while
works fine, but i also need a key, so that is why i wanted to use
foreach(mysql_fetch_array($result) as $key => $value) but my problem arises
when i try and access $value in the foreach loop, it is not an array of the
row, but all the values in the row imploded together.

"Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
news:3EDC6E99.7010206webglobe.sk...
> Try:
>
> Bix wrote:
> > Hi all,
> >
> > I am trying to build up a table using values from a db as follows...
> >
> > mysql_select_db($db, $sql_connection);
> > $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
> > $limit",$sql_connection);
> > $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
> > width=\"370\">\n";
> while($row=mysql_fetch_array($result)) {
> foreach($row as $key => $article){
> //stuff
> }
> }
> > now if I use a while loop ie:
> >
> > while ($array = mysql_fetch_array($result)){
> > //stuff
> > }
> >
> > all the matched rows are processed, however with the foreach model,
$article
> > isnt an array, it is the first row all merged together.
> >
> > Any ideas?
> >
> > ;o)
> >
> >
> >
>

attached mail follows:


And doesn't this solve your problem? While loop will loop for each row,
foreach will give you the key and value. How else do you want to loop?

while($row=mysql_fetch_array($result)) {
        foreach($row as $key => $article){
                //here you have $key and $article
        }
}

Bix wrote:
> I need to access the row by colum name...
>
> eg:
>
> $row['id'] $row['title'] $row['detail']
>
> My table gen script puts the relelvant fields into the right boxes, and my
> maths works from the $key to put <tr>s in the right place.
>
> So i need a loop that will loop as many times as there are rows, so while
> works fine, but i also need a key, so that is why i wanted to use
> foreach(mysql_fetch_array($result) as $key => $value) but my problem arises
> when i try and access $value in the foreach loop, it is not an array of the
> row, but all the values in the row imploded together.
>
> "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
> news:3EDC6E99.7010206webglobe.sk...
>
>>Try:
>>
>>Bix wrote:
>>
>>>Hi all,
>>>
>>>I am trying to build up a table using values from a db as follows...
>>>
>>> mysql_select_db($db, $sql_connection);
>>> $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
>>>$limit",$sql_connection);
>>> $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
>>>width=\"370\">\n";
>>
>>while($row=mysql_fetch_array($result)) {
>>foreach($row as $key => $article){
>>//stuff
>>}
>>}
>>
>>>now if I use a while loop ie:
>>>
>>>while ($array = mysql_fetch_array($result)){
>>> //stuff
>>>}
>>>
>>>all the matched rows are processed, however with the foreach model,
>
> $article
>
>>>isnt an array, it is the first row all merged together.
>>>
>>>Any ideas?
>>>
>>>;o)
>>>
>>>
>>>
>>
>
>
>

attached mail follows:


I've decided to drop foreach altogether now and just used good old while on
its own with a counter to use as the key. The second foreach in your example
would run on each column on the row, when i need to just be able to access
the columns.

I appreciate the help though, thanks ;o)

Am now using:

$key = 0;
while ($row = mysql_fetch_array($result)){
 //stuff accessing $row['id'], $row['blah'] etc...
 $key++;
}

"Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
news:3EDC7982.6000307webglobe.sk...
> And doesn't this solve your problem? While loop will loop for each row,
> foreach will give you the key and value. How else do you want to loop?
>
> while($row=mysql_fetch_array($result)) {
> foreach($row as $key => $article){
> //here you have $key and $article
> }
> }
>
> Bix wrote:
> > I need to access the row by colum name...
> >
> > eg:
> >
> > $row['id'] $row['title'] $row['detail']
> >
> > My table gen script puts the relelvant fields into the right boxes, and
my
> > maths works from the $key to put <tr>s in the right place.
> >
> > So i need a loop that will loop as many times as there are rows, so
while
> > works fine, but i also need a key, so that is why i wanted to use
> > foreach(mysql_fetch_array($result) as $key => $value) but my problem
arises
> > when i try and access $value in the foreach loop, it is not an array of
the
> > row, but all the values in the row imploded together.
> >
> > "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message
> > news:3EDC6E99.7010206webglobe.sk...
> >
> >>Try:
> >>
> >>Bix wrote:
> >>
> >>>Hi all,
> >>>
> >>>I am trying to build up a table using values from a db as follows...
> >>>
> >>> mysql_select_db($db, $sql_connection);
> >>> $result = mysql_query("SELECT * FROM $table WHERE $query LIMIT
> >>>$limit",$sql_connection);
> >>> $output = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
> >>>width=\"370\">\n";
> >>
> >>while($row=mysql_fetch_array($result)) {
> >>foreach($row as $key => $article){
> >>//stuff
> >>}
> >>}
> >>
> >>>now if I use a while loop ie:
> >>>
> >>>while ($array = mysql_fetch_array($result)){
> >>> //stuff
> >>>}
> >>>
> >>>all the matched rows are processed, however with the foreach model,
> >
> > $article
> >
> >>>isnt an array, it is the first row all merged together.
> >>>
> >>>Any ideas?
> >>>
> >>>;o)
> >>>
> >>>
> >>>
> >>
> >
> >
> >
>

attached mail follows:


Hi,

I am creating a timesheet application, how can I make sure that a user has
entered a number, and that the number is a whole number or a decimal up to 2
places, and that the number is less than 24?

Thanks for your help

attached mail follows:


is_numeric and strlen ?

-----Original Message-----
From: Shaun [mailto:shaunmania.plus.com]
Sent: Tuesday, June 03, 2003 7:21 PM
To: php-generallists.php.net
Subject: [PHP] Validating user input

Hi,

I am creating a timesheet application, how can I make sure that a user has
entered a number, and that the number is a whole number or a decimal up to 2
places, and that the number is less than 24?

Thanks for your help

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

attached mail follows:


Try this... I don't know if this will suit your needs but it'll give you
an idea:

<?php

        // $a contains the time entered by the user

         if($a > 0 && $a < 24) {
        
                $time = number_format($a, 2, '.', '');
                echo "Time: $time\n\n";
        } else {
        
                echo "Invaild Time.\n\n";
        }

?>

Regards,

John
--
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
John Coggeshall
john at coggeshall dot org http://www.coggeshall.org/
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

attached mail follows:


Another way is to do it on client side (javascript)

DS

-----Original Message-----
From: Shaun [mailto:shaunmania.plus.com]
Sent: Tuesday, June 03, 2003 11:21 AM
To: php-generallists.php.net
Subject: [PHP] Validating user input

Hi,

I am creating a timesheet application, how can I make sure that a user has
entered a number, and that the number is a whole number or a decimal up to 2
places, and that the number is less than 24?

Thanks for your help

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

attached mail follows:


> -----Original Message-----
> From: Shaun [mailto:shaunmania.plus.com]
> Sent: 03 June 2003 10:21
>
> I am creating a timesheet application, how can I make sure
> that a user has
> entered a number, and that the number is a whole number or a
> decimal up to 2
> places, and that the number is less than 24?

I'd probably do this with a regex plus a quick test for in-range values -- something like (untested):

        if ($number>0 && $number<24
             && preg_match('^[0-9]{1-2}(\.[0-9]{1,2})?$', $number))
          do_stuff;

You could also tweak the regex to filter out out-of-range values and dispense with the range checks -- something like (again untested):

      if (preg_match('^(1?[0-9]|2[0-4])(\.[0-9]{1,2})?$', $number))
         do_stuff;

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.fordlmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

attached mail follows:


I use getimagesize to resize pictures that I get from a url which comes
from a database which is always changing. The problem is that sometimes the
url does not contain the picture is is supposed to , and then I get the
following error - I can't seem to get rid of this error, does anyone know
how to capture the error so it doesnt come out in a message like this?
getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
[function.getimagesize]: failed to create stream: HTTP request failed!
HTTP/1.1 404 Not Found at ReservationManager.php line 299.

attached mail follows:


try an fopen to check if the file is there first ?

-----Original Message-----
From: Diana Castillo [mailto:dianainterhotel.com]
Sent: Tuesday, June 03, 2003 7:24 PM
To: php-generallists.php.net
Subject: [PHP] getimagesize

I use getimagesize to resize pictures that I get from a url which comes
from a database which is always changing. The problem is that sometimes the
url does not contain the picture is is supposed to , and then I get the
following error - I can't seem to get rid of this error, does anyone know
how to capture the error so it doesnt come out in a message like this?
getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
[function.getimagesize]: failed to create stream: HTTP request failed!
HTTP/1.1 404 Not Found at ReservationManager.php line 299.

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

attached mail follows:


Are you using PHP 4.3.2? Try upgrading :)

John

On Tue, 2003-06-03 at 05:23, Diana Castillo wrote:
> I use getimagesize to resize pictures that I get from a url which comes
> from a database which is always changing. The problem is that sometimes the
> url does not contain the picture is is supposed to , and then I get the
> following error - I can't seem to get rid of this error, does anyone know
> how to capture the error so it doesnt come out in a message like this?
> getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
> [function.getimagesize]: failed to create stream: HTTP request failed!
> HTTP/1.1 404 Not Found at ReservationManager.php line 299.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
John Coggeshall
john at coggeshall dot org http://www.coggeshall.org/
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

attached mail follows:


Dear all
Here is the situation :

Our automation system will generate a large number of pdf file to a specific
folder every day. The name format for all these pdf file is
"xxxx.20030602.pdf".
xxxx is the name of the file,
20030602 is last working date.

what i want to do is:
1. create a sub-folder inside this specific folder, and name it to current
month(Jun-2003)
2. move the pdf which is not containning last working's file name to this
new create sub-folder.
3. the files with last working date's name will stay on the specific folder.

question :

1. I had used a date function with "w" parameter to check if current date i
execute the script is monday (1), if so , i tell the script to take the
current date minus 3, so the date will become last friday (as our last
working day), then i can base on this date to tell the script which files
should not be move to sub-folder!

q: how i can do a date subtraction in php? (eg. "2003-06-02" - 3 =
"2003-05-30")

attached mail follows:


On Tuesday 03 June 2003 17:40, Jack wrote:

> q: how i can do a date subtraction in php? (eg. "2003-06-02" - 3 =
> "2003-05-30")

strtotime()

--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The law will never make men free; it is men who have got to make the law free.
                -- Henry David Thoreau
*/

attached mail follows:


have a look at date() and mktime():

from the manual:
$tomorrow = mktime(0, 0, 0, date("m"), date ("d")+1, date("Y"));

ciao SVEN

"Jack" <nedcor4nedcor.com.hk> schrieb im Newsbeitrag
news:20030603094058.12746.qmailpb1.pair.com...
> Dear all
> Here is the situation :
>
> Our automation system will generate a large number of pdf file to a
specific
> folder every day. The name format for all these pdf file is
> "xxxx.20030602.pdf".
> xxxx is the name of the file,
> 20030602 is last working date.
>
>
> what i want to do is:
> 1. create a sub-folder inside this specific folder, and name it to current
> month(Jun-2003)
> 2. move the pdf which is not containning last working's file name to this
> new create sub-folder.
> 3. the files with last working date's name will stay on the specific
folder.
>
> question :
>
> 1. I had used a date function with "w" parameter to check if current date
i
> execute the script is monday (1), if so , i tell the script to take the
> current date minus 3, so the date will become last friday (as our last
> working day), then i can base on this date to tell the script which files
> should not be move to sub-folder!
>
> q: how i can do a date subtraction in php? (eg. "2003-06-02" - 3 =
> "2003-05-30")
>
>

attached mail follows:


$date1="2003-06-02";
$date2=date("Y-m-d",strtotime($date1)-3*24*60*60);
echo $date2;

--

Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com - Professional Web Design
www.PaginiWeb.com

"Jack" <nedcor4nedcor.com.hk> wrote in message
news:20030603094058.12746.qmailpb1.pair.com...
> Dear all
> Here is the situation :
>
> Our automation system will generate a large number of pdf file to a
specific
> folder every day. The name format for all these pdf file is
> "xxxx.20030602.pdf".
> xxxx is the name of the file,
> 20030602 is last working date.
>
>
> what i want to do is:
> 1. create a sub-folder inside this specific folder, and name it to current
> month(Jun-2003)
> 2. move the pdf which is not containning last working's file name to this
> new create sub-folder.
> 3. the files with last working date's name will stay on the specific
folder.
>
> question :
>
> 1. I had used a date function with "w" parameter to check if current date
i
> execute the script is monday (1), if so , i tell the script to take the
> current date minus 3, so the date will become last friday (as our last
> working day), then i can base on this date to tell the script which files
> should not be move to sub-folder!
>
> q: how i can do a date subtraction in php? (eg. "2003-06-02" - 3 =
> "2003-05-30")
>
>

attached mail follows:


Hi,
I want action of a form to be PHP_SELF untill user presses "continue"
button.
If continue button is pressed than "next.php" should be the action of
the form.
how to do this?
Thanks in advance,
Mukta

attached mail follows:


Hi Mukta,

> I want action of a form to be PHP_SELF untill user
> presses "continue" button. If continue button is
> pressed than "next.php" should be the action of the
> form. how to do this?

One way would be to have two buttons in your form, but submit to only one
page:

<form action="process.php">
  <input type="submit" name="op" value="Continue">
  <input type="submit" name="op" value="Stop">
</form>

... and then, on process.php, you decide what to do:

if ($_GET["op"] == "Continue") {
  // do continuation stuff, or redirect somewhere
} elseif ($_GET["op"] == "Stop") {
  // do stopping stuff, or redirect somewhere
} else {