[PHP] Re: PHP & MySQL "Move"

2003-03-03 Thread John Taylor-Johnston
Found this for anyone interested.
http://www.mysql.com/doc/en/INSERT_SELECT.html

John Taylor-Johnston wrote:

> I was wondering about this, but decided to ask first first:
>
> INSERT INTO ccl.ccl_main VALUES (select * from greid.ccl where id=28);
> delete * from greid.ccl where id=28;
>
> Both tables would have to have the same structure ?

--
John Taylor-Johnston
-
"If it's not open-source, it's Murphy's Law."

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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



[PHP] FW: [mysql]help with displaying table {off subject}#3

2003-03-03 Thread Karl James
Sorry about the html.
I forgot to turn it off..


ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 
-Original Message-
From: Karl James [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 2:29 AM
To: '[EMAIL PROTECTED]'
Subject: [mysql]help with displaying table {off subject}#2


hey guys 
just wanted to know as usual it was user error
i had thought i had something stored in the tables 
but apparently i did not.

i apologize for the noobie question.

thanks

special thanks to jason.
ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



[PHP] [mysql]help with displaying table {off subject}#2

2003-03-03 Thread Karl James
Title: Message



hey guys 

just wanted to know as usual it was user 
error
i had thought i had something stored in the 
tables 
but apparently i did not.
 
i apologize for 
the noobie question.
 
thanks
 
special thanks 
to jason.

ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 


Re: [PHP] [mysq] help with displaying table {off Subject}

2003-03-03 Thread Petre Agenbag
I presume you are talking about phpMyAdmin here.

The Browse link only works when there are entries in the tables, ie., it
won't work on empty table.
You must first insert data into the tables, and for that you uise the
INSERT link.
You can change the tables by using the PROPERTIES link.


On Tue, 2003-03-04 at 09:18, Karl James wrote:
> hey guys im trying to figure out why the browse 
> link wont work in mysql is there anything 
> special to edit so that i can view the tables so 
> i can edit them and add value
> 
> 
> 
> 
> ultimatefootballleague.com/index.php
> [EMAIL PROTECTED]
>  
> 
> 
> 
> -- 
> 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] [mysq] help with displaying table {off Subject}

2003-03-03 Thread Karl James
hey guys im trying to figure out why the browse 
link wont work in mysql is there anything 
special to edit so that i can view the tables so 
i can edit them and add value




ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
 



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



[PHP] entrycheck

2003-03-03 Thread Diksha Neel
HI EVERYBODY,

WHEN I RUN MY PHP SCRIPT TYPED BELOW, I GET 'connected 
successfully
query failed'.
i have in bdoi_change database a table called entry with 2 
fields:
login and pass in which i have put some data.

can anyone help out?

regards,
diksha.
I HAVE AN HTML FORM BY NAME entry.html the code of
which is the following:

User Name
User Password 


AND THE check.php code is as follows:



$connection=mysql_connect("localhost","root","")or die("Could not 
connect");
print "Connected successfully";
mysql_select_db("bdoi_change")or die("could not select 
database");

$query = "select * from entry where login='$login' and 
pass='$pass' ";
$result = mysql_query($query,$connection) or die("Query 
failed");
$num=mysql_num_rows($result);

//present results based on validity.
echo "$num";
if($num==1)
{
echo "You are a valid user!";
}
 if($num==0)
{
echo "you are not authorised";
}
?>




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


RE: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Matt Honeycutt
Bad design, basically.

This script is creating the array, then modifying a certain value in it
using the text key.  Later, it's referring to each value in the array by
numerical index.  Apparently, the text key and the numerical index do
not refer to the same values in PHP, so the value it's referring to with
the numerical index is the original value, not the one that was
modified.

I'm just going to spend the extra 5 minutes and rewrite that little
chunk of code.

---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:39 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

No, there's no easy way to do this.  Just out of curiousity, why do you 
want to do this anyway?

Matt Honeycutt wrote:

>Because I created it with mysql_fetch_array().  I know for a fact that
>both keys exist, and I can look at the output and tell what text key
>matches to what numerical key, but I don't want to hardcode it like
>that.  The people that are taking over this code might change something
>and screw everything up.
>
>---Matt
>
>-Original Message-
>From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
>Sent: Tuesday, March 04, 2003 12:35 AM
>To: Matt Honeycutt
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP] Getting Numerical Index of a Key
>
>What makes you think it HAS a numerical index?
>
>Matt Honeycutt wrote:
>
>  
>
>>Is there an easy way to get the numerical index of a text key for an
>>array?  I don't see anything in the manual, but before I waste time
>>writing code to find this info, I thought I would double check here.
>>
>>---Matt
>>
>> 
>>
>>
>>
>
>  
>

-- 
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




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



Re: [PHP] Using PHP to Generate a CSS Style Sheet

2003-03-03 Thread Leif K-Brooks
It doesn't have to be a .css file, just as HTML generated from PHP 
doesn't have to have a .html extension.

Phillip S. Baker wrote:

Greetings all,

I would like to use PHP to make calls from a DB and generate a CSS file.
Anyone have any ideas on doing this?
Will php commands executre from a .css file or is there a different 
way to do this??

Blessings

Phillip

+++
IMPORTANT: This email message (including attachments, if any) is intended
for the use of the individual addressee(s) named above and may contain
information that is confidential, privileged or unsuitable for overly 
sensitive
persons with low self-esteem, no sense of humor or irrational religious
beliefs. If you are not the intended recipient, any dissemination, 
distribution
or copying of this email is not authorized (either explicitly or 
implicitly) and
constitutes an irritating social faux pas. Unless the word absquatulation
has been used in its correct context somewhere other than in this 
warning,
it does not have any legal or no grammatical use and may be ignored. No
animals were harmed in the transmission of this email, although the 
barking
dachshund next door is living on borrowed time, let me tell you. Those of
you with an overwhelming fear of the unknown will be gratified to 
learn that
there is no hidden message revealed by reading this warning backwards,
so just ignore that Alert Notice from Microsoft. However, by pouring a
complete circle of salt around yourself and your computer you can ensure
that no harm befalls you, your family or your pets. If you have 
received this
email in error, please add some nutmeg and egg whites, whisk and place
in a warm oven for 40 minutes.
+++


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Leif K-Brooks
No, there's no easy way to do this.  Just out of curiousity, why do you 
want to do this anyway?

Matt Honeycutt wrote:

Because I created it with mysql_fetch_array().  I know for a fact that
both keys exist, and I can look at the output and tell what text key
matches to what numerical key, but I don't want to hardcode it like
that.  The people that are taking over this code might change something
and screw everything up.
---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:35 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

 

Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
---Matt



   

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



[PHP] Using PHP to Generate a CSS Style Sheet

2003-03-03 Thread Phillip S. Baker
Greetings all,

I would like to use PHP to make calls from a DB and generate a CSS file.
Anyone have any ideas on doing this?
Will php commands executre from a .css file or is there a different way to 
do this??

Blessings

Phillip

+++
IMPORTANT: This email message (including attachments, if any) is intended
for the use of the individual addressee(s) named above and may contain
information that is confidential, privileged or unsuitable for overly sensitive
persons with low self-esteem, no sense of humor or irrational religious
beliefs. If you are not the intended recipient, any dissemination, 
distribution
or copying of this email is not authorized (either explicitly or 
implicitly) and
constitutes an irritating social faux pas. Unless the word absquatulation
has been used in its correct context somewhere other than in this warning,
it does not have any legal or no grammatical use and may be ignored. No
animals were harmed in the transmission of this email, although the barking
dachshund next door is living on borrowed time, let me tell you. Those of
you with an overwhelming fear of the unknown will be gratified to learn that
there is no hidden message revealed by reading this warning backwards,
so just ignore that Alert Notice from Microsoft. However, by pouring a
complete circle of salt around yourself and your computer you can ensure
that no harm befalls you, your family or your pets. If you have received this
email in error, please add some nutmeg and egg whites, whisk and place
in a warm oven for 40 minutes.
+++

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


RE: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Matt Honeycutt
Because I created it with mysql_fetch_array().  I know for a fact that
both keys exist, and I can look at the output and tell what text key
matches to what numerical key, but I don't want to hardcode it like
that.  The people that are taking over this code might change something
and screw everything up.

---Matt

-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 04, 2003 12:35 AM
To: Matt Honeycutt
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Getting Numerical Index of a Key

What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

>Is there an easy way to get the numerical index of a text key for an
>array?  I don't see anything in the manual, but before I waste time
>writing code to find this info, I thought I would double check here.
> 
>---Matt
>
>  
>

-- 
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




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



Re: [PHP] Getting Numerical Index of a Key

2003-03-03 Thread Leif K-Brooks
What makes you think it HAS a numerical index?

Matt Honeycutt wrote:

Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
---Matt

 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Getting Numerical Index of a Key

2003-03-03 Thread Matt Honeycutt
Is there an easy way to get the numerical index of a text key for an
array?  I don't see anything in the manual, but before I waste time
writing code to find this info, I thought I would double check here.
 
---Matt


[PHP] Re: Still no luck running a PHPCLI script from CRON -- getting closer

2003-03-03 Thread Tom Rogers
Hi,

Tuesday, March 4, 2003, 2:58:50 PM, you wrote:
JMC> I have my PHP script running from cron now as root, but when I try to
JMC> run it as a non root user it doesn't work.  When I drop down to the non
JMC> root user and run the script by hand I get this.

JMC> /usr/libexec/ld-elf.so.1: Shared object "libmysqlclient.so.12" not found

JMC> any ideas why this wouldn't not happen as root but does as a non root
JMC> user?

JMC> thanks

JMC> Justin Michael Couto[EMAIL PROTECTED]
JMC> Director of Operations  805.781.0420
JMC> Somnio World Web Solutions  http://www.somnioworld.com
 

JMC> -Original Message-
JMC> From: Tom Rogers [mailto:[EMAIL PROTECTED] 
JMC> Sent: Monday, March 03, 2003 6:23 PM
JMC> To: Justin Michael Couto
JMC> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
JMC> Subject: Re[2]: [PHP] Still no luck running a PHPCLI script from CRON

JMC> Hi,

JMC> Tuesday, March 4, 2003, 10:01:25 AM, you wrote:
JMC>> Dan,

JMC>> I used your example exactly like you have it specified.  My cron
JMC> log
JMC>> looks like this:

JMC>> Mar  3 15:53:00 prod /usr/sbin/cron[3085]: (root) CMD
JMC>> (/usr/local/contab-scripts/wibble.php)

JMC>> Mar  3 15:54:00 prod /usr/sbin/cron[3085]: (root) CMD
JMC>> (/usr/local/contab-scripts/wibble.php)

JMC>> However, it does nothing at all.  It doesn't create the
JMC>> /tmp/wibble.output file.  After testing this, I went in and ran the
JMC>> wibble.php script by hand from the command line and it worked just
JMC> as my
JMC>> scripts work when I run them by hand.  I ran the cron as root and
JMC> ran
JMC>> the script by hand as root.  I really think there is a bug
JMC> somewhere,
JMC>> either in FreeBSD or in PHP.  I am not sure what it can be.  All I
JMC> know
JMC>> is that other scripts like bash scripts run fine from cron.  This
JMC>> problem is really weird and I would truly appreciate any more
JMC> assistance
JMC>> in getting it resolved.

JMC>> Thanks everyone,


JMC>>
JMC> XX

>>> Ok, by looking at my cron logs it looks like cron is trying to run my
>>> PHP CLI script.  However, it is not running it.  I only have one line
JMC>> of
>>> code that isn't commented out and the line simply sends me an email
>>> using the PHP mail() function.

JMC>> One thing to keep in mind when working with crontab is
JMC> environmental
JMC>> variables. As in, Cron has none. You have to set any you want in
JMC> your
JMC>> crontab, or your called scripts. For example, use full paths.

JMC>> You shouldnt have to call a shell before calling the php cli. Here
JMC> is an
JMC>> example script for you to test. My php binary is in
JMC> /usr/local/bin/php,
JMC>> my
JMC>> script is /usr/local/crontab-scripts/wibble.php and the file I am
JMC>> writing
JMC>> to is in /tmp/wibble.output

JMC>> This is what wibble looks like [chmoded to 755, owned by the user
JMC> of the
JMC>> crontab]:

JMC>> #!/usr/local/bin/php -q
JMC>> >   if ($fp = fopen("/tmp/wibble.output",a)) {
JMC>> fputs($fp, "Script Executed on ".date("YmdHis")."\n");
JMC>> fclose($fp);
JMC>>   } else {
JMC>> die("Could not open 'wibble.output' for read / write
JMC> operations");
JMC>>   }
?>>>

JMC>> and the crontab line I have is:

JMC>> * * * * /usr/local/contab-scripts/wibble.php

JMC>> and you can see the output of it running every minute:

JMC>> tail -f /tmp/wibble.output

JMC>> Works fine for me ... try it

JMC>> -- 
JMC>> Dan Hardiker [EMAIL PROTECTED]
JMC>> ADAM Software & Systems Engineer
JMC>> First Creative



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

JMC> Try removing the -q's and see if root or whatever user cron runs as gets
JMC> an email with an error message in it, as cron is actully having a
JMC> crack at running the script.

JMC> -- 
JMC> regards,
JMC> Tom

Make sure /usr/local/mysql/lib is in the ld path (/etc/ld.so.conf)
or wherever the clientlib is located

-- 
regards,
Tom


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



[PHP] pharse file random work with -n lines

2003-03-03 Thread WebDev
 
how can you return this randomized? 
 
how can I get every time I call this function a random set of lines ?


Working Code to read 10 first lines and split the individual line into info careeners 
and do something with it 



$i = 0;
$fp = fopen ("../../../../../public/httpd/html/datacontainer/data/storage.data", "r");
while (!feof ($fp) && $i < 10) {
$i++;
$buffer = fgets($fp, 4096);
list ($adnr, $user, $date, $listed, $hlong, $eins, $zwei, $drei, $vier, $usern, 
$locst, $locstaa, $locc, $funf, $sech, $email, $Url, $ClassCat, $ClassCat2, 
$Headstart, $Headend, $Descrip, $End1, $Endzwei, $End3, $Endvier, $Endfunf, $Endsech, 
$Endsieben, $Endacht, $Endne, $dreizwei, $dreidrei, $dreivier, $dreifunf, $dreisechs ) 
= split ("\|", $buffer);

\\ do something
}
fclose ($fp);






[PHP] Re: dealing with dates

2003-03-03 Thread KK
you should make the column for the time posted in your table to be
Date/time. mysql stores it in this format: 2003-02-24 12:43:45
(year-month-day hours:minutes:seconds)
to allow the current date/time to be inserted into this column
date("Y-m-d G:i:s")

if you want to DISPLAY it in this date format (mm/dd/yy), then anytime you
query the table, just add say for example, DATE_FORMAT(Posted, '%c/%e/%y')
as datePosted

where Posted is column name in your table, and datePosted is the new
variable you want to assign the date to.

to answer your second question to get a records between 2 dates, it's simply
adding this to your query:
...where datePosted BETWEEN '$startthedate' and '$endthedate'

Hope this helped. for more on dates, check out this link:
http://www.php.net/manual/en/function.date.php




"Charles Kline" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> I posted earlier with some date questions, but realized I could
> probably do better with my question presented as such.
>
> I need to save the time date and time of posting for the records in a
> table.
> I then need to be able to search via a startdate and enddate text field
> where the user will be entering the date ranges as mm/dd/.
>
> What is the best way to handle adding the date to the MySQL record, and
> also how to search for that date based on a range in the above stated
> format?
>
> Thanks,
> Charles
>



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



[PHP] Re: mail function works, but always from nobody@localhost!

2003-03-03 Thread KK
add an extra variable to your mail function. php takes an optional 4th
parameter, which adds features like "From" and "Reply". example:
$extra = "From: $name <$email>\r\n\Reply-To: $email";

so the mail function would be:
mail($recipient,$subject,$body,$extra);

Hope this helped.


"Ml" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How exactly would I go about fixing my current php/sendmail setup so that
it
> uses the value specified in my php input form in the
> from box instead of always setting the email from address as :
> [EMAIL PROTECTED] ???
>
> Any help would be greatly appreciated. Thanks!
>
>



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



[PHP] mail function works, but always from nobody@localhost!

2003-03-03 Thread ML
How exactly would I go about fixing my current php/sendmail setup so that it
uses the value specified in my php input form in the
from box instead of always setting the email from address as :
[EMAIL PROTECTED] ???

Any help would be greatly appreciated. Thanks!



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



[PHP] Still no luck running a PHPCLI script from CRON -- getting closer

2003-03-03 Thread Justin Michael Couto
I have my PHP script running from cron now as root, but when I try to
run it as a non root user it doesn't work.  When I drop down to the non
root user and run the script by hand I get this.

/usr/libexec/ld-elf.so.1: Shared object "libmysqlclient.so.12" not found

any ideas why this wouldn't not happen as root but does as a non root
user?

thanks

Justin Michael Couto[EMAIL PROTECTED]
Director of Operations  805.781.0420
Somnio World Web Solutions  http://www.somnioworld.com
 

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 03, 2003 6:23 PM
To: Justin Michael Couto
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re[2]: [PHP] Still no luck running a PHPCLI script from CRON

Hi,

Tuesday, March 4, 2003, 10:01:25 AM, you wrote:
JMC> Dan,

JMC> I used your example exactly like you have it specified.  My cron
log
JMC> looks like this:

JMC> Mar  3 15:53:00 prod /usr/sbin/cron[3085]: (root) CMD
JMC> (/usr/local/contab-scripts/wibble.php)

JMC> Mar  3 15:54:00 prod /usr/sbin/cron[3085]: (root) CMD
JMC> (/usr/local/contab-scripts/wibble.php)

JMC> However, it does nothing at all.  It doesn't create the
JMC> /tmp/wibble.output file.  After testing this, I went in and ran the
JMC> wibble.php script by hand from the command line and it worked just
as my
JMC> scripts work when I run them by hand.  I ran the cron as root and
ran
JMC> the script by hand as root.  I really think there is a bug
somewhere,
JMC> either in FreeBSD or in PHP.  I am not sure what it can be.  All I
know
JMC> is that other scripts like bash scripts run fine from cron.  This
JMC> problem is really weird and I would truly appreciate any more
assistance
JMC> in getting it resolved.

JMC> Thanks everyone,


JMC>
XX

>> Ok, by looking at my cron logs it looks like cron is trying to run my
>> PHP CLI script.  However, it is not running it.  I only have one line
JMC> of
>> code that isn't commented out and the line simply sends me an email
>> using the PHP mail() function.

JMC> One thing to keep in mind when working with crontab is
environmental
JMC> variables. As in, Cron has none. You have to set any you want in
your
JMC> crontab, or your called scripts. For example, use full paths.

JMC> You shouldnt have to call a shell before calling the php cli. Here
is an
JMC> example script for you to test. My php binary is in
/usr/local/bin/php,
JMC> my
JMC> script is /usr/local/crontab-scripts/wibble.php and the file I am
JMC> writing
JMC> to is in /tmp/wibble.output

JMC> This is what wibble looks like [chmoded to 755, owned by the user
of the
JMC> crontab]:

JMC> #!/usr/local/bin/php -q
JMC>if ($fp = fopen("/tmp/wibble.output",a)) {
JMC> fputs($fp, "Script Executed on ".date("YmdHis")."\n");
JMC> fclose($fp);
JMC>   } else {
JMC> die("Could not open 'wibble.output' for read / write
operations");
JMC>   }
?>>

JMC> and the crontab line I have is:

JMC> * * * * /usr/local/contab-scripts/wibble.php

JMC> and you can see the output of it running every minute:

JMC> tail -f /tmp/wibble.output

JMC> Works fine for me ... try it

JMC> -- 
JMC> Dan Hardiker [EMAIL PROTECTED]
JMC> ADAM Software & Systems Engineer
JMC> First Creative



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

Try removing the -q's and see if root or whatever user cron runs as gets
an email with an error message in it, as cron is actully having a
crack at running the script.

-- 
regards,
Tom


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



Re: Re[2]: [PHP] ICQ # validation

2003-03-03 Thread Leo Spalteholz
On March 3, 2003 06:31 pm, Tom Rogers wrote:
> Hi,
>
> Tuesday, March 4, 2003, 12:06:14 PM, you wrote:
> JF> Does it actually NEED a regexp?
>
> JF> UNTESTED code:
> JF>  JF> $icq = 2264532680;
> JF> if( (is_int($icq)) && (strlen($icq) > 7) && (strlen($icq) < 9)
> ) { JF> echo "yah";
> JF> } else {
> JF> echo "nah";
> JF> }
> ?>>
>
> JF> FWIW, Are you SURE that all valid ICQ #'s are between 7 and 9
> chars? JF> Surely at some point they'll reach 10 chars, and *may*
> have started at 6?
>
>
> JF> Justin
>
> JF> on 04/03/03 6:00 AM, Liam Gibbs ([EMAIL PROTECTED]) wrote:
> >> Maybe I'm off my rocker, but I don't see how this can't work.
> >> I'm trying to validate an ICQ number, and assuming a valid one
> >> is between 7 and 9 numbers. My line of code is this:
> >>
> >> if(ereg("^[0-9]{7,9}$", $_REQUEST["icqnumber"])) {
> >> print("a-okay!");
> >> } else {
> >> print("error msg");
> >> }
> >>
> >> I've submitted the ICQ # 2264532680, but it validates. Any
> >> ideas?
>
> My icq is 6 digits

Would be kinda cool if your scirpt did a search on icq.com and if it 
found a result then the ICQ # is valid..  of course that means you're 
relying on the icq server to be up and the search page to stay 
consistant..

leo

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



[PHP] dealing with dates

2003-03-03 Thread Charles Kline
Hi all,

I posted earlier with some date questions, but realized I could 
probably do better with my question presented as such.

I need to save the time date and time of posting for the records in a 
table.
I then need to be able to search via a startdate and enddate text field 
where the user will be entering the date ranges as mm/dd/.

What is the best way to handle adding the date to the MySQL record, and 
also how to search for that date based on a range in the above stated 
format?

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


Re: [PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread Larry E. Ullman
Any performance issues re: using fetch_row vs. fetch_array?
No significant performance issues. If you want to be precise and save a 
little overhead, use
$row = mysql_fetch_array ($result, MYSQL_ASSOC);

The returned record will ONLY be returned as an associative array.

Larry

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


Re: [PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread Leif K-Brooks
According to the manual, "An important thing to note is that using 
mysql_fetch_array() is not significantly slower than using 
mysql_fetch_row() 
, while it 
provides a significant added value."

Noah wrote:

You're on a roll.

Any performance issues re: using fetch_row vs. fetch_array?

Thanks again,

--Noah

- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 7:04 PM
Subject: Re: [PHP] Yah || Simplest php question in
existence
 

Use mysql_fetch_array instead of mysql_fetch_row.

CF High wrote:

   

Hey all.

Basic question here:

How can I refer to a query result set as $result['field_name'] rather
 

than
 

$result[0]?

So, I'm looking for  -- just can't seem
 

to
 

get the right syntax.

-- clueless



--





 

--
The above message is encrypted with double rot13 encoding.  Any
   

unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
 

   



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


Re: [PHP] Update MD5 Field

2003-03-03 Thread Leif K-Brooks
Run the following SQL query:
update TABLE set code = md5(concat(name,email))
Dani Matielo wrote:

Hello, everybody

my problem is the following: I just imported a csv file to a MySQL database
that contains name and email fields. It has about 9k lines on it and I need
a new field that orinally didn't exist called "code" thats suposed to be
MD5(name.email)

I know how to do this for new data, but I don't know how to update all the
old ones I already have there.
Thank you in advance,

Daniela



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Update MD5 Field

2003-03-03 Thread Dani Matielo
Hello, everybody

my problem is the following: I just imported a csv file to a MySQL database
that contains name and email fields. It has about 9k lines on it and I need
a new field that orinally didn't exist called "code" thats suposed to be

MD5(name.email)

I know how to do this for new data, but I don't know how to update all the
old ones I already have there.

Thank you in advance,

Daniela



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



Re: [PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread Noah
You're on a roll.

Any performance issues re: using fetch_row vs. fetch_array?

Thanks again,

--Noah

- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 7:04 PM
Subject: Re: [PHP] Yah || Simplest php question in
existence


> Use mysql_fetch_array instead of mysql_fetch_row.
>
> CF High wrote:
>
> >Hey all.
> >
> >Basic question here:
> >
> >How can I refer to a query result set as $result['field_name'] rather
than
> >$result[0]?
> >
> >So, I'm looking for  -- just can't seem
to
> >get the right syntax.
> >
> >-- clueless
> >
> >
> >
> >--
> >
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>


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



Re[2]: [PHP] ICQ # validation

2003-03-03 Thread Tom Rogers
Hi,

Tuesday, March 4, 2003, 12:06:14 PM, you wrote:
JF> Does it actually NEED a regexp?

JF> UNTESTED code:
JF>  $icq = 2264532680;
JF> if( (is_int($icq)) && (strlen($icq) > 7) && (strlen($icq) < 9) ) {
JF> echo "yah";
JF> } else {
JF> echo "nah";
JF> }
?>>

JF> FWIW, Are you SURE that all valid ICQ #'s are between 7 and 9 chars?
JF> Surely at some point they'll reach 10 chars, and *may* have started at 6?


JF> Justin



JF> on 04/03/03 6:00 AM, Liam Gibbs ([EMAIL PROTECTED]) wrote:

>> Maybe I'm off my rocker, but I don't see how this can't work. I'm trying to
>> validate an ICQ number, and assuming a valid one is between 7 and 9 numbers.
>> My line of code is this:
>> 
>> if(ereg("^[0-9]{7,9}$", $_REQUEST["icqnumber"])) {
>> print("a-okay!");
>> } else {
>> print("error msg");
>> }
>> 
>> I've submitted the ICQ # 2264532680, but it validates. Any ideas?
>> 

My icq is 6 digits

-- 
regards,
Tom


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



Re[2]: [PHP] Still no luck running a PHPCLI script from CRON

2003-03-03 Thread Tom Rogers
Hi,

Tuesday, March 4, 2003, 10:01:25 AM, you wrote:
JMC> Dan,

JMC> I used your example exactly like you have it specified.  My cron log
JMC> looks like this:

JMC> Mar  3 15:53:00 prod /usr/sbin/cron[3085]: (root) CMD
JMC> (/usr/local/contab-scripts/wibble.php)

JMC> Mar  3 15:54:00 prod /usr/sbin/cron[3085]: (root) CMD
JMC> (/usr/local/contab-scripts/wibble.php)

JMC> However, it does nothing at all.  It doesn't create the
JMC> /tmp/wibble.output file.  After testing this, I went in and ran the
JMC> wibble.php script by hand from the command line and it worked just as my
JMC> scripts work when I run them by hand.  I ran the cron as root and ran
JMC> the script by hand as root.  I really think there is a bug somewhere,
JMC> either in FreeBSD or in PHP.  I am not sure what it can be.  All I know
JMC> is that other scripts like bash scripts run fine from cron.  This
JMC> problem is really weird and I would truly appreciate any more assistance
JMC> in getting it resolved.

JMC> Thanks everyone,


JMC> XX

>> Ok, by looking at my cron logs it looks like cron is trying to run my
>> PHP CLI script.  However, it is not running it.  I only have one line
JMC> of
>> code that isn't commented out and the line simply sends me an email
>> using the PHP mail() function.

JMC> One thing to keep in mind when working with crontab is environmental
JMC> variables. As in, Cron has none. You have to set any you want in your
JMC> crontab, or your called scripts. For example, use full paths.

JMC> You shouldnt have to call a shell before calling the php cli. Here is an
JMC> example script for you to test. My php binary is in /usr/local/bin/php,
JMC> my
JMC> script is /usr/local/crontab-scripts/wibble.php and the file I am
JMC> writing
JMC> to is in /tmp/wibble.output

JMC> This is what wibble looks like [chmoded to 755, owned by the user of the
JMC> crontab]:

JMC> #!/usr/local/bin/php -q
JMC>if ($fp = fopen("/tmp/wibble.output",a)) {
JMC> fputs($fp, "Script Executed on ".date("YmdHis")."\n");
JMC> fclose($fp);
JMC>   } else {
JMC> die("Could not open 'wibble.output' for read / write operations");
JMC>   }
?>>

JMC> and the crontab line I have is:

JMC> * * * * /usr/local/contab-scripts/wibble.php

JMC> and you can see the output of it running every minute:

JMC> tail -f /tmp/wibble.output

JMC> Works fine for me ... try it

JMC> -- 
JMC> Dan Hardiker [EMAIL PROTECTED]
JMC> ADAM Software & Systems Engineer
JMC> First Creative



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

Try removing the -q's and see if root or whatever user cron runs as gets
an email with an error message in it, as cron is actully having a
crack at running the script.

-- 
regards,
Tom


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



Re: [PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread Joel Colombo
not mysql_fetch_array unless u need those int indexes.
mysql_fetch_assoc is the same thing but does not index the integer value,
just the string field name.

Joel


"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Use mysql_fetch_array instead of mysql_fetch_row.
>
> CF High wrote:
>
> >Hey all.
> >
> >Basic question here:
> >
> >How can I refer to a query result set as $result['field_name'] rather
than
> >$result[0]?
> >
> >So, I'm looking for  -- just can't seem
to
> >get the right syntax.
> >
> >-- clueless
> >
> >
> >
> >--
> >
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>



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



[PHP] Re: Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread Joel Colombo

query result like MYSQL ?
$x = mysql_result($result, 0, 'field');

another way for mysql_result
$r = mysql_fetch_assoc($result);
$value = $r['fieldname'];

-- OR --

just an array ?
$result['fieldname'] = 5;
$x = 'fieldname';

echo ($result[$x]);


did that help ?
i think i am missing the question.



"Cf High" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hey all.
>
> Basic question here:
>
> How can I refer to a query result set as $result['field_name'] rather than
> $result[0]?
>
> So, I'm looking for  -- just can't seem to
> get the right syntax.
>
> -- clueless
>
>
>
> --
>
>
>



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



Re: [PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread Leif K-Brooks
Use mysql_fetch_array instead of mysql_fetch_row.

CF High wrote:

Hey all.

Basic question here:

How can I refer to a query result set as $result['field_name'] rather than
$result[0]?
So, I'm looking for  -- just can't seem to
get the right syntax.
-- clueless



--



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Yarrrrgggghhhhh || Simplest php question in existence........

2003-03-03 Thread CF High
Hey all.

Basic question here:

How can I refer to a query result set as $result['field_name'] rather than
$result[0]?

So, I'm looking for  -- just can't seem to
get the right syntax.

-- clueless



--




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



Re: [PHP] Populate var with function output string?

2003-03-03 Thread Noah
You da man, Leif.

That did the trick.

Didn't try the output buffering idea.  I need to look into that area.

Thanks for illuminating things a bit

--Noah

- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 5:01 PM
Subject: Re: [PHP] Populate var with function output string?


> Try adding each output string to a variable, then returning it, like:
>
> function return_string(count) {
> $return = '';
> for ($x = 0; $x < $count; $x++) {
>
>  $return.= " Row $x";
>
> }
> return $return;
>
> }
>
> If you can't do that for some reason, try using output buffering.
>  www.php.net/ob-start
>
> CF High wrote:
>
> >Hey all.
> >
> >Is it possible to populate a var with an output string generated by a
> >function? So:
> >
> >***
> >function write_string(count) {
> >
> >for ($x = 0; $x < $count; $x++) {
> >
> > echo " Row $x";
> >
> >}
> >
> >}
> >
> >$my_string = write_string(5);
> >
> >echo $my_string;
> >***
> >
> >I need $count option elements stored in $my_string. How to make this
happen.
> >
> >Thanks for any ideas,
> >
> >--Noah
> >
> >
> >--
> >
> >
> >
> >
> >
> >
>
> --
> The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
>
>
>


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



Re: [PHP] ICQ # validation

2003-03-03 Thread Justin French
Does it actually NEED a regexp?

UNTESTED code:
 7) && (strlen($icq) < 9) ) {
echo "yah";
} else {
echo "nah";
}
?>

FWIW, Are you SURE that all valid ICQ #'s are between 7 and 9 chars?
Surely at some point they'll reach 10 chars, and *may* have started at 6?


Justin



on 04/03/03 6:00 AM, Liam Gibbs ([EMAIL PROTECTED]) wrote:

> Maybe I'm off my rocker, but I don't see how this can't work. I'm trying to
> validate an ICQ number, and assuming a valid one is between 7 and 9 numbers.
> My line of code is this:
> 
> if(ereg("^[0-9]{7,9}$", $_REQUEST["icqnumber"])) {
> print("a-okay!");
> } else {
> print("error msg");
> }
> 
> I've submitted the ICQ # 2264532680, but it validates. Any ideas?
> 


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



Re: [PHP] preg_match_all()

2003-03-03 Thread Michael Sims
On Mon, 3 Mar 2003 19:51:09 -0500, you wrote:

>preg_match_all('/begincommand(.*)endcommand/',$messagebody,$commandOuttake,P
>REG_PATTERN_ORDER);
[...]
> How
>do I change the criteria to stop at the first instance of a match?  How do I
>parse out only up to the first instance of "endcommand"?

Here's an excerpt from 'perldoc perlre':

By default, a quantified subpattern is "greedy", that is, it will
match as many times as possible (given a particular starting location)
while still allowing the rest of the pattern to match.  If you want it
to match the minimum number of times possible, follow the quantifier
with a "?".  Note that the meanings don't change, just the
"greediness".

As John Holmes has already pointed out, you can add the U modifier,
but I would recommend that you learn to use the ? quantifier, since
this is more portable as Perl doesn't recognize the U modifier.  So
you'd want to change this:

/begincommand(.*)endcommand/

to this:

/begincommand(.*?)endcommand/

If you have an install of Perl handy I also recommend taking a look at
'perldoc perlretut', I've found it very helpful.

HTH...

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



Re: [PHP] Populate var with function output string?

2003-03-03 Thread Ernest E Vogelsinger
At 04:56 04.03.2003, CF High said:
[snip]
>Hey all.
>
>Is it possible to populate a var with an output string generated by a
>function? So:
>
>***
>function write_string(count) {
>
>for ($x = 0; $x < $count; $x++) {
>
> echo " Row $x";
>
>}
>
>}
>
>$my_string = write_string(5);
>
>echo $my_string;
>***
>
>I need $count option elements stored in $my_string. How to make this happen.
[snip] 

You might use output buffering:

ob_start;
write_string(5);
$my_string = ob_get_buffer();
ob_end_clean();

Output buffering is stackable, i.e. the above code will work even if you
have ob turned on already.


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



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



RE: [PHP] working with file and mail

2003-03-03 Thread John W. Holmes
Care to enlighten us as to what the problem was? Inquiring minds want to
know. 

---John W. Holmes...

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

> -Original Message-
> From: WebDev [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 9:15 PM
> To: Kevin Stone; [EMAIL PROTECTED]
> Subject: Re: [PHP] working with file and mail
> 
> Ok I got it figuered
> 
> please do not reply to this subject anymore
> 
> Thank you all who helped
> 
> 
> - Original Message -
> From: Kevin Stone <[EMAIL PROTECTED]>
> To: WebDev <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, March 03, 2003 1:56 PM
> Subject: Re: [PHP] working with file and mail
> 
> 
> > Impossible.  The list() = split() construct will initialize any
> variables
> > that do not contain values so it cannot possibly be a security risk.
> User
> > 100 cannot possibly see user 99's email address unless user 99's
email
> > address is on line 100.  If you want to be absolutely certain then
> > initialize your variables before you split the line.
> >
> > - Kevin
> >
> > - Original Message -
> > From: "WebDev" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, March 03, 2003 5:29 PM
> > Subject: [PHP] working with file and mail
> >
> >
> > Hello all
> > I hat some help last night from John Holmes but I am still stuck
with
> even
> > more option in the code
> >
> > My Problem:
> >
> > I have a text data file of users I wish to email all with custom
> information
> > from the file, each line represents a user with 21 seperated
datafields
> (
> > serperator "|" )
> >
> > ...
> > User|UserN|UserL|Pass|Email|Country|etc..|etrc..|| etc.||
> > ...
> >
> > The following code makes the loop a security risk well User 100 sees
99
> > email address 
> >
> >  > $fp = fopen ("data/default2.users", "r");
> > while (!feof ($fp)) {
> > $buffer = fgets($fp, 4096);
> > list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,
$Street,
> > $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
$ex3,
> > $ex4, $ex53, $ex7 ) = split ("\|", $buffer);
> >
> > $myname = "browseabit";
> > $myemail = "[EMAIL PROTECTED]";
> > $contactname = "$Realf $RealL";
> > $contactemail = "$Email";
> >
> > $message = "Dear $Realf $RealL  message ";
> >
> > $subject = "Subject text here";
> >
> > $headers = "MIME-Version: 1.0\r\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> > $headers .= "From: ".$myname." <".$myemail.">\r\n";
> > $headers .= "To: ".$contactname." <".$contactemail.">\r\n";
> > $headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
> > $headers .= "X-Priority: 1\r\n";
> > $headers .= "X-MSMail-Priority: High\r\n";
> > $headers .= "X-Mailer: Server
> >
> > mail($contactemail, $subject, $message, $headers);
> >
> > echo " mail to
$Realf
> > $RealL done ...  ";
> > }
> > fclose ($fp);
> >
> > ?>
> >
> >
> > Can somebody please help me with the script ?
> >
> >
> >
> >
> 
> 
> --
> 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



RE: [PHP] date range assistance needed

2003-03-03 Thread John W. Holmes
What does $qAnnouncement look like if you echo it out? Does it look
correct? Are you sure the variables you're passing to strtotime() are
correct? What does mysql_error() say after you run this query? 

---John W. Holmes...

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

> -Original Message-
> From: charles kline [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 6:22 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] date range assistance needed
> 
> Here is my current query:
> 
> $qAnnouncement =
> 'SELECT id,headline
>   FROM tbl_funding
> WHERE 1
> AND ((UNIX_TIMESTAMP (datestamp) >= ' .
> strtotime($attributes[startdate]) . ') AND (UNIX_TIMESTAMP (datestamp)
> <= ' . strtotime($attributes[startdate]) . ')) LIMIT 0, 30';
> 
> Where datestamp is set in MySQL with a timestamp(14) and
> $attributes[startdate] and $attributes[enddate] are in the format
> mm/dd/
> 
> My query does not return any results. I know there must be something
> wrong, can anyone point it out?
> 
> Thanks,
> Charles
> 
> 
> --
> 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



RE: [PHP] preg_match_all()

2003-03-03 Thread John W. Holmes
Use a U modifier in your pattern.

http://www.php.net/manual/en/pcre.pattern.modifiers.php

---John W. Holmes...

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

> -Original Message-
> From: Vania Smrkovski [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 7:51 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] preg_match_all()
> 
> As described in
http://www.php.net/manual/en/function.preg-match-all.php,
> I
> have put in place a bit of code theoretically designed to parse out
> snippets
> of text embraced with an open and close tag.  The code I am using is
this:
> 
>
preg_match_all('/begincommand(.*)endcommand/',$messagebody,$commandOutta
ke
> ,P
> REG_PATTERN_ORDER);
> print $commandOuttake[0][0]." (0,0), ".$commandOuttake[0][1]."
(0,1)\n";
> print $commandOuttake[1][0]." (1,0), ".$commandOuttake[1][1]."
(1,1)\n";
> 
> For this input
> 
> random words begincommand another test string 1[endcommand] a couple
of
> random words [begincommand]2nd instance of command in same email test
> string
> [endcommand] and then a bunch of nonsense
> 
> this code produces this output:
> 
> begincommand another test string 1[endcommand] a\r\ncouple of random
words
> [begincommand]2nd instance of command in same email\r\ntest string
> [endcommand (0,0), (0,1) another test string 1[endcommand] a\r\ncouple
of
> random words [begincommand]2nd instance of command in same
email\r\ntest
> string [ (1,0), (1,1)
> 
> 
> In other words, the fact that I have the begincommand ... endcommand
> TWICE,
> the preg_match_all only accepts the OUTER open and close tags.  It
never
> stops at the first endcommand as I am trying to make it do.  The
string "
> a\r\ncouple of random words" should never show up!
> 
> I've tried this with and without the PREG_PATTERN_ORDER, with ereg,
> preg_match and various and sundry other variations, and I am at a
loss.
> How
> do I change the criteria to stop at the first instance of a match?
How do
> I
> parse out only up to the first instance of "endcommand"?
> 
> 
> I am not certain if I am subscribed directly to this list, so in
> answering,
> would you be so kind as to cc: [EMAIL PROTECTED]
> 
> Thanks!
> _
> Vania Smrkovski
> Internet Design and Programming
> [EMAIL PROTECTED]
> http://pandorasdream.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



RE: [PHP] Populate var with function output string?

2003-03-03 Thread David Freeman

 > ***
 > function write_string(count) {
 >
 > for ($x = 0; $x < $count; $x++) {
 >
 >  echo " Row $x";
 >
 > }
 >
 > }
 >
 > $my_string = write_string(5);
 >
 > echo $my_string;
 > ***


8<-Untested Code-8<-
function write_string(count)
{
  $string = "";
  for ($x = 0; $x < $count; $x++)
  {
$string .= "Row $x";
  }
  return $string;
}

$my_string = write_string(5);

echo $my_string;
8<-Untested Code-8<-

Season to taste...

CYA, Dave





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



Re: [PHP] Populate var with function output string?

2003-03-03 Thread Leif K-Brooks
Try adding each output string to a variable, then returning it, like:

function return_string(count) {
   $return = '';
   for ($x = 0; $x < $count; $x++) {
$return.= " Row $x";

   }
   return $return;
}

If you can't do that for some reason, try using output buffering. 
www.php.net/ob-start

CF High wrote:

Hey all.

Is it possible to populate a var with an output string generated by a
function? So:
***
function write_string(count) {
   for ($x = 0; $x < $count; $x++) {

echo " Row $x";

   }

}

$my_string = write_string(5);

echo $my_string;
***
I need $count option elements stored in $my_string. How to make this happen.

Thanks for any ideas,

--Noah

--



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Populate var with function output string?

2003-03-03 Thread CF High
Hey all.

Is it possible to populate a var with an output string generated by a
function? So:

***
function write_string(count) {

for ($x = 0; $x < $count; $x++) {

 echo " Row $x";

}

}

$my_string = write_string(5);

echo $my_string;
***

I need $count option elements stored in $my_string. How to make this happen.

Thanks for any ideas,

--Noah


--




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



[PHP] preg_match_all()

2003-03-03 Thread Vania Smrkovski
As described in http://www.php.net/manual/en/function.preg-match-all.php, I
have put in place a bit of code theoretically designed to parse out snippets
of text embraced with an open and close tag.  The code I am using is this:

preg_match_all('/begincommand(.*)endcommand/',$messagebody,$commandOuttake,P
REG_PATTERN_ORDER);
print $commandOuttake[0][0]." (0,0), ".$commandOuttake[0][1]." (0,1)\n";
print $commandOuttake[1][0]." (1,0), ".$commandOuttake[1][1]." (1,1)\n";

For this input

random words begincommand another test string 1[endcommand] a couple of
random words [begincommand]2nd instance of command in same email test string
[endcommand] and then a bunch of nonsense

this code produces this output:

begincommand another test string 1[endcommand] a\r\ncouple of random words
[begincommand]2nd instance of command in same email\r\ntest string
[endcommand (0,0), (0,1) another test string 1[endcommand] a\r\ncouple of
random words [begincommand]2nd instance of command in same email\r\ntest
string [ (1,0), (1,1)


In other words, the fact that I have the begincommand ... endcommand TWICE,
the preg_match_all only accepts the OUTER open and close tags.  It never
stops at the first endcommand as I am trying to make it do.  The string "
a\r\ncouple of random words" should never show up!

I've tried this with and without the PREG_PATTERN_ORDER, with ereg,
preg_match and various and sundry other variations, and I am at a loss.  How
do I change the criteria to stop at the first instance of a match?  How do I
parse out only up to the first instance of "endcommand"?


I am not certain if I am subscribed directly to this list, so in answering,
would you be so kind as to cc: [EMAIL PROTECTED]

Thanks!
_
Vania Smrkovski
Internet Design and Programming
[EMAIL PROTECTED]
http://pandorasdream.com/


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



Re: [PHP] query strings(still broken)

2003-03-03 Thread Leif K-Brooks
Do you mind giving (some of) your code?

Sunfire wrote:

still broke

- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: "Sunfire" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 7:18 PM
Subject: Re: [PHP] query strings(still broken)
 

Are you trying to look at the query string itself?  If so, spaces are
invalid in URLs, so they are urlencoded.  Try using
$_GET/$HTTP_GET_VARS, or urldecode() it if you must.
Sunfire wrote:

   

tried everything except session vars and the query string is still
 

broken...
 

no matter what i do for some reason the browser wants to always put %20
 

in
 

the middle of my words (i.e. hello world as one var will come out as
hello%20world)
any other ideas



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


 

--
The above message is encrypted with double rot13 encoding.  Any
   

unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
 



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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



[PHP] Re: Run db query with db query?

2003-03-03 Thread CF High
Exactly.

I'm using $result for both queries.  That's how I discovered the problem:
the inner query is over-writing the outer query $result set.

Unfortunately my existing db_connect function does not account for multiple
queries.

I just pass the query as a param -- db_connect($sql).  $result is returned
for each query, but this only works with single queries; not nested queries.

In any case, it doesn't seem terribly efficient to run a query within a
query, since the inner query only needs to be run once at the top of the
page.

Problem now is:

How to populate the write_select_options($tables,$form_fields,$where_clause)
function; when it returns no variable -- it just echoes out the option
values.

Looks like I need to modify the function to return a var rather than echoing
some output.

Most likely just talking to the empty universe at this point ;--)

Cheers to all php junkies...

--Noah


"Monty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What is the code for the inner query? Hard to advise you based on the
small
> bit of code you posted.
>
> Are you using the same $result var for both queries? If so, that's why.
Just
> run two separate queries stored in to different result vars. I do this all
> the time with no problems.
>
>
> > From: [EMAIL PROTECTED] (Cf High)
> > Newsgroups: php.general
> > Date: Mon, 3 Mar 2003 16:45:52 -0800
> > To: [EMAIL PROTECTED]
> > Subject: Run db query with db query?
> >
> > Hey all.
> >
> > Got a problem here:
> >
> > 1) I have a page that queries our db for info
> >
> > 2) Based on the # of rows returned I loop through to create a set of
> > formfields for each customer
> >
> > 3) Within this loop I run another query to retrieve option elements for
> > a particular category
> >
> > The problem is that the inner query is overwriting the result resource
for
> > the outer query. So:
> >
> > while ($q = mysql_fetch_row($result)) {
> >
> > build form tables for each client and run inner query
> >
> > html stuff
> >
> > /* Calls db query to populate particular option category */
> > write_select_options($tables,$form_fields,$where_clause);
> >
> > }
> >
> > What's the conventional method for running queries within queries?
> >
> > Any leads most appreciated,
> >
> > --Noah
> >
> > --
> >
> >
> >
>



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



[PHP] Re: Code Validator

2003-03-03 Thread Niels Andersen
PHP is not text markup, it is a kind of programming language. You can't just
validate code for "correctness", only for valid syntax. It may still contain
bugs. The syntax is checked by the parser, which is invoked when you run
your script.

Regarding HTML-output from your script, you can make sure that it is valid
using HTML templates. Validate the templates and make sure that your script
does not insert invalid content into it.
Use htmlentities() when in doubt.

"Beauford.2002" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Is there a code validater for HTML/PHP.  I have one for just HTML, but
once
> you introduce PHP it doesn't work.
>
> TIA
>
>



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



RE: [PHP] quick echo output

2003-03-03 Thread Rich Gray
> Ok most all programs I see they use 
> within the html.
> Now I have always used the shortened version  Is
> there a reason
> why I should not use this?  I've never had any problems with this way of
> doing things, but I just don't see anyone else using that format..

I think it's because the '=$blah' syntax relies on short tags ...
and short tags can upset XML parsers... as a result short tags aren't
supported by all hosting providers  so your code could break if ported
to another site...

Cheers
Rich


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



Re: [PHP] query strings(still broken)

2003-03-03 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

// UNTESTED
$tArr = explode('&',$QUERY_STRING);
foreach ( $tArr as $tVar )
{
$a = explode('=',$tVar);
${rawurldecode($a[0])} = rawurldecode($a[1]);
}


???


On Monday 03 March 2003 04:17 pm, Sunfire wrote:
> tried everything except session vars and the query string is still
> broken... no matter what i do for some reason the browser wants to always
> put %20 in the middle of my words (i.e. hello world as one var will come
> out as hello%20world)
>
> any other ideas
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003

- -- 
Blasphemy is a blast for me.

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

iD8DBQE+Y/J1/rncFku1MdIRAvUuAJ93/TtE5JDPHrcDTI/rHJsd5xVMqQCgtVLa
9D28LUJpLVjOiPEbuDl4qhA=
=d68+
-END PGP SIGNATURE-


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



[PHP] Re: query strings(still broken)

2003-03-03 Thread Niels Andersen
So when you do request for:

your_script.php?var=hello%20world

And put this in your script

you get
hello%20world
printed?

"Sunfire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> tried everything except session vars and the query string is still
broken...
> no matter what i do for some reason the browser wants to always put %20 in
> the middle of my words (i.e. hello world as one var will come out as
> hello%20world)
>
> any other ideas
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
>



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



Re: [PHP] quick echo output

2003-03-03 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

"There are four sets of tags which can be used to denote blocks of PHP code. 
Of these, only two ( and . . .) 
are always available; the others can be turned on or off from the php.ini 
configuration file. While the short- form tags and ASP-style tags may be 
convenient, they are not as portable as the longer versions. Also, if you 
intend to embed PHP code in XML or XHTML, you will need to use the  form to conform to the XML. "

- -php.net/basic-syntax



On Monday 03 March 2003 03:37 pm, Richard Baskett wrote:
> Ok most all programs I see they use  within the
> html. Now I have always used the shortened version  Is there a
> reason why I should not use this?  I've never had any problems with this
> way of doing things, but I just don't see anyone else using that format..
>
> Cheers!
>
> Rick
>
> "As I grow to understand life less and less, I learn to live it more and
> more." - Jules Renard

- -- 
Truth, like gold, is to be obtained not by its growth, but by washing away 
from it all that is not gold. 

- -Leo Nikolaevich Tolstoy
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+Y/D+/rncFku1MdIRAp5PAJ98htywb5MBJDYTO38PuzOIB/V1QgCfd43i
3sfE6as6sG5gz4nOyqfNBqs=
=6SeN
-END PGP SIGNATURE-


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



Re: [PHP] query strings(still broken)

2003-03-03 Thread Leif K-Brooks
Are you trying to look at the query string itself?  If so, spaces are 
invalid in URLs, so they are urlencoded.  Try using 
$_GET/$HTTP_GET_VARS, or urldecode() it if you must.

Sunfire wrote:

tried everything except session vars and the query string is still broken...
no matter what i do for some reason the browser wants to always put %20 in
the middle of my words (i.e. hello world as one var will come out as
hello%20world)
any other ideas



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Re: Problems posting

2003-03-03 Thread Niels Andersen
Actually, I did not check the time. But I was online for more than 10
minutes and pressed my refresh button sevaral times. My post did not appear.

"Henry Grech-Cini" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Did you send this post at 17:17 and did it arrive at 17:22?
>
> "Niels Andersen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > When I post something here, it first appears several hours later. How
can
> it
> > be so?
> >
> >
>
>



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



RE: [PHP] deciperhing oop

2003-03-03 Thread Larry Brown
Thank you everyone for helping.  I didn't know you have to put $this-> in
front of all variables in the class.  You learn something new every day ( I
thought you only needed to use that once to make the variable available
everywhere in the class up till now).

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: Jim Lucas [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 6:50 PM
To: Larry Brown; PHP List
Subject: Re: [PHP] deciperhing oop

the second argument in the mysql_select_db call in not in scope.

you should be using $this->db instead of $db

Jim
- Original Message -
From: "Larry Brown" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 2:52 PM
Subject: [PHP] deciperhing oop


> Can someone who is used to using php oop help me figure out why this
fails?
> I know there are probably a thousand classes already designed to do this
and
> probably 100 times more efficient, but this is how I learn.  From what
I've
> read this should work but there is obviously something I'm missing.
>
> Quick problem description:
> Trying to set up class to connect to mysql db.  Already used a procedural
> test successfully connecting to db.  Error is displayed as...
>
> Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link
> resource in /var/www/html/oop.php on line 67
> Database Selection to main failed.
>
> Code:
>
> Class dbConnect
> {
> var $machine;
> var $port;
> var $user;
> var $password;
> var $query;
> var $result;
> var $dbase;
> var $db;
> var $sel;
>
> function dbConnect($machine,$port,$user,$password)
> {
> $this->machine = $machine;
> $this->port = $port;
> $this->user = $user;
> $this->password = $password;
>
> $db = mysql_pconnect ("$machine","$user","$password")
> if (!$db)
> {
> die ("Initial connection to DB failed.")
> }
> $this->db = $db;
> }
> function setDbase($dbase)
> {
> $this->dbase = $dbase;
>
> $sel = mysql_select_db("$dbase",$db);
> if(!$db)
> {
> die ("Database Selection to $dbase failed.");
> }
> }
> }
>
> $dbn = new dbConnect("localhost","3306","bob","hjhyt4kl5");
>
> $dbn->setDbase("main");
>
>
>
>
>
>
> So why can't I use $db?  Isn't the statement $this->db=$db making it
> available to the setDbase function?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
>
>
> --
> 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] query strings(still broken)

2003-03-03 Thread Sunfire
tried everything except session vars and the query string is still broken...
no matter what i do for some reason the browser wants to always put %20 in
the middle of my words (i.e. hello world as one var will come out as
hello%20world)

any other ideas




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



RE: [PHP] Still no luck running a PHPCLI script from CRON

2003-03-03 Thread Justin Michael Couto
Dan,

I used your example exactly like you have it specified.  My cron log
looks like this:

Mar  3 15:53:00 prod /usr/sbin/cron[3085]: (root) CMD
(/usr/local/contab-scripts/wibble.php)

Mar  3 15:54:00 prod /usr/sbin/cron[3085]: (root) CMD
(/usr/local/contab-scripts/wibble.php)

However, it does nothing at all.  It doesn't create the
/tmp/wibble.output file.  After testing this, I went in and ran the
wibble.php script by hand from the command line and it worked just as my
scripts work when I run them by hand.  I ran the cron as root and ran
the script by hand as root.  I really think there is a bug somewhere,
either in FreeBSD or in PHP.  I am not sure what it can be.  All I know
is that other scripts like bash scripts run fine from cron.  This
problem is really weird and I would truly appreciate any more assistance
in getting it resolved.

Thanks everyone,


XX

> Ok, by looking at my cron logs it looks like cron is trying to run my
> PHP CLI script.  However, it is not running it.  I only have one line
of
> code that isn't commented out and the line simply sends me an email
> using the PHP mail() function.

One thing to keep in mind when working with crontab is environmental
variables. As in, Cron has none. You have to set any you want in your
crontab, or your called scripts. For example, use full paths.

You shouldnt have to call a shell before calling the php cli. Here is an
example script for you to test. My php binary is in /usr/local/bin/php,
my
script is /usr/local/crontab-scripts/wibble.php and the file I am
writing
to is in /tmp/wibble.output

This is what wibble looks like [chmoded to 755, owned by the user of the
crontab]:

#!/usr/local/bin/php -q


and the crontab line I have is:

* * * * /usr/local/contab-scripts/wibble.php

and you can see the output of it running every minute:

tail -f /tmp/wibble.output

Works fine for me ... try it

-- 
Dan Hardiker [EMAIL PROTECTED]
ADAM Software & Systems Engineer
First Creative



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



Re: [PHP] Code Validator

2003-03-03 Thread Justin French
You need to validate the RESULT of the HTML/PHP source being processed by
PHP, resulting in pure HTML source, which is what your browser sees.

So, upload your pages to a server which can be accessed over the internet,
then go to somewhere like validator.w3.org, enter the URL, and it will
validate it.

If you're looking for an OFFLINE validator, then I think you'd need to View
Source on the resultant HTML output, copy and paste into a text editor, save
it, then run it through your validator.


Justin French


on 04/03/03 9:51 AM, Beauford.2002 ([EMAIL PROTECTED]) wrote:

> Hi,
> 
> Is there a code validater for HTML/PHP.  I have one for just HTML, but once
> you introduce PHP it doesn't work.
> 
> TIA
> 
> 


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



[PHP] MySQL and phpMyAdmin Issues

2003-03-03 Thread Stephen Craton
Hello,

Yesturday I made a big mistake. I had to import a 60MB file into a database
and I used ssh. I'm very unfamiliar with it and when I connected to the
MySQL connection thing, I forgot to switch databases when I imported. This
overwrite (I don't know why but it did) the users table in the mysql
database and caused everything to get messy.

For some reason, though, the sites on the server are still working with
their old MySQL username and password (I'm not sure why since I imported a
fresh install's mysql database from my local server). Everything seems to be
working except phpMyAdmin. When I try logging in using the default user as
root and password as nothing, it gives me an access denied error. It does
this for every user we had in the database as well. Is there anyway I can
fix this is ssh? The only option I can think of is reinstalling MySQL but
even then we'll loose all the old databases and I'm not sure how to export
the tables to a file in ssh.

Any help here would be most obliging and I need a reply rather urgently in
order to allow my hosted sites access to phpMyAdmin once again...

Thanks,
Stephen Craton
http://www.melchior.us


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



[PHP] Re: date range assistance needed

2003-03-03 Thread Bobby Patel
I believe PHP and MySQL use two different definitions of the start of a time
stamp. One uses 1974 the other 1900 (I don't know exactly). If you echo
strtotime($attributes[startdate]) ,  UNIX_TIMESTAMP (datestamp)

Also, in your query you are looking for all headlines that have
strtotime($attributes[startdate]) ==  UNIX_TIMESTAMP (datestamp). you have
two strtotime($attributes[startdate]) but not an 'end date '



"Charles Kline" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Here is my current query:
>
> $qAnnouncement =
> 'SELECT id,headline
>   FROM tbl_funding
> WHERE 1
> AND ((UNIX_TIMESTAMP (datestamp) >= ' .
> strtotime($attributes[startdate]) . ') AND (UNIX_TIMESTAMP (datestamp)
> <= ' . strtotime($attributes[startdate]) . ')) LIMIT 0, 30';
>
> Where datestamp is set in MySQL with a timestamp(14) and
> $attributes[startdate] and $attributes[enddate] are in the format
> mm/dd/
>
> My query does not return any results. I know there must be something
> wrong, can anyone point it out?
>
> Thanks,
> Charles
>



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



Re: [PHP] deciperhing oop

2003-03-03 Thread Jim Lucas
the second argument in the mysql_select_db call in not in scope.

you should be using $this->db instead of $db

Jim
- Original Message -
From: "Larry Brown" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 2:52 PM
Subject: [PHP] deciperhing oop


> Can someone who is used to using php oop help me figure out why this
fails?
> I know there are probably a thousand classes already designed to do this
and
> probably 100 times more efficient, but this is how I learn.  From what
I've
> read this should work but there is obviously something I'm missing.
>
> Quick problem description:
> Trying to set up class to connect to mysql db.  Already used a procedural
> test successfully connecting to db.  Error is displayed as...
>
> Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link
> resource in /var/www/html/oop.php on line 67
> Database Selection to main failed.
>
> Code:
>
> Class dbConnect
> {
> var $machine;
> var $port;
> var $user;
> var $password;
> var $query;
> var $result;
> var $dbase;
> var $db;
> var $sel;
>
> function dbConnect($machine,$port,$user,$password)
> {
> $this->machine = $machine;
> $this->port = $port;
> $this->user = $user;
> $this->password = $password;
>
> $db = mysql_pconnect ("$machine","$user","$password")
> if (!$db)
> {
> die ("Initial connection to DB failed.")
> }
> $this->db = $db;
> }
> function setDbase($dbase)
> {
> $this->dbase = $dbase;
>
> $sel = mysql_select_db("$dbase",$db);
> if(!$db)
> {
> die ("Database Selection to $dbase failed.");
> }
> }
> }
>
> $dbn = new dbConnect("localhost","3306","bob","hjhyt4kl5");
>
> $dbn->setDbase("main");
>
>
>
>
>
>
> So why can't I use $db?  Isn't the statement $this->db=$db making it
> available to the setDbase function?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
>
>
> --
> 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] quick echo output

2003-03-03 Thread Richard Baskett
Ok most all programs I see they use  within the html.
Now I have always used the shortened version  Is there a reason
why I should not use this?  I've never had any problems with this way of
doing things, but I just don't see anyone else using that format..

Cheers!

Rick

"As I grow to understand life less and less, I learn to live it more and
more." - Jules Renard


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



[PHP] date range assistance needed

2003-03-03 Thread charles kline
Here is my current query:

$qAnnouncement =
'SELECT id,headline
 FROM tbl_funding
WHERE 1
AND ((UNIX_TIMESTAMP (datestamp) >= ' . 
strtotime($attributes[startdate]) . ') AND (UNIX_TIMESTAMP (datestamp) 
<= ' . strtotime($attributes[startdate]) . ')) LIMIT 0, 30';

Where datestamp is set in MySQL with a timestamp(14) and 
$attributes[startdate] and $attributes[enddate] are in the format 
mm/dd/

My query does not return any results. I know there must be something 
wrong, can anyone point it out?

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


Re: [PHP] working with file and mail

2003-03-03 Thread WebDev
Ok I got it figuered

please do not reply to this subject anymore

Thank you all who helped


- Original Message -
From: Kevin Stone <[EMAIL PROTECTED]>
To: WebDev <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 1:56 PM
Subject: Re: [PHP] working with file and mail


> Impossible.  The list() = split() construct will initialize any variables
> that do not contain values so it cannot possibly be a security risk.  User
> 100 cannot possibly see user 99's email address unless user 99's email
> address is on line 100.  If you want to be absolutely certain then
> initialize your variables before you split the line.
>
> - Kevin
>
> - Original Message -
> From: "WebDev" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, March 03, 2003 5:29 PM
> Subject: [PHP] working with file and mail
>
>
> Hello all
> I hat some help last night from John Holmes but I am still stuck with even
> more option in the code
>
> My Problem:
>
> I have a text data file of users I wish to email all with custom
information
> from the file, each line represents a user with 21 seperated  datafields (
> serperator "|" )
>
> ...
> User|UserN|UserL|Pass|Email|Country|etc..|etrc..|| etc.||
> ...
>
> The following code makes the loop a security risk well User 100 sees 99
> email address 
>
>  $fp = fopen ("data/default2.users", "r");
> while (!feof ($fp)) {
> $buffer = fgets($fp, 4096);
> list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email, $Street,
> $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2, $ex3,
> $ex4, $ex53, $ex7 ) = split ("\|", $buffer);
>
> $myname = "browseabit";
> $myemail = "[EMAIL PROTECTED]";
> $contactname = "$Realf $RealL";
> $contactemail = "$Email";
>
> $message = "Dear $Realf $RealL  message ";
>
> $subject = "Subject text here";
>
> $headers = "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers .= "From: ".$myname." <".$myemail.">\r\n";
> $headers .= "To: ".$contactname." <".$contactemail.">\r\n";
> $headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
> $headers .= "X-Priority: 1\r\n";
> $headers .= "X-MSMail-Priority: High\r\n";
> $headers .= "X-Mailer: Server
>
> mail($contactemail, $subject, $message, $headers);
>
> echo " mail to $Realf
> $RealL done ...  ";
> }
> fclose ($fp);
>
> ?>
>
>
> Can somebody please help me with the script ?
>
>
>
>


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



[PHP] Re: deciperhing oop

2003-03-03 Thread Philip Hallstrom
Haven't evaluated the below thouroughly, but in your setDBase() function
be sure to use $this->db instead of $db (which is undefined).

-philip

On Mon, 3 Mar 2003, Larry Brown wrote:

> Can someone who is used to using php oop help me figure out why this fails?
> I know there are probably a thousand classes already designed to do this and
> probably 100 times more efficient, but this is how I learn.  From what I've
> read this should work but there is obviously something I'm missing.
>
> Quick problem description:
> Trying to set up class to connect to mysql db.  Already used a procedural
> test successfully connecting to db.  Error is displayed as...
>
> Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link
> resource in /var/www/html/oop.php on line 67
> Database Selection to main failed.
>
> Code:
>
> Class dbConnect
> {
>   var $machine;
>   var $port;
>   var $user;
>   var $password;
>   var $query;
>   var $result;
>   var $dbase;
>   var $db;
>   var $sel;
>
>   function dbConnect($machine,$port,$user,$password)
>   {
>   $this->machine = $machine;
>   $this->port = $port;
>   $this->user = $user;
>   $this->password = $password;
>
>   $db = mysql_pconnect ("$machine","$user","$password")
>   if (!$db)
>   {
>   die ("Initial connection to DB failed.")
>   }
>   $this->db = $db;
>   }
>   function setDbase($dbase)
>   {
>   $this->dbase = $dbase;
>
>   $sel = mysql_select_db("$dbase",$db);
>   if(!$db)
>   {
>   die ("Database Selection to $dbase failed.");
>   }
>   }
> }
>
> $dbn = new dbConnect("localhost","3306","bob","hjhyt4kl5");
>
> $dbn->setDbase("main");
>
>
>
>
>
>
> So why can't I use $db?  Isn't the statement $this->db=$db making it
> available to the setDbase function?
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
>
>
> --
> 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



Re: [PHP] Code Validator

2003-03-03 Thread Leif K-Brooks
Exactly what do you mean by code validator?  If you can run it and it 
doesn't return any errors... it's valid PHP! :)  If you mean one that 
validates HTML produced by PHP, try saving the output of the PHP script 
and validating that.

Beauford.2002 wrote:

Hi,

Is there a code validater for HTML/PHP.  I have one for just HTML, but once
you introduce PHP it doesn't work.
TIA



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


[PHP] Code Validator

2003-03-03 Thread Beauford.2002
Hi,

Is there a code validater for HTML/PHP.  I have one for just HTML, but once
you introduce PHP it doesn't work.

TIA



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



[PHP] deciperhing oop

2003-03-03 Thread Larry Brown
Can someone who is used to using php oop help me figure out why this fails?
I know there are probably a thousand classes already designed to do this and
probably 100 times more efficient, but this is how I learn.  From what I've
read this should work but there is obviously something I'm missing.

Quick problem description:
Trying to set up class to connect to mysql db.  Already used a procedural
test successfully connecting to db.  Error is displayed as...

Warning: mysql_select_db(): supplied argument is not a valid MySQL - Link
resource in /var/www/html/oop.php on line 67
Database Selection to main failed.

Code:

Class dbConnect
{
var $machine;
var $port;
var $user;
var $password;
var $query;
var $result;
var $dbase;
var $db;
var $sel;

function dbConnect($machine,$port,$user,$password)
{
$this->machine = $machine;
$this->port = $port;
$this->user = $user;
$this->password = $password;

$db = mysql_pconnect ("$machine","$user","$password")
if (!$db)
{
die ("Initial connection to DB failed.")
}
$this->db = $db;
}
function setDbase($dbase)
{
$this->dbase = $dbase;

$sel = mysql_select_db("$dbase",$db);
if(!$db)
{
die ("Database Selection to $dbase failed.");
}
}
}

$dbn = new dbConnect("localhost","3306","bob","hjhyt4kl5");

$dbn->setDbase("main");






So why can't I use $db?  Isn't the statement $this->db=$db making it
available to the setDbase function?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




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



[PHP] Re: functions and

2003-03-03 Thread Monty
You can't call a PHP function directly from an HTML tag. You'll instead need
to do something like this:



Then create a logout.php file that has your logout code.


> From: [EMAIL PROTECTED] (Martin Johansson)
> Newsgroups: php.general
> Date: Mon, 3 Mar 2003 23:32:16 +0100
> To: [EMAIL PROTECTED]
> Subject: Re: functions and 
> 
> Ok to make it simplier, this is what I wanna do!
> 
>  
> echo "Logout";
> 
> function logout()
> {
> .
> }
> 
> ?>
> 
> How do I do it!!!
> 
> /M
> 
>> Hi
>> I want to call a function logout() inside an  statement:
>> 
>> \">logout
>> 
>> > function logout()
>> {
>> 
>> }
>> ?>
>> 
>> but this doesnt work.. how shall I do it
>> /M
>> 
>> 
> 
> 


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



[PHP] Re: Run db query with db query?

2003-03-03 Thread Monty
What is the code for the inner query? Hard to advise you based on the small
bit of code you posted.

Are you using the same $result var for both queries? If so, that's why. Just
run two separate queries stored in to different result vars. I do this all
the time with no problems.


> From: [EMAIL PROTECTED] (Cf High)
> Newsgroups: php.general
> Date: Mon, 3 Mar 2003 16:45:52 -0800
> To: [EMAIL PROTECTED]
> Subject: Run db query with db query?
> 
> Hey all.
> 
> Got a problem here:
> 
> 1) I have a page that queries our db for info
> 
> 2) Based on the # of rows returned I loop through to create a set of
> formfields for each customer
> 
> 3) Within this loop I run another query to retrieve option elements for
> a particular category
> 
> The problem is that the inner query is overwriting the result resource for
> the outer query. So:
> 
> while ($q = mysql_fetch_row($result)) {
> 
> build form tables for each client and run inner query
> 
> html stuff
> 
> /* Calls db query to populate particular option category */
> write_select_options($tables,$form_fields,$where_clause);
> 
> }
> 
> What's the conventional method for running queries within queries?
> 
> Any leads most appreciated,
> 
> --Noah
> 
> --
> 
> 
> 


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



Re: [PHP] Re: functions and

2003-03-03 Thread Martin Johansson
it logs somone out of a session..

"Ray" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
does the function logout() log someone out of a session, or does it return
the url for where they go to logout?

and what about it isn't working?

On Monday 03 March 2003 16:32, you wrote:
> Ok to make it simplier, this is what I wanna do!
>
> 
> echo "Logout";
>
> function logout()
> {
> .
> }
>
> ?>
>
> How do I do it!!!
>
> /M
>
> > Hi
> > I want to call a function logout() inside an  statement:
> >
> > \">logout
> >
> >  > function logout()
> > {
> > 
> > }
> > ?>
> >
> > but this doesnt work.. how shall I do it
> > /M



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



Re: [PHP] Re: functions and

2003-03-03 Thread Leif K-Brooks
PHP is server-side, the PHP script has already executed by the time the 
client sees your output.  Try having the logout link call a page that 
calls the function.

Martin Johansson wrote:

Ok to make it simplier, this is what I wanna do!



echo "Logout";

function logout()
{
.
}
?>

How do I do it!!!

/M

 

Hi
I want to call a function logout() inside an  statement:
\">logout


but this doesnt work.. how shall I do it
/M
   



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.



Re: [PHP] Re: functions and

2003-03-03 Thread Ray
does the function logout() log someone out of a session, or does it return 
the url for where they go to logout?

and what about it isn't working?

On Monday 03 March 2003 16:32, you wrote:
> Ok to make it simplier, this is what I wanna do!
>
> 
> echo "Logout";
>
> function logout()
> {
> .
> }
>
> ?>
>
> How do I do it!!!
>
> /M
>
> > Hi
> > I want to call a function logout() inside an  statement:
> >
> > \">logout
> >
> >  > function logout()
> > {
> > 
> > }
> > ?>
> >
> > but this doesnt work.. how shall I do it
> > /M

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



[PHP] PHP & Majordomo -- front end or reporting tools?

2003-03-03 Thread J J
I'm looking for something possibly already done in PHP
to manage majordomo mailing lists.  Also, if there's a
way to read some log files and do some reporting  ie:

- how many messages sent
- how many bounced
etc


Is this possible with PHP or does anyone know of a
sample like this to get started?




__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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



[PHP] Re: functions and

2003-03-03 Thread Martin Johansson
Ok to make it simplier, this is what I wanna do!

Logout";

function logout()
{
.
}

?>

How do I do it!!!

/M

> Hi
> I want to call a function logout() inside an  statement:
>
> \">logout
>
>  function logout()
> {
> 
> }
> ?>
>
> but this doesnt work.. how shall I do it
> /M
>
>



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



[PHP] functions and

2003-03-03 Thread Martin Johansson
Hi
I want to call a function logout() inside an  statement:

\">logout



but this doesnt work.. how shall I do it
/M



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



Re: [PHP] working with file and mail

2003-03-03 Thread WebDev
I just got it working with this following code and again the problem the
first person in the list gets a perfect email, 2 person will see the first
person emailed in the list and so on the third sees the 2 and 1 I
got 1000 entries in the file and it is unexceptable to let person nr. 800
see 799 reply addresses !


 Text here.";

$subject = "Subject here";

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$myname." <".$myemail.">\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">\r\n";
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Server";

mail($contactemail, $subject, $message, $headers);

echo " Sendit mail to
$Realf $RealL done ...  ";
}

?>


what is now wrong ?

Thank you very much for any input







> Impossible.  The list() = split() construct will initialize any variables
> that do not contain values so it cannot possibly be a security risk.  User
> 100 cannot possibly see user 99's email address unless user 99's email
> address is on line 100.  If you want to be absolutely certain then
> initialize your variables before you split the line.
>



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



Re: [PHP] $PHP_SELF with redirected domain

2003-03-03 Thread bill
Thanks Chris for your thoughts, but no success yet.

Details interspersed below

Chris Hayes wrote:

> ...and the problem that the form immediately goes to the real url is that
> people see the real url?

No, the problem is that the URLs don't match.  The browser does accurately find
the page, etc., but the url is "wrong."  It makes it hard to evaluate site
statistics, etc.

> What about one of the following:
>
>   - chop off the subdir again by only putting the last part of $PHP_SELF as
> form action (f.i. with a combination of substr($PHP_SELF,...,...) and
> strpos('/') )

It would be easier to hard code the name of the page in the POST.  With this
suggestion, what if I move the page to a deeper subdir?  I want PHP_SELF to be
the same url as the page.

> or
>   -  when i do a full path in the redirect in .htaccess:
>  ErrorDocument 404 http://www.domain.org/redirect/redirect.php
>  it is treated as a fresh page and all form results are lost
>
>  but when i do
>  ErrorDocument 404 /redirect/redirect.php
>  in .htaccess,  the original post and get vars stay, and i suppose
> also the  original $PHP_SELF
>
> Maybe the same happens with your thing, i happen not to know what %1/$1
> does. If %1 is the domain, try to do it without that (but with the slash,
> so /$1 ). Worth a try innit?

Tried that and redirecting failed.

> or
> - simply make a new page that receives the file, or not using $PHP_SELF but
> the actual filename.

Can't do that, the page is repeatedly and indefinitely called.

Others have asked me to tell them if we find a solution.  Which we're still
looking for, I guess.  I'm still open to suggestions.

kind regards,

bill

> At 18:42 26-2-03, you wrote:
> >If I use $PHP_SELF as the action in a form where the domain name is
> >redirected,
> >I get the extra directory.
> >
> >Is there a way around that?
> >
> >Details:
> >
> >The domain name is redirected in .htaccess like this:
> >
> >RewriteCond   %{REQUEST_URI}  !domain2
> >RewriteRule   ^(.*)   %1/$1 [L]
> >
> >So, domain2 is really a directory on domain1, but http://domain2.com will be
> >taken to that directory on domain 1 as if it was the http root
> >
> >But, when using $PHP_SELF, I get the extra directory, so the form may start
> >here:
> >
> >http://domain2.com/myform.php
> >
> >But the $PHP_SELF forces the next POST page to be
> >
> >http://domain2.com/domain2/myform.php
> >
> >Ideas?
> >
> >kind regards,
> >
> >bill hollett
> >
> >
> >--
> >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



Re: [PHP] working with file and mail

2003-03-03 Thread Kevin Stone
Impossible.  The list() = split() construct will initialize any variables
that do not contain values so it cannot possibly be a security risk.  User
100 cannot possibly see user 99's email address unless user 99's email
address is on line 100.  If you want to be absolutely certain then
initialize your variables before you split the line.

- Kevin

- Original Message -
From: "WebDev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 5:29 PM
Subject: [PHP] working with file and mail


Hello all
I hat some help last night from John Holmes but I am still stuck with even
more option in the code

My Problem:

I have a text data file of users I wish to email all with custom information
from the file, each line represents a user with 21 seperated  datafields (
serperator "|" )

...
User|UserN|UserL|Pass|Email|Country|etc..|etrc..|| etc.||
...

The following code makes the loop a security risk well User 100 sees 99
email address 

\r\n";
$headers .= "To: ".$contactname." <".$contactemail.">\r\n";
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: Server

mail($contactemail, $subject, $message, $headers);

echo " mail to $Realf
$RealL done ...  ";
}
fclose ($fp);

?>


Can somebody please help me with the script ?






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



Fw: [PHP] Run db query with db query?

2003-03-03 Thread Kevin Stone
You don't have to use the same variable name to store the second results
pointer.

$resulta = mysql_query();
whle ($row = mysql_fetch_row($resulta))
{
$resultb = mysql_query();
while ($row = mysql_fetch_row($resultb))
{

}
}

- Kevin


- Original Message -
From: "CF High" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 5:45 PM
Subject: [PHP] Run db query with db query?


> Hey all.
>
> Got a problem here:
>
> 1) I have a page that queries our db for info
>
> 2) Based on the # of rows returned I loop through to create a set of
> formfields for each customer
>
> 3) Within this loop I run another query to retrieve option elements
for
> a particular category
>
> The problem is that the inner query is overwriting the result resource for
> the outer query. So:
>
> while ($q = mysql_fetch_row($result)) {
>
> build form tables for each client and run inner query
>
> html stuff
>
> /* Calls db query to populate particular option category */
> write_select_options($tables,$form_fields,$where_clause);
>
> }
>
> What's the conventional method for running queries within queries?
>
> Any leads most appreciated,
>
> --Noah
>
> --
>
>
>
>
> --
> 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] PHP reading wrong Linux folder

2003-03-03 Thread Matthew
Hello! I'm running PHP 4.2.3 on a Linux web-hosting server. Right now I
am trying to work with a PHP script (MLM Multi List Manager, in case it
matters) to handle mailing lists. It works terrific on one server, but on
another one it has a very strange problem that I was hoping someone would
know how to solve.
The script is running from a directory, let's call it "phproot".
1) The script first opens up a filename in "subdirectoryA," reads the
contents, and closes the file.
2) Then the script does some business, opens ANOTHER file, this time in
"subdirectoryB," makes some changes, and closes that file.
(It does all this using variables. So, the script in the "phproot"
directory does the first bit of business with "$folder1/$file1", then does
the second bit of business with "$folder2/$file2".)
So what's the problem? The problem is that when the script does the
stuff in step 2, instead of just reading and writing the file in
"subdirectoryB," it for some reason creates a new subdirectory UNDERNEATH
"subdirectoryA"--so now the file I *wanted* to access remains untouched, and
instead I have a brand-new directory, "phproot/subdirectoryA/subdirectoryB"!
Why is this happening? It's like the script somehow got "stuck" in
"subdirectoryA" and now treats it as the root directory from which the
script is running. Is there some sort of php.ini setting that's wrong here,
some environment setting that causes this weird behavior? Like I said, the
script itself worked fine under another setup, so it's not a fundamental
script flaw. Any ideas?

Matt



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



[PHP] Run db query with db query?

2003-03-03 Thread CF High
Hey all.

Got a problem here:

1) I have a page that queries our db for info

2) Based on the # of rows returned I loop through to create a set of
formfields for each customer

3) Within this loop I run another query to retrieve option elements for
a particular category

The problem is that the inner query is overwriting the result resource for
the outer query. So:

while ($q = mysql_fetch_row($result)) {

build form tables for each client and run inner query

html stuff

/* Calls db query to populate particular option category */
write_select_options($tables,$form_fields,$where_clause);

}

What's the conventional method for running queries within queries?

Any leads most appreciated,

--Noah

--




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



[PHP] working with file and mail

2003-03-03 Thread WebDev
Hello all
I hat some help last night from John Holmes but I am still stuck with even more option 
in the code

My Problem:

I have a text data file of users I wish to email all with custom information from the 
file, each line represents a user with 21 seperated  datafields ( serperator "|" )

...
User|UserN|UserL|Pass|Email|Country|etc..|etrc..|| etc.||
...

The following code makes the loop a security risk well User 100 sees 99 email address 


\r\n"; 
$headers .= "To: ".$contactname." <".$contactemail.">\r\n"; 
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n"; 
$headers .= "X-Priority: 1\r\n"; 
$headers .= "X-MSMail-Priority: High\r\n"; 
$headers .= "X-Mailer: Server

mail($contactemail, $subject, $message, $headers); 

echo " mail to $Realf $RealL done 
...  "; 
}
fclose ($fp);

?>


Can somebody please help me with the script ?




[PHP] Re: post xml file

2003-03-03 Thread qt
Dear Sirs,

I try to post xml file with following script;

Until today I was using following script for http post. But now I shoul post
https. When I changing HTTP to HTTPS, I am getting this error

Bad Request
HTTP/1.1 400 Bad Request Date: Mon, 03 Mar 2003 21:07:18 GMT Server:
Apache/1.3.27 (Unix) Connection: close Content-Type: text/html;
charset=iso-8859-1

Any idea, am I doing right to use following method to post xml file. And why
I can not post https?

---

$str = "xml markuped text.";

  $len = strlen($str);

$p = "POST /servlet/com.oksijen.bulkmessaging.xml.SmsToMany
HTTP/1.1\r\n";
  $p.= "Host: 212.65.135.163 \r\n";
  $p.= "Content-type: application/x-www-form-urlencoded\r\n";
  $p.= "Content-length: $len\n\n";
  $p.= "$str\n";
  $p.= "\r\n";
$server = "212.65.135.163";
$connection_timeout = 10;
$fp = fsockopen ($server, 80, &$errno, &$errstr, $connection_timeout);

  fputs ($fp,$p);
$recdata = "";
while (!feof($fp))
 {
  $recdata .= fgets ($fp,128);
print "$recdata";
 }
  fclose ($fp);

$sonuc = trim(substr($recdata,-19));

$pos = 0;
$pos = strpos($recdata, "Message Failed");



"Qt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear Sirs,
>
> I am trying to post a xml file to following http. But I can not. where can
I
> find some source to read.
>
> https://xxx.xxx.xxx.xx/servlet/com.oks.buing.xml.detdrd
>
> Any help welcome
>
>



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



[PHP] RE: RE: Bitwise operator question

2003-03-03 Thread Philip Hallstrom
Yes... it is the | operator that is doing it.

>From the man pages:

$a & $b And Bits that are set in both $a and $b are set.
$a | $b Or Bits that are set in either $a or $b are set.


So, let's say:

$a = 5; # 0101
$b = 3; # 0011

Then:

$a & $b

  0101
& 0011
= 0001 (1)

and

$a | $b

  0101
& 0011
= 0111 (7)

does that help?  It's not *summing* the values... although in your case it
looks like it is... it's OR'ing them.


On Mon, 3 Mar 2003, Dan Sabo wrote:

> Thanks Philip,
>
> OK I understand the binary thing but that line, I just don't see it, It's
> not the or operator that's summing up the two binary values is it?
>
> Dan
>
> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 3:53 PM
> To: Dan Sabo
> Cc: [EMAIL PROTECTED]
> Subject:  RE: Bitwise operator question
>
>
> Yes.  Oops.
>
> -philip
>
> On Mon, 3 Mar 2003, Dan Sabo wrote:
>
> > Hi Phillip,
> >
> > Don't U mean
> >
> > 0001
> > |   0100
> > =   0101
> >
> > ?
> >
> > Dan
> >
> > -Original Message-
> > From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 03, 2003 2:33 PM
> > To: Dan Sabo
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: Bitwise operator question
> >
> >
> > Here's how I think about it...
> >
> > CREATE_RECORDS = 1 in decimal and 0001 in binary.
> > ALTER_RECORDS = 4 in decimal and 0101 in binary.
> >
> > that line returns a binary string where *any* of the bits are 1, so line
> > them up:
> >
> >0001
> > |  0101
> > =  0101
> >
> > which is 5.
> >
> > On Mon, 3 Mar 2003, Dan Sabo wrote:
> >
> > > Hi,
> > >
> > > I'm reading the description of Bitwise Operators on page 81 of
> > "Professional
> > > PHP 4", the Wrox book.  In the highlighted example on that page, the
> line
> > of
> > > code...
> > >
> > > $user_permissions = CREATE_RECORDS | ALTER_RECORDS;
> > >
> > > the description in the book says that this line is building a set of
> user
> > > permissions out of the previously created constants with the OR operator
> > (I
> > > understand what OR means).  The value of $user_permissions is set to
> > either
> > > 1 or 4, which is in fact 5 (0101).  But how is this single line doing
> > that?
> > > The explanation was cryptic (to me).
> > >
> > >
> > >
> > > --
> > > 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



RE: [PHP] RE: Bitwise operator question

2003-03-03 Thread Dan Sabo
Thanks Philip,

OK I understand the binary thing but that line, I just don't see it, It's
not the or operator that's summing up the two binary values is it?

Dan

-Original Message-
From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 3:53 PM
To: Dan Sabo
Cc: [EMAIL PROTECTED]
Subject: [PHP] RE: Bitwise operator question


Yes.  Oops.

-philip

On Mon, 3 Mar 2003, Dan Sabo wrote:

> Hi Phillip,
>
> Don't U mean
>
>   0001
> | 0100
> = 0101
>
> ?
>
> Dan
>
> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 2:33 PM
> To: Dan Sabo
> Cc: [EMAIL PROTECTED]
> Subject: Re: Bitwise operator question
>
>
> Here's how I think about it...
>
> CREATE_RECORDS = 1 in decimal and 0001 in binary.
> ALTER_RECORDS = 4 in decimal and 0101 in binary.
>
> that line returns a binary string where *any* of the bits are 1, so line
> them up:
>
>0001
> |  0101
> =  0101
>
> which is 5.
>
> On Mon, 3 Mar 2003, Dan Sabo wrote:
>
> > Hi,
> >
> > I'm reading the description of Bitwise Operators on page 81 of
> "Professional
> > PHP 4", the Wrox book.  In the highlighted example on that page, the
line
> of
> > code...
> >
> > $user_permissions = CREATE_RECORDS | ALTER_RECORDS;
> >
> > the description in the book says that this line is building a set of
user
> > permissions out of the previously created constants with the OR operator
> (I
> > understand what OR means).  The value of $user_permissions is set to
> either
> > 1 or 4, which is in fact 5 (0101).  But how is this single line doing
> that?
> > The explanation was cryptic (to me).
> >
> >
> >
> > --
> > 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] Re: query strings

2003-03-03 Thread Philip Hallstrom
Spaces usually get converted to %20 when passed around in urls... take a
look at the urldecode() and parse_str() functions...

http://www.php.net/manual/en/function.urldecode.php
http://www.php.net/manual/en/function.parse-str.php

On Mon, 3 Mar 2003, Sunfire wrote:

> i have a might i say a very very large/long query string i have to run to
> pass variable values from one page to another with a button... the button
> works and the query string are passing variables right but at the end of the
> query string (it passes like 21 variable values) the last variable content
> that gets passed gets messed up.. i mean if i have like this:
> page.php?.&edit_company=$company
> so lets say company has the value of "hi world" in it.. the value is
> supposed to be passed with "hi world" but for some reason i keep getting
> "hi%20world" instead of "hi world"
>
> any reason for that.. if you need i can post my query string and button code
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003
>
>
> --
> 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] RE: Bitwise operator question

2003-03-03 Thread Philip Hallstrom
Yes.  Oops.

-philip

On Mon, 3 Mar 2003, Dan Sabo wrote:

> Hi Phillip,
>
> Don't U mean
>
>   0001
> | 0100
> = 0101
>
> ?
>
> Dan
>
> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 2:33 PM
> To: Dan Sabo
> Cc: [EMAIL PROTECTED]
> Subject: Re: Bitwise operator question
>
>
> Here's how I think about it...
>
> CREATE_RECORDS = 1 in decimal and 0001 in binary.
> ALTER_RECORDS = 4 in decimal and 0101 in binary.
>
> that line returns a binary string where *any* of the bits are 1, so line
> them up:
>
>0001
> |  0101
> =  0101
>
> which is 5.
>
> On Mon, 3 Mar 2003, Dan Sabo wrote:
>
> > Hi,
> >
> > I'm reading the description of Bitwise Operators on page 81 of
> "Professional
> > PHP 4", the Wrox book.  In the highlighted example on that page, the line
> of
> > code...
> >
> > $user_permissions = CREATE_RECORDS | ALTER_RECORDS;
> >
> > the description in the book says that this line is building a set of user
> > permissions out of the previously created constants with the OR operator
> (I
> > understand what OR means).  The value of $user_permissions is set to
> either
> > 1 or 4, which is in fact 5 (0101).  But how is this single line doing
> that?
> > The explanation was cryptic (to me).
> >
> >
> >
> > --
> > 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



Re: [PHP] Help with SQL statement

2003-03-03 Thread David Otton
On Mon, 03 Mar 2003 12:04:37 -0800, you wrote:

>I have a database that holds a start date and an end date and I have a form
>with a start date and an end date. The report would be to get everything in
>the database's date ranges that overlap the form's date range. I am having
>trouble figuring out how to get this to work, any help is appreciated.

[if I understand you correctly]

you have 4 variables

db_start
db_end
form_start
form_end

and you want to select all rows where the range (db_start to db_end)
overlaps in any way with (form_start to form_end)?

You need two conditions, joined with an OR

(form_start => db_start AND form_start <= db_end)
OR
(form_end => db_start AND form_end <= db_end)

(BTW, this is an SQL question, not a PHP one.)


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



[PHP] query strings

2003-03-03 Thread Sunfire
i have a might i say a very very large/long query string i have to run to
pass variable values from one page to another with a button... the button
works and the query string are passing variables right but at the end of the
query string (it passes like 21 variable values) the last variable content
that gets passed gets messed up.. i mean if i have like this:
page.php?.&edit_company=$company
so lets say company has the value of "hi world" in it.. the value is
supposed to be passed with "hi world" but for some reason i keep getting
"hi%20world" instead of "hi world"

any reason for that.. if you need i can post my query string and button code




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



[PHP] Re: All Code Executing Even After header() Redirect

2003-03-03 Thread Bobby Patel
Add an exit statement after the header call. But I thought the same thing
that after header nothing would be executed.

 if (!LoggedIn()) {  // If not logged in, take to Login page.
 header("Location: /login.php");
exit();
 }

I just gave you this soultion to solve your problem, maybe someone else can
shed some light why LogAccess() is executed.

"Monty" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> At the top of every page in my site I have a snippet of code that
> authenticates the user by checking for valid SESSION vars and their
> contents. If they don't, they are redirected with a header() statement to
a
> log-in page like this:
>
> include_once("function_library.php");
> session_start();
>
> if (!LoggedIn()) {  // If not logged in, take to Login page.
> header("Location: /login.php");
> }
>
> LogAccess($_SESSION['user']);  // This function logs user's access.
>
>
> I noticed that the LogAccess() function I have after the header() redirect
> is executing, even if the user is not logged in and is redirected to the
> Log-In page. I did confirm that the LoggedIn() custom function is working
> properly and returning the right value.
>
> I thought the code below the header() redirect would not actually be
> executed unless the user was logged in and allowed to proceed. Is this how
> PHP is supposed to work? Is there any way to prevent the script from
> executing below a certain point if the user is not logged in?
>
> Thanks,
>
> Monty
>



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



Re: [PHP] All Code Executing Even After header() Redirect

2003-03-03 Thread David Otton
On Mon, 03 Mar 2003 14:50:00 -0500, you wrote:

>I thought the code below the header() redirect would not actually be
>executed unless the user was logged in and allowed to proceed. Is this how
>PHP is supposed to work? Is there any way to prevent the script from

header() isn't a goto - it just outputs a header. A line of text, just
like echo(); It's the responsibility of the client to then interpret
that line of text and make another http request.

You're seeing correct behaviour, it's not supposed to alter program
flow.

>executing below a certain point if the user is not logged in?

exit()


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



[PHP] Help with SQL statement

2003-03-03 Thread Sarah Heffron
I have a database that holds a start date and an end date and I have a form
with a start date and an end date. The report would be to get everything in
the database's date ranges that overlap the form's date range. I am having
trouble figuring out how to get this to work, any help is appreciated.

Sarah



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



[PHP] All Code Executing Even After header() Redirect

2003-03-03 Thread Monty
At the top of every page in my site I have a snippet of code that
authenticates the user by checking for valid SESSION vars and their
contents. If they don't, they are redirected with a header() statement to a
log-in page like this:

include_once("function_library.php");
session_start();

if (!LoggedIn()) {  // If not logged in, take to Login page.
header("Location: /login.php");
}

LogAccess($_SESSION['user']);  // This function logs user's access.


I noticed that the LogAccess() function I have after the header() redirect
is executing, even if the user is not logged in and is redirected to the
Log-In page. I did confirm that the LoggedIn() custom function is working
properly and returning the right value.

I thought the code below the header() redirect would not actually be
executed unless the user was logged in and allowed to proceed. Is this how
PHP is supposed to work? Is there any way to prevent the script from
executing below a certain point if the user is not logged in?

Thanks,

Monty


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



[PHP] RE: Bitwise operator question

2003-03-03 Thread Dan Sabo
Hi Phillip,

Don't U mean

0001
|   0100
=   0101

?

Dan

-Original Message-
From: Philip Hallstrom [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 2:33 PM
To: Dan Sabo
Cc: [EMAIL PROTECTED]
Subject: Re: Bitwise operator question


Here's how I think about it...

CREATE_RECORDS = 1 in decimal and 0001 in binary.
ALTER_RECORDS = 4 in decimal and 0101 in binary.

that line returns a binary string where *any* of the bits are 1, so line
them up:

   0001
|  0101
=  0101

which is 5.

On Mon, 3 Mar 2003, Dan Sabo wrote:

> Hi,
>
> I'm reading the description of Bitwise Operators on page 81 of
"Professional
> PHP 4", the Wrox book.  In the highlighted example on that page, the line
of
> code...
>
> $user_permissions = CREATE_RECORDS | ALTER_RECORDS;
>
> the description in the book says that this line is building a set of user
> permissions out of the previously created constants with the OR operator
(I
> understand what OR means).  The value of $user_permissions is set to
either
> 1 or 4, which is in fact 5 (0101).  But how is this single line doing
that?
> The explanation was cryptic (to me).
>
>
>
> --
> 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] Re: Bitwise operator question

2003-03-03 Thread Philip Hallstrom
Here's how I think about it...

CREATE_RECORDS = 1 in decimal and 0001 in binary.
ALTER_RECORDS = 4 in decimal and 0101 in binary.

that line returns a binary string where *any* of the bits are 1, so line
them up:

   0001
|  0101
=  0101

which is 5.

On Mon, 3 Mar 2003, Dan Sabo wrote:

> Hi,
>
> I'm reading the description of Bitwise Operators on page 81 of "Professional
> PHP 4", the Wrox book.  In the highlighted example on that page, the line of
> code...
>
> $user_permissions = CREATE_RECORDS | ALTER_RECORDS;
>
> the description in the book says that this line is building a set of user
> permissions out of the previously created constants with the OR operator (I
> understand what OR means).  The value of $user_permissions is set to either
> 1 or 4, which is in fact 5 (0101).  But how is this single line doing that?
> The explanation was cryptic (to me).
>
>
>
> --
> 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] Bitwise operator question

2003-03-03 Thread Dan Sabo
Hi,

I'm reading the description of Bitwise Operators on page 81 of "Professional
PHP 4", the Wrox book.  In the highlighted example on that page, the line of
code...

$user_permissions = CREATE_RECORDS | ALTER_RECORDS;

the description in the book says that this line is building a set of user
permissions out of the previously created constants with the OR operator (I
understand what OR means).  The value of $user_permissions is set to either
1 or 4, which is in fact 5 (0101).  But how is this single line doing that?
The explanation was cryptic (to me).



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



Re: [PHP] News Content

2003-03-03 Thread David Otton
On Mon, 03 Mar 2003 13:09:39 -0500, you wrote:

>Anyone know of any pre-built modules or whatnot that provide some news 
>content and/or links and captions via PHP/MySQL that can be integrated with 
>minimal disruption to a site?  (A prerequisite being that it acts legally in 
>terms of gathering the info. ;)

What kind of news? Paid or unpaid? You could try searching for RSS
feeds... other than that I suggest you start searching here

http://directory.google.com/Top/Computers/Software/Internet/Site_Management/Content_Management/Content_Providers/

Integration is pretty simple - a cron job that grabs the feed every n
minutes and updates a database table.


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



Re: [PHP] ICQ # validation

2003-03-03 Thread David Otton
On Mon, 3 Mar 2003 14:00:43 -0500, you wrote:

>Maybe I'm off my rocker, but I don't see how this can't work. I'm trying to validate 
>an ICQ number, and assuming a valid one is between 7 and 9 numbers. My line of code 
>is this:
>
>if(ereg("^[0-9]{7,9}$", $_REQUEST["icqnumber"])) {
>print("a-okay!");
>} else {
>print("error msg");
>}
>
>I've submitted the ICQ # 2264532680, but it validates. Any ideas?

if (ereg ("^[0-9]{7,9}$", "2264532680")) {
print ("a-okay!");
} else {
print ("error msg");
}

fails. I suspect you're not grabbing the variable from the environment
correctly.


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



Re: [PHP] ICQ # validation

2003-03-03 Thread 1LT John W. Holmes
Use single quotes around your pattern.

if(ereg('^[0-9]{7,9}$',...

With the double quotes, PHP is probably seeing the $ and looking for a
variable, even though it's at the end of the string.

---John Holmes...

- Original Message -
From: "Liam Gibbs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 2:00 PM
Subject: [PHP] ICQ # validation


Maybe I'm off my rocker, but I don't see how this can't work. I'm trying to
validate an ICQ number, and assuming a valid one is between 7 and 9 numbers.
My line of code is this:

if(ereg("^[0-9]{7,9}$", $_REQUEST["icqnumber"])) {
print("a-okay!");
} else {
print("error msg");
}

I've submitted the ICQ # 2264532680, but it validates. Any ideas?


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



[PHP] max_execution_time and set_time_limit() problem.

2003-03-03 Thread Eric Wood
I'm uploading a large file through my web page and after 30 seconds, the
fails with an error.   I bumbed the max_execution_time parameter in
/etc/php.ini to 600 seconds and restarted apache.  Still errors at 30
seconds.  I added set_time_limit(600); to various place in my file upload
handling script... still errors at 30 seconds.

Is this just a good 'ol bug in my Redhat 7.3 version of PHP?:

$ rpm -q php
php-4.1.2-7.3.6


Thanks,
-eric wood


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



[PHP] Re: PHP shopping carts

2003-03-03 Thread Henry Grech-Cini
Hi,

Please let me know if you find one thats any good?

Henry

"Dan Sabo" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> What I'm looking for is either an open source or commercial solution which
> is supported by either commercial or OS add on modules.  I've looked at OS
> commerce and X cart so far, wanted to look at a few more.
>
> I'm hoping to find one which has a hotel booking or reservation system
> either as a standard or as an add on mod, and am doing some comparisons.
>
> Thanks,
>
> Dan
>



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



  1   2   >