[PHP] str_replace

2002-10-31 Thread rick
How could this be written better? Is there a way to do it all in 1 line?

$file = str_replace(" ", "", "$file");
$file = str_replace("'", "", "$file");
$file = str_replace("\\", "", "$file");
$file = str_replace("/", "", "$file");
$file = str_replace(":", "", "$file");
$file = str_replace("+", "", "$file");
$file = str_replace("&", "", "$file");
$file = str_replace("=", "", "$file");
$file = str_replace("@", "", "$file");
$file = str_replace("%", "", "$file");
$file = str_replace("^", "", "$file");
$file = str_replace("*", "", "$file");
$file = str_replace("~", "", "$file");
$file = str_replace("`", "", "$file");
$file = str_replace(";", "", "$file");
$file = str_replace("|", "", "$file");
$file = str_replace("{", "", "$file");
$file = str_replace("}", "", "$file");
$file = str_replace("[", "", "$file");
$file = str_replace("]", "", "$file");
$file = str_replace("%", "", "$file");
$file = str_replace("?", "", "$file");
$file = str_replace("(", "", "$file");
$file = str_replace(")", "", "$file");
$file = str_replace("#", "", "$file");

Thanks!  :)

..rick


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




[PHP] no php archives?

2001-03-12 Thread rick

I can't get to the php archives... every time i try a search of the
mailing list, I get nothing...   :-(

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] WebServer

2001-12-28 Thread rick

 
Dear Members  ,

  Does anybody of you have a webserver at home 
using ADSL or other connections ?

If any , could you tell me What would be the acceptable Hardware to run 
5 or more sites  at home with an
256 k ADSL ? (Memory , proccesor , etc etc )


Do I have to have Two Servers ? (The WebServer ) and the Intranet Server 
to access through my computer ?

Would you help me please in a near future with a few questions about how 
to set up and so on .???


Thanks  guys in advance

Ricardo





[PHP] Control Panel , Webmin or similar Written in PHP

2001-12-29 Thread rick

Hi  guys , 


 I was Wondering if it would be possible to write a proyect like Control 
Panel or  WebMin (both are in Perl ) using  PHP instead or PERL ? 

Would it be possible ? 

PHP has the power and flexibility like Perl to write TRUE Systems programs that
could be able to manage all the aspects related to System Administration ?? 

If there any proyect I would like to hear about it and join it . 

Thanks , I would like your opinion about this topic . 

Ger Karcher 







[PHP] Control Panel , Webmin or similar Written in PHP

2001-12-29 Thread rick

Hi  guys , 


 I was Wondering if it would be possible to write a proyect like Control 
Panel , WebMin (both are in Perl ) using PHP instead of PERL ? 

Would it be possible ? 

PHP has the power and flexibility like Perl to write TRUE Systems programs that
could be able to manage all the aspects related to System Administration ?? 

If there any proyect I would like to hear about it and join it . 

Thanks , I would like your opinion about this topic . 

Ger Karcher 






[PHP] Apache and PHP under win98 help !

2002-01-08 Thread rick

hi guys , 

 I have a problem with my Apache and PHP configuration under 
win 98 .

I can't make it works..

This is my httpd lines pointing to php : 

 LoadModule php4_module c:\php\dlls\php4apache.dll
AddType application/x-httpd-php .php4

ScriptAlias /php4/ "C:/php/"
Action application/x-httpd-php4 "/php/php.exe"
AddType application/x-httpd-php4 .php

I had this configuration before and all works fine , but now 
When I try to run Apache for the first time , Its tell me that he 
can't  find the php4apache.dll library . 

but the library is there.??!!! , next I change the path to point 
to sapi directory where the library also exists , but I get the same 
error ..

The most amazing part is that when I browse the directory I can't see 
the file ! but when I try to copy the file inside the directory
its tells me that the file already exists ! 

so , What's happend ?  

Somebody could help me ??  

thanks in advance , guys 


Ricardo Karcher 







[PHP] Package Ready to Install !!!

2002-01-16 Thread rick

Hi guys , 

  I would like to know if there any package ready to install with Apache , 
Mysql and PHP4 under Windows ??? 

I time ago I think , I saw such a package but I don't remenber the address or the link 
to the web site . 

If any of you know something I'll be looking forward to hear from you guys . 

Thanks in Advance , 

Ricardo Karcher 




[PHP] ImageMagick and Convert In Php

2002-02-21 Thread Rick

Hello All, 

Ok , I am about to loose my mind... this list is my last option i think  :) 

this is what i have tried : 
system("convert -pen black -draw 'text 120,60 YourText Here'  imageA.jpg imageB.jpg");
The above does not work , the most i can get it imageA.jpg Becomes imageB.jpg but the 
text does not get drawn

I striped the slashes, this does not work either, i su - to what my webserver runs on 
to see if i can run the system command 
via console, it works just fine , so i tried : 

$a = escapeshellcmd('-pen black -draw');
$b = escapeshellarg('text 120,20  YourTextHere);
$c = escapeshellcmd("test.jpg doggy.jpg");
system("convert $a $b $c");

Same as the above, imageA becomes imageB and thats it. Permissions for testing are 
-rwxrwxrwx 

a basic test with system("convert -scale 500x600" imageA.jpg imageB.jpg"); = Works 
Perfect

I am sorry for coming to the list for help , but i am at a final loss, i have also 
tried shell_exec and exec to clear anything up. I have hit the imagemagick mail list 
and i got  "Php Might have some issues" so if anyone can lend a hand to get that 
system command to work , i would be most appreciative.

Best Wishes
Rick Wilson 



[PHP] Uploading files with HTTP-Upload

2002-03-18 Thread Rick

We have an application that used PHP's FTP function to upload files. Now it
worked until we upgraded to 4.1.2. We have now downgraded back to 4.1.1 but
still no luck, it won't work.

We have set upload_max_filesize and post_max_size as well, and that doesn't
seem to help. Here is the following code. It has not changed since it went
live:

srand((double)microtime()*100); //Create random timestamp for the
file temp file
$randval = rand();
//Creates a temp file that the file gets put in, we then read that file
$tmpfile = "/tmp/" . $file_name . $randval;
copy($file,$tmpfile);//line 272
ftp_put($this->connection,$file_name,$tmpfile,FTP_BINARY); //line 273
unlink($tmpfile);
return true;

This is inside a function, and $file is the handle for the uploaded file and
$file_name is the name of the uploaded file. The weird thing is that this
will work for small files (< 1MB). Anything bigger, it gives us the
following errors:

Warning: Unable to open 'none' for reading: No such file or directory in
/Ftp.inc on line 272
Warning: error opening /tmp/IP4_0EngALLMsi.exe1419195771 in /Ftp.inc on line
273

Any ideas? It seems as if the big files are not getting passed in?

Thanks,
/rick







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




[PHP] HTTP_Upload with PHP

2002-03-20 Thread Rick

We have an application that used PHP's FTP function to upload files. Now it
worked until we upgraded to 4.1.2. We have now downgraded back to 4.1.1 but
still no luck, it won't work.

We have set upload_max_filesize and post_max_size as well, and that doesn't
seem to help. Here is the following code. It has not changed since it went
live:

srand((double)microtime()*100); //Create random timestamp for the
file temp file
$randval = rand();
//Creates a temp file that the file gets put in, we then read that file
$tmpfile = "/tmp/" . $file_name . $randval;
copy($file,$tmpfile);//line 272
ftp_put($this->connection,$file_name,$tmpfile,FTP_BINARY); //line 273
unlink($tmpfile);
return true;

This is inside a function, and $file is the handle for the uploaded file and
$file_name is the name of the uploaded file. The weird thing is that this
will work for small files (< 1MB). Anything bigger, it gives us the
following errors:

Warning: Unable to open 'none' for reading: No such file or directory in
/Ftp.inc on line 272
Warning: error opening /tmp/IP4_0EngALLMsi.exe1419195771 in /Ftp.inc on line
273

Any ideas? It seems as if the big files are not getting passed in?

Thanks,
/rick



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




[PHP] php4apache.dll please !!!!

2001-12-14 Thread rick

hi guys ,

 could you tell me please , Where I can find the 
php4apache.dll ? 

Thanks ,

Ricardo 










[PHP] php in free()

2001-12-17 Thread Rick

I'm running a script that times out durring a certian action.

Fatal error: Maximum execution time of 30 seconds exceeded in
/usr/local/web/htdocs/mail/functions.php on line 1200

The error logs say: php in free(): warning: recursive call.

The offending lines of code, and here's what really gets me, is a simple
while():

while(!feof($socket)){
 $data .= fgets($socket, 1024);
}

Which is just reading data from an SMTP socket. I haven't been able to find
any information about this php in free() error. Any ideas?

Thanks!

dan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] new lines in text fields

2001-07-06 Thread rick

Have you tried putting the newline character (\n) into your html?  That
works great for me.  My only problem is that the output from an XSL
transformation has all the line breaks stripped out...

- Original Message -
From: "Mat Marlow" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 8:06 AM
Subject: [PHP] new lines in text fields


> Hi all,
> I am in desperate need for a solution to HTML text fields not storing new
> lines. I'm storing news articles in a database but all the text just ends
up
> in a big block because it ignores line breaks. Is thre a way around this
> without having to upload text files?
>
> Thanks,
>
> Mat
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] functions?

2001-07-06 Thread rick

instead of returning that line, put it into some variable... like:

while ($row = mysql_fetch_row ($result)) {
  $map_list .= "$row[0]";  }
}
return $map_list;

- Original Message -
From: <[EMAIL PROTECTED]>
To: "'Php-General (E-Mail)" <[EMAIL PROTECTED]>
Sent: Friday, July 06, 1979 8:27 AM
Subject: [PHP] functions?


> Okay there is a file called global.inc
>
> 
> // display a list from the DB
>
> function list_of_maps () {
>
> db_connect ();
> $sql = "SELECT mapname,rowid FROM maps";
> $result = mysql_query($sql);
>
> while ($row = mysql_fetch_row ($result)) {
> return "$row[0]";  }
>
> }
>
>
>
> ?>
>
> But when I call it like this:
>
> 
> include('global.inc');
> echo list_of_maps ();
>
> ?>
>
> It only shows the first result from the db... How do I get it to list them
> all?
>
>
> Susan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Next Book

2001-07-07 Thread rick

I started off with a Core PHP4 book and quickly outgrew it.  I find that
most of the books don't get much past the basics either, so I find myself
sticking to www.php.net and it's wonderful searchable documentation.

I have read Web Application Development with PHP4.0
(http://www.phpwizard.net), which I enjoyed.  While it does go into some
more advanced PHP syntax, it mostly discusses application development
concepts -- stuff that would be boring for any experienced programmer of
other languages.  I think it's geared at the people who picked PHP up as
their first language (me included).

I'd be interested in some good PHP books as well, I feel like I'm in a rut.
At first, PHP was all new, and I was learning s much... but now if I
think up a task I can visualize how to do it in PHP pretty easily.  I know I
have a LOT to learn, but I think my problem is I don't know proper
programming techniques...

Has anyone tried to expand into other languages?  I like perl due to its
heavy similarity to PHP, but I like to focus on web stuff.

rick

- Original Message -
From: "Chris Lott" <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Saturday, July 07, 2001 11:23 PM
Subject: [PHP] Next Book


> Finished with Beginning PHP from Wrox. Am eyeing Advanced PHP from Wrox.
> Other good books I should think about? Recommendations? Reviews? I know
the
> PHP FAQ has pointers to books, but I am looking for recommendations on
what
> I SHOULD get as I transition from a Cold Fusion person to a PHP devotee :)
>
> Also looking for a good book on MySQL. The MySQL/MSQL book from O'Reilly
is
> pretty dated.
>
> c


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Variables

2001-07-10 Thread rick

Same as with two numerical values... use the == operator

if($text1 == $text2) /* only true if the 2 vars are equal */

if($text1 = $text2) /* this sets $text1 to the same value as text2 and is
always true unless $text2 = false */

http://php.net/manual/en/language.operators.comparison.php

- Original Message -
From: "James Bartlett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 7:12 PM
Subject: [PHP] Variables


Hi,

This might sound really simple but plz humour me :)

How can I tell if two text variables are equal to one another?

If I use..

if($text1 = $text2)
{
echo "The variables are equal";
}
else
{
echo "The variables are not equal";
}

then the code in the else state is always printed even if I know for a fact
that the variables are equal...

Any suggestions?

James



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mail() problem

2004-06-02 Thread Rick
Hi All,
Does anyone know a good format for sending email using the mail()
function that doesnt get stopped by antispam software?

I need to send and email from my sever when a new member creates an account,
this ive done but my email gets binned straight away? must be the headers?

Regards

Rick

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



[PHP] PHP analytics

2006-12-06 Thread Rick.
Hello



I am new to php and I would like some guidance from those who have a bit more 
expereince with PHP


I will be attempting to do a bit of tracking and web analytics. Basically, the 
user will login 
and from there everything that he clicked will be recorded in a database and 
analyzed
i.e user behaviour, patterns with different user groups. 

Is this possible with php and it is a major undertaking ? just trying not to 
get ahead of myself here..

are there any tutorials or scripts or books that you know of ?



Thanks 
Regards
Rick





Re: [PHP] **** Converting dynamic webpages into static HTML pages

2002-11-27 Thread Rick Widmer



When running PHP as a static binary, how does it handle text (HTML code)
that falls outsize of the  tags.  Is the text ignored or
outputted?


Outputted.  This can be very handy.  One thing I use it for is customizing 
configuration files where only a small percentage of the overall text needs 
to be modified.  Using  in the text makes it very powerful.



Now, my client has requested that I give him the ability to generate a
static version of the catalog so that he can burn it onto a CD for
distribution at trade shows.  He wants the CD to be a snapshot of the
catalog.  Furthermore, he wants to be able to generate this "snapshot"
frequently so that pricing info on the CD will be current.  To
accommodate this, the process for generating the snapshot must be easy
and intuitive.


If you are lucky, and the web site has links that will get you to all the 
products without searching or other  based activity, just point wget 
-kr at the site, and you will end up with a directory containing flat HTML 
files for all the database generated pages in the site.  Be sure the 
destination directory is in the same path as you want it to appear from the 
root directory of the CD.  You won't be able to put it in the root directory.

If you don't have good links in the program, you can use  -i 
input_file   to name all the pages you need to grab.

Try  >man wget   for details.

I haven't tried making this something that can be accessed from a CD using 
file:// based URLs, but I have been able to grab entire web sites to be 
hosted with Apache.  You may need to use sed or something to clean up the 
 tags.

Rick


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



Re: [PHP] Method for displaying Downline

2002-11-30 Thread Rick Widmer
At 06:47 PM 11/29/02 -0800, Daren Cotter wrote:

Must you send three separate requests to the list?  One is enough.


You might find some useful information here:

   http://marc.theaimsgroup.com/?l=php-general&m=95423103630080&w=2



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




Re: [PHP] Method for displaying Downline

2002-11-30 Thread Rick Widmer

IT IS CONSIDERED VERY RUDE TO SPAM THE LIST WITH REPEATED MESSAGES

ONE IS ENOUGH!!

Yes, I am shouting.


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




Re: [PHP] Why all the returned emails from this list?

2002-12-02 Thread Rick Widmer
At 11:16 PM 12/1/02 -0800, Troy May wrote:

I'm getting nailed with a bunch of returned emails like this:

[EMAIL PROTECTED] - no such user here.

There is no user by that name at this server.
: Message contains [1] file attachments


What's going on?  Each one has a different address, but the terminalgmb.ru
part is the same for each one.



I believe you are the victim of one of the new viruses. (klez?)  Someone 
with your name in their address book has the virus, and you are the lucky 
one it chose to use for the From: address on all the mails it is sending out.

Don't open that attachemnt!!!

Rick


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



Re: [PHP] date

2002-12-03 Thread Rick Widmer



> Hi,
>
> please could someone tell me how i can return a month in text from an int
> ie
>
> getMonth(12)
>


How about:

$Months = array( , 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
   'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );


echo $Months[12];  // Dec

Rick





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




Re: [PHP] formating numbers & date

2002-12-04 Thread Rick Widmer
At 04:58 PM 12/4/02 -0700, Jeff Bluemel wrote:

I'm displaying a date that I get from a informix database query - the date
format is as follows;

2002-12-04 23:21:49

I want it to display as 12/4/2002 11:21:49 PM


$Hour = substr( $Date, 11, 2 );
if( $Hour ) > 12 {
   $Hour = $Hour - 12;
   $AMPM = 'PM';
   }

else {
   $AMPM = 'AM';
   }

echo substr( $Date, 5, 2 ), '/', substr( $Date, 8, 2 ), '/',
 substr( $Date, 0, 4 ), ' ', $Hour, substr( $Date, 13, 6 ), $AMPM;

You may need to adjust the numbers in the substrs...

Rick


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




Re: [PHP] formating numbers & date

2002-12-04 Thread Rick Widmer
At 11:51 AM 12/5/02 +1100, Justin French wrote:

on 05/12/02 11:37 AM, Rick Widmer ([EMAIL PROTECTED]) wrote:

> $Hour = substr( $Date, 11, 2 );
> if( $Hour ) > 12 {
> $Hour = $Hour - 12;
> $AMPM = 'PM';
> }
>
> else {
> $AMPM = 'AM';
> }
>
> echo substr( $Date, 5, 2 ), '/', substr( $Date, 8, 2 ), '/',
> substr( $Date, 0, 4 ), ' ', $Hour, substr( $Date, 13, 6 ), $AMPM;

Isn't this a little simpler?



There's always more than one way to do something I guess :)



Yes, it is simpler to code, but it also takes almost twice as long to run.

1000 iterations with strtotime: 0.2296 seconds
1000 iterations with substr:0.1308 seconds

Doesn't matter much if you only do it once, but it can add up in a loop.

Rick



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




[PHP] PHP-MySQL-HPUX 11

2002-12-04 Thread Rick King
OS: HPUX 11
PHP: 4.2.3
GCC: gcc3.2
MySQL: 3.23.53
Apache: 1.3.27

PHP Compile Options:
CC=gcc
./configure --with-mysql=/usr/local/mysql --with-apxs=/opt/apache-1.3.27/bin
/apxs \
--enable-discard-path

Hello PHP Guru's!

I'm trying to install PHP w/ MySQL support and w/ Apache-DSO support. During
the PHP install, the "configure", "gmake", and "gmake install" goes without
a hitch.
However, when I start Apache I get the following error:

/usr/lib/dld.sl: Unresolved symbol: compress (code)  from
/usr/local/mysql/lib/mysql/libmysqlclient.sl.10
/usr/lib/dld.sl: Unresolved symbol: uncompress (code)  from
/usr/local/mysql/lib/mysql/libmysqlclient.sl.10
/usr/lib/dld.sl: Unresolved symbol: __umoddi3 (code)  from
/usr/local/mysql/lib/mysql/libmysqlclient.sl.10
Syntax error on line 236 of /opt/apache-1.3.27/conf/httpd.conf:
Cannot load /opt/apache-1.3.27/libexec/libphp4.sl into server: Unresolved
external
./apachectl start: httpd could not be started

Does anyone know what this means? I think the MySQL-libs are trying to
source other libs but I'm not sure. Has anyone run into this problem before?

Any solutions/help/words of wisdom are greatly appreciated!

Rick King



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




Re: [PHP] Middle Number

2002-12-06 Thread Rick Widmer
At 09:45 PM 12/6/02 -0500, Stephen wrote:

How can you find the meadian (or middle number) of a list of numbers? If
there is an even amount of numbers, how would I still find it?



load the list into an array, in numeric order...

then:

$List = array( 1,2,3,4,5,6 );

$Middle = ( count( $List ) - 1 ) / 2;

$median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;


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




Re: [PHP] Middle Number

2002-12-07 Thread Rick Widmer
At 07:05 PM 12/7/02 -0500, Stephen wrote:

Wouldn't this only work for an even ammount of numbers? Like 1, 2, 3, 4 has
4 numbers...


Did you try it?  I'd hate to think I've done more work to solve your 
problem than you have...



Even:

 $List = array( 1,2,3,4,5,6 );
 $Middle = ( count( $List ) - 1 ) / 2;
 2.5 =( 6 - 1 ) / 2

 $median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;

   ( $List[ 2 ]+ $List[ 3 ]   ) / 2

  3.5=  3  +4 /2




Odd:

 $List = array( 1,2,3,4,5 );
 $Middle = ( count( $List ) - 1 ) / 2;
 2 =( 5 - 1 ) / 2

 $median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;

   (  $List[ 2 ]+ $List[ 2 ]  ) / 2

  3  = (3  +3 ) / 2


It looks like it works to me.  For details see:

   http://mathforum.org/library/drmath/view/57598.html


>
>
>
>






> At 09:45 PM 12/6/02 -0500, Stephen wrote:
> >How can you find the meadian (or middle number) of a list of numbers? If
> >there is an even amount of numbers, how would I still find it?
>
>
> load the list into an array, in numeric order...
>
> then:
>
> $List = array( 1,2,3,4,5,6 );
>
> $Middle = ( count( $List ) - 1 ) / 2;
>
> $median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;
>


--
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] Finding Mode

2002-12-07 Thread Rick Widmer
At 07:12 PM 12/7/02 -0500, Stephen wrote:

Another math question... How would I find the mode (number that repeats most
often) of an array? Then, if there isn't a number that repeats most often,
tell the user that.



For each entry in the array, count the number of times a value occurs:


while( list( , $Value ) = each( $MyArray )) {
   $NumberHits[ $Value ] ++;
   }

sort $NumberHits keeping the key/value pairs together.  You can find a sort 
function that will do it here:

   http://www.php.net/manual/en/ref.array.php


The first or last entry in the sorted array is the mode.  If all the 
entries have the same number of hits there is no mode.  I'm not sure what 
the mode of  (1, 1, 2, 5, 9, 19, 19) would be, but I'm suspect a good 
definition of mode will tell what to do if more than one value ties for 
having the most hits.

Rick


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



Re: [PHP] String to an Array

2002-12-07 Thread Rick Widmer
At 11:15 AM 12/8/02 +1100, Justin French wrote:

I *think* either:



OR



Works -- you'll have to experiment, but I believe the second way is correct,
and will echo the first (0th) character in the string.


This depends on PHP version.  In the bad old days you had to use 
$str[0].  Sometime since PHP4 came out they added the preferred $str{0} 
option, which is the only one that should be used in new code.  Extracting 
characters from a string with [] is depreciated, and may stop working someday.

Rick


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



Fw: [PHP] Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Rick Emery
Try $_POST['name'] and $_POST['age']
Try $HTTP_POST_VARS['name'] and $HTTP_POST_VARS['age']

- Original Message - 
From: "David Scott" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, December 10, 2002 10:56 AM
Subject: [PHP] Help please: Unable to get $_POST["variable"]; to work in a form.


I am going through the introductory tutorial on http://www.php.net/ and am
stuck on this page:
http://www.php.net/manual/en/tutorial.forms.php

I have been able to get all of the examples up to this point to work.

The form is simple: it asks for a text "name", a text "age" and has a submit
button. The information is submitted to action.php.

Action.php contains this code:
Hi .
You are  years old.

I saved action.php as a text file with only the information above.

When I enter JoeBob into the name field and 27 into the age field, I get
this for output:
Hi
Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1
. You are
Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2
years old.

What can I do to remedy this?



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




Fw: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Rick Emery
What version of PHP are you using?  I believe that anything earlier than 4.05 does not
support $_POST.

Did you try $HTTP_POST_VARS['name']?  This will work, regardless of version.

- Original Message -
From: "David Scott" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, December 10, 2002 12:54 PM
Subject: Re: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a 
form.


I have corrected the typo and had hoped this was a simple solution, yet
$_POST still doesn't work. Any ideas?

"Craig Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Using $_REQUEST[""] works because the vars are in the http request, but
> $_POST[""] contains nothing as the other poster noted:  mehtod="post"
>
> >>-Original Message-
> >>From: David Scott [mailto:[EMAIL PROTECTED]]
> >>Sent: Tuesday, December 10, 2002 1:20 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
> >>work in a form.
> >>
> >>
> >>Using $_REQUEST["variable"] causes the script to work.
> >>Why is this? And, why can I not use $_POST?
> >>
> >>"David Scott" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>> I am going through the introductory tutorial on
> >>http://www.php.net/ and am
> >>> stuck on this page:
> >>> http://www.php.net/manual/en/tutorial.forms.php
> >>>
> >>> I have been able to get all of the examples up to this point to work.
> >>>
> >>> The form is simple: it asks for a text "name", a text "age" and has a
> >>submit
> >>> button. The information is submitted to action.php.
> >>>
> >>> Action.php contains this code:
> >>> Hi .
> >>> You are  years old.
> >>>
> >>> I saved action.php as a text file with only the information above.
> >>>
> >>> When I enter JoeBob into the name field and 27 into the age field, I
get
> >>> this for output:
> >>> Hi
> >>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line
1
> >>> . You are
> >>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line
2
> >>> years old.
> >>>
> >>> What can I do to remedy this?
> >>>
> >>>
> >>
> >>
> >>
> >>--
> >>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: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Rick Emery
First, please respond to the list, not me.

Second, I'm not asking the question, David Scott is.

Third, I don't use " " either; I use ' '
- Original Message - 
From: "Victor" <[EMAIL PROTECTED]>
To: "'Rick Emery'" <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 1:49 PM
Subject: RE: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a 
form.


Why are you using $_POST[""]? I thought you had to use $_POST['']. I
always use '' instead of "" and it always works. Is it just me? Can one
really use double quotes? 

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 10, 2002 2:05 PM
To: 
Subject: Fw: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
work in a form.

What version of PHP are you using?  I believe that anything earlier than
4.05 does not
support $_POST.

Did you try $HTTP_POST_VARS['name']?  This will work, regardless of
version.

- Original Message -
From: "David Scott" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, December 10, 2002 12:54 PM
Subject: Re: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
work in a form.


I have corrected the typo and had hoped this was a simple solution, yet
$_POST still doesn't work. Any ideas?

"Craig Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Using $_REQUEST[""] works because the vars are in the http request,
but
> $_POST[""] contains nothing as the other poster noted:  mehtod="post"
>
> >>-Original Message-
> >>From: David Scott [mailto:[EMAIL PROTECTED]]
> >>Sent: Tuesday, December 10, 2002 1:20 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
> >>work in a form.
> >>
> >>
> >>Using $_REQUEST["variable"] causes the script to work.
> >>Why is this? And, why can I not use $_POST?
> >>
> >>"David Scott" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>> I am going through the introductory tutorial on
> >>http://www.php.net/ and am
> >>> stuck on this page:
> >>> http://www.php.net/manual/en/tutorial.forms.php
> >>>
> >>> I have been able to get all of the examples up to this point to
work.
> >>>
> >>> The form is simple: it asks for a text "name", a text "age" and
has a
> >>submit
> >>> button. The information is submitted to action.php.
> >>>
> >>> Action.php contains this code:
> >>> Hi .
> >>> You are  years old.
> >>>
> >>> I saved action.php as a text file with only the information above.
> >>>
> >>> When I enter JoeBob into the name field and 27 into the age field,
I
get
> >>> this for output:
> >>> Hi
> >>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on
line
1
> >>> . You are
> >>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on
line
2
> >>> years old.
> >>>
> >>> What can I do to remedy this?
> >>>
> >>>
> >>
> >>
> >>
> >>--
> >>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

__ 
Post your free ad now! http://personals.yahoo.ca



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




Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values

2002-12-10 Thread Rick Emery
Hey Aggie,

Show us the rst of the code.  stristr() should not be a problem.  Chances are there's a
blank line elsewhere that's being sent.

- Original Message -
From: "KANM MD" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 2:34 PM
Subject: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return 
Values


Here's my question:

I'm running code that essentially checks for either a certain IP address or a password
before it sends a cookie. However, when I try to send the cookie, I get the standard
"Error - headers already sent" when I haven't output anything. After some spot 
debugging,
I found that

if ( stristr($HTTP_SERVER_VARS["remote_address"],"XXX.YYY.ZZZ") ) { ...

essentially counts as a sent header. I imagine this has to do with the fact that 
stristr
returns a TRUE or FALSE value, but not being an expert in programming concepts, I 
wouldn't
know.

Anywho, if anyone knows a workaround for this or could explain the problem that lies
within, it would be greatly appreciated.

Thanks,

Kyle Hale
Computer Guy
KANM Student Radio
Texas A&M University




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




Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return Values

2002-12-11 Thread Rick Emery
If you want our help, we need to see all the code, not just the code that YOU think is
relevant.
What you've shown us is useless for diagnosing your problem.
Show the EXACT code, not a "simple" "secure", "readable" version.  Just remove 
passwords.
- Original Message -
From: "KANM MD" <[EMAIL PROTECTED]>
To: "Rick Emery" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 2:54 AM
Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions That Return
Values


Here is the code in a readable form (alterations for security, simplicity
...)

if
((stristr($HTTP_SERVER_VARS["remote_address"],"XXX.YYY.ZZZ"))||($pwprotect==
'password')) {
 setcookie("pwprotect2","1",time()+300);
}
else {
 echo "(ASK FOR PASSWORD)";
}

Now when you say "blank line" does that mean actual empty lines between the

To: "KANM MD" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 10:39 PM
Subject: Re: [PHP] Question Regarding Cookies, Sent Headers, and Functions
That Return Values


> Hey Aggie,
>
> Show us the rst of the code.  stristr() should not be a problem.  Chances
are there's a
> blank line elsewhere that's being sent.
>
> - Original Message -
> From: "KANM MD" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 10, 2002 2:34 PM
> Subject: [PHP] Question Regarding Cookies, Sent Headers, and Functions
That Return Values
>
>
> Here's my question:
>
> I'm running code that essentially checks for either a certain IP address
or a password
> before it sends a cookie. However, when I try to send the cookie, I get
the standard
> "Error - headers already sent" when I haven't output anything. After some
spot debugging,
> I found that
>
> if ( stristr($HTTP_SERVER_VARS["remote_address"],"XXX.YYY.ZZZ") ) { ...
>
> essentially counts as a sent header. I imagine this has to do with the
fact that stristr
> returns a TRUE or FALSE value, but not being an expert in programming
concepts, I wouldn't
> know.
>
> Anywho, if anyone knows a workaround for this or could explain the problem
that lies
> within, it would be greatly appreciated.
>
> Thanks,
>
> Kyle Hale
> Computer Guy
> KANM Student Radio
> Texas A&M University
>
>
>




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




Fw: [PHP] Add column to table

2002-12-11 Thread Rick Emery
First, you've asked the wron list; ask the mysql list

Second:  ALTER mytable ADD COLUMN new column INT UNSIGNED AFTER old_column;

- Original Message - 
From: "Shaun" <[EMAIL PROTECTED]>
To: <>
Sent: Wednesday, December 11, 2002 8:25 AM
Subject: [PHP] Add column to table


Hi,

please could someone tell me what the sql command is to add a colummn to a
table?

Thanks for your help



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




Fw: [PHP] upload image

2002-12-11 Thread Rick Emery
If it is a GIF file, the header format is:
Byte #
0 - 2   GIF
3 - 5   87a or 89a
6 - 7   Width (in pixels)
8 - 9   Height (in pixels)

Be advised, the dimensions are in reverse major order; that is, 50 pixels is 
represented
as "32 00"

- Original Message -
From: "Shaun" <[EMAIL PROTECTED]>
To: <>
Sent: Wednesday, December 11, 2002 8:23 AM
Subject: [PHP] upload image


Hi,

i am using a form to upload an image to the server, is it possible to get
the image size during this process so i can store it for later use (i.e.
determining the size of the popup window to view the image)?

thanks for your help




--
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] Free MySQL Hosting...again

2002-12-12 Thread Rick Emery
The page would not display for me.  It did, however send the following HTML.  Please 
note
that the "?PHPSESSID" is not enclosed in  delimiters.  Also, PHPSESSID needs to be
$PHPSESSID.  Could that be the problem?  Finally, dump the FRAMES.

Free MySQL Hosting








Free MySQL Hosting - NukedWeb is offering free MySQL hosting. - free,mysql,hosting



."
- Original Message -
From: Adam Voigt
To: PHP Mailing List
Cc: [EMAIL PROTECTED]
Sent: Thursday, December 12, 2002 7:59 AM
Subject: Re: [PHP] Free MySQL Hosting...again


I'm getting Connection Refused on that website, sure your not still having problems?

On Wed, 2002-12-11 at 15:33, PHP Mailing List wrote:
I had a little trouble with my cable modem before, but the Free MySQL
Hosting is back up if any of you are interested. =)

http://mysql.nukedweb.com/


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

--
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


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




Re: [PHP] Date Formatting

2002-12-13 Thread Rick Emery
MYSQL will do all the formatting that you need.  Look up sect 6.3.4, "Date and Time
Functions" in mysql manual.  Look at the DATE_FORMAT(date,format) command

- Original Message -
From: "Clint Tredway" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 13, 2002 11:55 AM
Subject: [PHP] Date Formatting


How can I format a date coming out of a MySQL? I know how to format today's date but 
not a
date coming out of MySQL. I have looked through the manual, but I must be blind 
because I
cannot figure it out.

Thanks,
Clint


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




Re: [PHP] key pairs

2002-12-17 Thread Rick Widmer
At 04:44 PM 12/17/02 -0500, 1LT John W. Holmes wrote:

What I was thinking is that you have one table with

Order_ID
Name
Address
Flag -> Here you flag this as SHIP_TO or BILL_TO
etc...


That layout would be better than:

Order_ID
Ship_name
Ship_address
Bill_name
Bill_address
etc...

Which is what I got from you last email.

Does anyone agree?


Not only do I agree, so do the people who came up with the rules of proper 
database normilization.  Here are a few of the top results on a Google 
search for database normalization.


   http://www.phpbuilder.com/columns/barry2731.php3?page=1

Watch how he handles URLs.


   http://www.devshed.com/Server_Side/MySQL/Normal

   http://www.sqlmag.com/Articles/Index.cfm?ArticleID=4887&pg=1


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



Re: [PHP] Regex Help

2002-12-19 Thread Rick Emery
addslashes()

- Original Message - 
From: "Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 11:26 AM
Subject: [PHP] Regex Help


Could someone show me how to use preg_replace to change this:

test test test

into:

anotherword test anotherword

basically, I want to change a value only if it is not in an option
tag.

I also want to account for situations like :

test, something test test!

My thoughts were to do the replace if the word (test) was not
surrounded by quotes or surrounded by greater/less than symbols. I
just have no idea how to formulate that with regex.

Please help! Thanks.

-- 
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] Regex Help

2002-12-19 Thread Rick Emery
test test";
ereg("(.*)()(.*)",$q,$ar);
$t = "anotherword".$ar[2]."anotherword";
print $t;
?>

outputs:
anotherwordtestanotherword

- Original Message - 
From: "Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 11:55 AM
Subject: Re: [PHP] Regex Help


I'm sorry, I accidentally left the slashes on my second example. My original
message should read:

Could someone show me how to use preg_replace to change this:

test test test

into:

anotherword test anotherword

Note that what I want to accomplish is to change 'test' into 'anotherword'
only if it is not within the option tag.

Thanks!


- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Jim" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 12:42 PM
Subject: Re: [PHP] Regex Help


> addslashes()
>
> - Original Message -
> From: "Jim" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 19, 2002 11:26 AM
> Subject: [PHP] Regex Help
>
>
> Could someone show me how to use preg_replace to change this:
>
> test test test
>
> into:
>
> anotherword test anotherword
>
> basically, I want to change a value only if it is not in an option
> tag.
>
> I also want to account for situations like :
>
> test, something test test!
>
> My thoughts were to do the replace if the word (test) was not
> surrounded by quotes or surrounded by greater/less than symbols. I
> just have no idea how to formulate that with regex.
>
> Please help! Thanks.
>
> --
> 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] date part

2002-12-19 Thread Rick Emery
Following on to the L T:
$ar = explode("/",$thestring);

thenL
$ar[0] = 06
$ar[1] = 07
$ar[2] = 200

- Original Message - 
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Diana Castillo'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 11:56 AM
Subject: RE: [PHP] date part


> How can I get a string containing the month part of a date the user
types
> in?
> e.g. if they type in "06/07/200" I want to get "06"

If you know that's the format they're going to use, the you can just use
substr() to grab the first two characters.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.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




Fw: [PHP] case statement?

2002-12-19 Thread Rick Emery
switch()
{
  case a:
  case b:
  case c:
  default:
}

RTFM
- Original Message - 
From: "Max Clark" <[EMAIL PROTECTED]>
To: <>
Sent: Thursday, December 19, 2002 12:19 PM
Subject: [PHP] case statement?


Hi-

I was wondering if php had a case function?

Instead of building a large if/elseif/else block I would like to do a case
$page in (list).

Thanks in advance,
Max





-- 
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] Regex Help

2002-12-19 Thread Rick Emery
gawd, Jim, you are s oicky 

test test";
ereg("(.*)()(.*)",$q,$ar);
$w1 = ereg_replace("test","anotherword",$ar[1]);
$w2 = ereg_replace("test","anotherword",$ar[3]);
$t = $w1.$ar[2].$w2;
print $t;

?>

outputs:
anotherword, something test anotherword

- Original Message - 
From: "Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 12:25 PM
Subject: Re: [PHP] Regex Help


Whoops, sorry post aborted prematurely.

What I was going say say was that:

test, something test test!

should become:

anotherword, something test anotherword!

Thanks again for helping!


- Original Message - 
From: "Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 1:24 PM
Subject: Re: [PHP] Regex Help


> Thanks for helping. Unfortunately, that doesn't quite accomplish the task
> either. The other example for my first post would be mangled with that.
> 
> - Original Message -
> From: "Rick Emery" <[EMAIL PROTECTED]>
> To: "Jim" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, December 19, 2002 1:09 PM
> Subject: Re: [PHP] Regex Help
> 
> 
> >  > $q = "test test test";
> > ereg("(.*)()(.*)",$q,$ar);
> > $t = "anotherword".$ar[2]."anotherword";
> > print $t;
> > ?>
> >
> > outputs:
> > anotherwordtestanotherword
> >
> 

-- 
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] Question about the exit() command

2002-12-19 Thread Rick Emery
What do you mean "return to the calling page"?
The exit() command simply ceases processing of PHP and HTML.

I believe what you're saying is that if the user clicks on a PHP hyperlink on the first
page, then goes to another page.  If there is something "wrong" there, you nwant to 
return
to the page from which you hyper-linked.  If that is the scenario, the valriable
$HTTP_REFERER refers to the calling page.  So:

if( condition)
  header("location: $HTTP_REFERER");

- Original Message -
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 3:45 PM
Subject: [PHP] Question about the exit() command


Hi,

Could someone clarify this for me. I want to be able to exit out of a PHP
webpage and return to the calling page if certain conditions are not met. It
appears using exit() will do this, but I am unclear exactly how to use it.

any info is appreciated.

TIA




--
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] Another problem with conditional statements

2002-12-19 Thread Rick Emery
switch() does not work that way.  Switch uses the value in the parentheses and selects 
a
CASE based upon that value.  Read the manual.

You will have to use a series of if()-elseif()-else()
- Original Message -
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 6:19 PM
Subject: [PHP] Another problem with conditional statements


Hi,

This should be as simple as breathing, but not today. I have two variables
$a and $b which I need to compare in a switch statement in several different
ways, but no matter what I do it's wrong.

This is what I have tried, can someone tell me how it should be.

TIA

switch (true):

case ($a == $b): This one seems simple enough.
do sum stuff;
break;

case ($a && $b == 124):   This appears not to work.
do sum stuff;
break;

case ($a == 124 && $b == 755):  If $a is equal to 124 and $b is equal to
755 then it should be true..doesn't work.
do sum stuff;
break;

case ($a == 124 && $b != 124):   Nope, this doesn't appear to work
either.
do sum stuff;
break;

endswitch;



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

2002-12-20 Thread Rick Emery
Do you mean loggged-in in the current browser session?  If that, then cookies are good.
If you mean EVER ogged in, then you'll want to look at a database, perhaps, mySQL.
- Original Message - 
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 8:20 AM
Subject: [PHP] login


Ok,
Newbie Question.
I know have a login and registration page on my website.  What is the best
way to check to see if the users have logged in before they access the other
pages?  SHould I add to each of the other url's ?clientid='' and if it is an
empty string I know they haven't logged in?

Thanks,
Eddie


-- 
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: mail()

2002-12-20 Thread Rick Emery
Actually, you don't need to send this as an html  hyperlink.  Simply using:
http:\\www.aircharterunited.com\pages\activate_account.php?clientid=$uname

Should work; it does for me.

- Original Message - 
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 8:18 AM
Subject: RE: [PHP] Re: mail()


I changed this and it works fine but I now lose my formating.  It doesn't
seem to recognize the \n breaks.  Am I asking for to much?

-Original Message-
From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 8:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: mail()


You need to set the correct header type:

Content-type: text/html

otherwise it defaults to:

Content-type: text/plain

Mike


"Edward Peloke" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> I am using the following code but when I view the sent e-mail (in my yahoo
> account) the link info is all plain text.  I see the  How do I create it as a link?  I know I can send them because I have done
it
> before in my yahoo e-mail, just never through php and mail().
>
> Thanks,
> Eddie
>
> $mailcontent="Thank you for registering with AirCharterUnited \n"
>  ."Your Username is $uname and your password is $pword
> \n"
>  ."Please click the following link to activate your
> account \n"
>."
href='http:\\www.aircharterunited.com\pages\activate_account.php?clientid=$u
> name'>Activate Account";
>mail($email,'Thanks',$mailcontent,"From:
> aircharterunited.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




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




Re: [PHP] Re: mail()

2002-12-20 Thread Rick Emery
that should be:
http://www.aircharterunited.com\pages\activate_account.php?clientid=$uname

(Grrr...that's what I get for using copy/paste from original email)

- Original Message - 
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Edward Peloke" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 8:04 AM
Subject: Re: [PHP] Re: mail()


Actually, you don't need to send this as an html  hyperlink.  Simply using:
http:\\www.aircharterunited.com\pages\activate_account.php?clientid=$uname

Should work; it does for me.

- Original Message - 
From: "Edward Peloke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 8:18 AM
Subject: RE: [PHP] Re: mail()


I changed this and it works fine but I now lose my formating.  It doesn't
seem to recognize the \n breaks.  Am I asking for to much?

-Original Message-
From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 8:51 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: mail()


You need to set the correct header type:

Content-type: text/html

otherwise it defaults to:

Content-type: text/plain

Mike


"Edward Peloke" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> I am using the following code but when I view the sent e-mail (in my yahoo
> account) the link info is all plain text.  I see the  How do I create it as a link?  I know I can send them because I have done
it
> before in my yahoo e-mail, just never through php and mail().
>
> Thanks,
> Eddie
>
> $mailcontent="Thank you for registering with AirCharterUnited \n"
>  ."Your Username is $uname and your password is $pword
> \n"
>  ."Please click the following link to activate your
> account \n"
>."
href='http:\\www.aircharterunited.com\pages\activate_account.php?clientid=$u
> name'>Activate Account";
>mail($email,'Thanks',$mailcontent,"From:
> aircharterunited.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




-- 
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] Problem with functions

2002-12-20 Thread Rick Emery
Please show a bit more of the actual code

- Original Message - 
From: "Beauford.2002" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 9:55 AM
Subject: [PHP] Problem with functions


Hi,

I keep getting errors in my script that says 'x' function is undefined or
'y' function is undefined. I defined it as 'function test ($a, $b)' and call
it using 'test($a, $b)' From my knowledge this is correct, but it just
simply doesn't work.

Anyone have any ideas on this?

TIA



-- 
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] Email problems.

2002-12-22 Thread Rick Emery
This is not realy a PHP question; rather, it is an OutLook question.
Regardless...when you opened the OutLook window to create your mail, did you go to the
Menu->Format and select "Rich Text (HTML)""
- Original Message -
From: "Steve Jackson" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Sunday, December 22, 2002 7:29 AM
Subject: [PHP] Email problems.


> I have generated a page on our server using PHP (from within a CMS system)
> which I renamed the output .html to use in an html email.
> My problem is when I cut and paste the HTML into the email (Outlook) it
> either:
> displays the code,
> displays the html email and then when it's sent, sends it as an attachment
> or sends it as a bunch of html links and  badly formatted text.
>
> I assumed (badly) that Outlook would simply send HTML emails if you
> formatted the program to send html emails but this seems almost impossible.
>
> Anyone have any suggestions?
>
> This is the page I want to send:
> http://www.violasystems.com/e-news/template.html
>
>
>
> --
> 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] Is __FILE__ still current or is there something newer?

2002-12-23 Thread Rick Widmer
At 03:05 PM 12/22/02 +, z z wrote:


__FILE__ is useful to know the current script's path


__FILE__ is a 'constant' defined by the Zend Engine that tells you the name 
of the current file.  If you are in an Include the name of the included 
file is returned, if you are in the main file its name is returned.  This 
is commonly used in creating error messages.

> What is the cleanest and self-contained way to do a
> relative include from an included file which might
> not be in the same directory as its parent?

Put the files in a directory named in the include_path such that you don't 
have to mess with any kind of path information within the programs.  That's 
what it is there for.

If you have to move the include files which would you rather do:

  a) change the include_path in php.ini, httpd.conf, or .htaccess.

  b) edit every file in the project to change the path.


I have a group of common include files most of my sites use, and another 
group of files for each domain.  The include path for each web sites is set 
in the webserver configuration, and looks like this:


...
php_value include_path /web/lib:/web/hosts/www.somedomain.com/lib:.



You can group files into directories under the include_path to keep related 
include files together.

  include( 'category/program.inc' );

will search every directory in the include path for a subdirectory named 
'category' containing a file 'program.inc' to include.  Very handy!


Rick


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



Re: [PHP] Plotting Data Graphics

2002-12-23 Thread Rick Widmer
At 03:06 AM 12/23/02 -0200, Alexandre Soares wrote:

Hi All,

Where I can get more information about a free library to plot 2d and
3d data information,


   http://www.aditus.nu/jpgraph/

Rick


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




Re: [PHP] how to specify dimensions of opened window?

2002-12-23 Thread Rick Emery
Can't do this with PHP, which is server-side.  You can, however, use PHP to generate
JavaScript that will set the window parameters when executed.

- Original Message -
From: "Jody Cleveland" <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, December 23, 2002 8:19 AM
Subject: [PHP] how to specify dimensions of opened window?


> Hello,
>
> I'm wondering, without the use of javascript, how to specify browser
> parameters for pop up windows. Such as window size and whether there's a
> toolbar. This would be for a popup when users would click on a link.
>
> Is this possible?
>
> -Jody Cleveland
>
> Winnefox Library System
> Computer Support Specialist
> [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




Re: [PHP] how to specify dimensions of opened window?

2002-12-23 Thread Rick Emery
Use PHP print/echo statements to create the JavaScript code, just as you would HTML 
code.

- Original Message -
From: "Jody Cleveland" <[EMAIL PROTECTED]>
To: "'Rick Emery'" <[EMAIL PROTECTED]>; "Php-General (E-mail)"
<[EMAIL PROTECTED]>
Sent: Monday, December 23, 2002 8:41 AM
Subject: RE: [PHP] how to specify dimensions of opened window?


> > You can, however, use PHP to generate
> > JavaScript that will set the window parameters when executed.
>
> How would I do that?
>
> Jody
>


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




Re: [PHP] how to specify dimensions of opened window?

2002-12-23 Thread Rick Emery
Do you know JavaScript?  If not, start there.

print "open(\"url\",\"window_name\",\"width=400,height=300menubar=no,status=no\")";
- Original Message -
From: "Jody Cleveland" <[EMAIL PROTECTED]>
To: "'Rick Emery'" <[EMAIL PROTECTED]>; "Php-General (E-mail)"
<[EMAIL PROTECTED]>
Sent: Monday, December 23, 2002 9:02 AM
Subject: RE: [PHP] how to specify dimensions of opened window?


> > Use PHP print/echo statements to create the JavaScript code,
> > just as you would HTML code.
>
> Um... How would you go about doing that?
>
> --
> 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] MySQL vs PostgreSQL

2002-12-23 Thread Rick Emery
You accidentally published this to the wrong email list.  I assume you meant to send 
this
to the MySQL email list.

- Original Message -
From: "Miro Kralovic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 23, 2002 9:10 AM
Subject: [PHP] MySQL vs PostgreSQL


> Hi,
>
> I'm just deciding which DB to use for my projects and I'm not clear with one
> thing... When considering a database for web, is MySQL good enough? I read
> it only supports table locking, which is not very satisfying in such a
> multiuser environment as the internet..
>
> Based on your experience, what are pros and cons of MySQL and why most of
> you prefer to use MySQL to PostgreSQL, which is aparently more powerful..
>
> Thanks for your opinions..
> Miro..
>
>
>
> --
> 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] Forms

2002-12-23 Thread Rick Emery
For my Linux (RedHat 7.1), it's at /etc/php.ini

- Original Message -
From: "Vicente Valero" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 23, 2002 10:25 AM
Subject: [PHP] Forms


I'm having problems using variables from a html form. I've been reading, and it seems 
that
I have register_globlas=off in php.ini. But I've tried to find this file in my Linux, 
but
I haven't been able to locate it. Could someone tell me where is it?

Thank you


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




Re: [PHP] calendar solution for workgroups ???

2002-12-23 Thread Rick Emery
Another good PHP/mySQL calendar application.  Group scheduling, etc.  Does not have
extraneous things such as web-mail.  Cost is $35

http://abledesign.com/demo/calendar/

rick
"People will forget what you said. People will forget what you did.
But people will never forget how you made them feel."
- Original Message -
> On Monday, December 23, 2002, at 06:09 AM, Tariq Murtaza wrote:
>
> > Hi all,
> > I am looking for a good calendar system for a group of people. (PHP
> > /Mysql)
> > any idea??
> >
> > Help/Comments will be appreciated.
> >
> > Tariq Murtaza
> >
> >
> >
> > -- PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>
>
> --
> 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] Are there macros in PHP?

2002-12-23 Thread Rick Emery
What happened when you experimented with this code?  You did try, right?

- Original Message - 
From: "Don" <[EMAIL PROTECTED]>
To: "php list" <[EMAIL PROTECTED]>
Sent: Monday, December 23, 2002 11:57 AM
Subject: [PHP] Are there macros in PHP?


> Hi,
> 
> I need to search a MySQL table based on a condition that can change at
> runtime.
> 
> Example
> ==
> $condition = CustCode = "$HTTP_SESSION_VARS['logoncustcode']";
> 
> $queryID = mysql_query("SELECT * FROM CustTariff WHERE " . $condition . "
> ORDER BY CustCode");
> 
> Will the above work?
> 
> Thanks,
> Don
> 
> 
> 
> -- 
> 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] Problem with Include

2002-12-24 Thread Rick Widmer
At 08:04 AM 12/24/02 +0300, sport4ever wrote:


maybe there is something wrong with php.ini
notice that I faced with this problem just after I upgraded to (PHP 4.2.1),
(Apache2), everything was great before!


The last I heard PHP + Apache2 is pretty much experimental, and not 
recommended for production servers.  Unless you plan on working to debug 
the combination of programs, you should be using Apache 1.3 if you want to 
use PHP.

There are a few combinations of versions that work together, but unless you 
are willing to put a lot of extra effort and study into using Apache 2, 
stick with 1.3 until the PHP developers announce Apache 2 support.

Rick


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



Re: [PHP] Populating textboxes and listboxes from a query result of a database table

2002-12-26 Thread Rick Emery
Text box:
print "\n";

List box:
print "\n";
while($row = mysql_fetch_array($result))
{
  extract($row);
  print "$data_title\n";
}
print "\n";
- Original Message - 
From: "Denis L. Menezes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 26, 2002 6:13 AM
Subject: [PHP] Populating textboxes and listboxes from a query result of a database 
table


Hello friends,

Can someone please tell me where I can find sample scripts for populating
textboxes and listboxes on a form(when the form opens) using the data from
fields in a table?

Thanks
Denis




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




Re: [PHP] Beginner examples?

2002-12-26 Thread Rick Widmer
At 09:02 PM 12/23/02 -0800, Chris Rehm wrote:

John W. Holmes wrote:

http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=php+
mysql+tutorial
---John W. Holmes...


The Internet is a wealth of resources, but some of them aren't as good as 
others. If people here have had great success from some sites, I'd like to 
be able to pass on those recommendations.

Both of the tutorials that got me going with PHP & MySQL appear on the 
first page of the Google search John sent you.  Those are Devshed and 
Webmonkey, but that was long ago, there may be better choices now.  One 
thing to look for is a discussion of the "Register Globals" change and how 
it affects PHP programming.  Older tutorials may have a problem with how 
they access form varibles.


> Did I make a valid suggestion?

Yes.  PHP + MySQL are a very good way to solve the problem you 
posed.  Certainly my first choice.  I wouldn't send an email on every entry 
though.  It is a waste.  The entries are stored in the database, and you 
can look through them any time you want.  Just build a password protected 
web page.

Picking a winner might be as easy as:

   SELECT *
   FROM Entries
   ORDER BY RAND()
   LIMIT 1

This picks one record from the Entries table at random.  You may want to 
send your self an email with the results, as this is truly random.

May as well let the computers do the work...

Rick


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



Re: [PHP] Cheap Hosting

2002-12-26 Thread Rick Emery
www.nomonthlyfees.com
$200 first year, $70 per year thereafter.

I put all my clients with this service.

rick
"People will forget what you said. People will forget what you did.
But people will never forget how you made them feel."
- Original Message -
From: Stephen
To: PHP List
Sent: Thursday, December 26, 2002 6:55 PM
Subject: [PHP] Cheap Hosting


Hello,

I need a nice, reliable host for my new website. It needs to be fast, reliable, needs a
good uptime, and some features. PHP and MySQL are the two I really need. Does anyone
recomend one that's really cheap? So far I've found on, $5 a month, but it's slower 
then
what'd I like. If nothing else pops up, I'll go with it. I'd also like domain parking
and/or domain registration (don't really need the registration though). Thanks in 
advance!

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

"What is a dreamer that cannot persevere?" -- http://www.melchior.us



--
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] Photos and logos in MySQL + PHP

2002-12-26 Thread Rick Widmer
At 09:40 AM 12/27/02 +0800, Denis L. Menezes wrote:

Hello friends,

I am making a website for our school. My requirement is that when any 
student searched for a particular club, the logo of the club abd the 
chairperson's phot should automatically be shown dynamically on the top of 
the page. For this to be done, I have three questions, if any of you could 
please help me :

1. Can I place these photos and logos in the MySQL database, If so, what 
field type?

You can, but you don't want to.  Just put the images in a directory and 
maybe the names in the database.  In this case, I'd probably name the 
images based on the auto_increment field in the table they are related to.



2. How can I make the admin page upload the photos and logos to the database?



   http://www.php.net/manual/en/features.file-upload.php




3. How do I display these photos dynamically on the output webpage?


First build the names in variables...

$LogoName = "/images/logos/$ClubID.png";
$PhotoName = "/images/photos/$ClubID.png";

then later when you are painting the page.




Don't forget to include Width, Height and Alt tags in the  tags.

Rick


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




Re: [PHP] CLI delay

2002-12-27 Thread Rick Widmer
At 03:55 AM 12/27/02 -0500, Maciek Ruckgaber Bielecki wrote:


has anyone an idea of how can i do some kind of decent delay (instead of
some shell_exec doing pings)  :-P



Have you tried sleep()?

   http://www.php.net/manual/en/function.sleep.php

Rick


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




Re: [PHP] PHP 4.3.0 released

2002-12-28 Thread Rick Widmer
At 08:40 PM 12/27/02 -0700, The Doctor wrote:



Is it just my or are there problems with static Aapche 1.3.27 compiles?


I don't know if it is _just_ you, but my static install compiled and is 
running just fine.

SuSE 8.0

php 4.3.0

Apache 1.3.27

Mod_SSL 2.8.12-1.3.27

OpenSSL 0.9.6h

ming 0.2a

pdflib 4.0.3

./configure --with-apache=../apache --with-mysql --with-pgsql=/usr 
--enable-cli --enable-calendar --enable-debug=no 
--with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local 
--with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr 
--enable-gd-native-ttf --with-freetype=/usr/include/freetype2 
--with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm 
--with-pspell




Script started on Fri Dec 27 20:34:45 2002
nl2k.ca//usr/source/php-4.3.0$ cat configphp

configure --prefix=/usr/contrib --localstatedir=/var 
--infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory 
--with-elf --with-x   --with-mysql --with-zlib --enable-track-vars 
--enable-debug  --enable-versioning --with-config-file-path=/usr/local/lib 
--with-iconv=/usr --with-openssl=/usr/contrib  --enable-ftp --with-gd=/usr 
--enable-imap --with-bz2 
--with-apache=/usr/source/apache_1.3.27_nonSSL/ 
--with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf 
--with-jpeg-dir=/usr --with-png-dir=/usr 
--with-freetype-dir=/usr  --with-xpm-dir=/usr/X11/lib


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




[PHP] Re: [PHP-DEV] Re: [PHP] PHP 4.3.0 released

2002-12-28 Thread Rick Widmer
At 11:29 AM 12/28/02 -0700, The Doctor wrote:

On Sat, Dec 28, 2002 at 04:04:14AM -0700, Rick Widmer wrote:
> At 08:40 PM 12/27/02 -0700, The Doctor wrote:
> ./configure --with-apache=../apache --with-mysql --with-pgsql=/usr
> --enable-cli --enable-calendar --enable-debug=no
> --with-config-file=/web/conf --with-PEAR --with-jpeg-dir=/usr/local
> --with-phg-dir=/usr/local --with-zlib-dir=/usr/local --with-gd=/usr
> --enable-gd-native-ttf --with-freetype=/usr/include/freetype2
> --with-pdflib=/usr/local --with-ming --enable-magic-quotes --with-mm=../mm
> --with-pspell


vs.



> >configure --prefix=/usr/contrib --localstatedir=/var
> >--infodir=/usr/share/info --mandir=/usr/share/man --with-low-memory
> >--with-elf --with-x   --with-mysql --with-zlib --enable-track-vars
> >--enable-debug  --enable-versioning 
--with-config-file-path=/usr/local/lib
> >--with-iconv=/usr --with-openssl=/usr/contrib  --enable-ftp 
--with-gd=/usr
> >--enable-imap --with-bz2
> >--with-apache=/usr/source/apache_1.3.27_nonSSL/
> >--with-pgsql=/usr/contrib/pgsql --enable-gd-native-ttf
> >--with-jpeg-dir=/usr --with-png-dir=/usr
> >--with-freetype-dir=/usr  --with-xpm-dir=/usr/X11/lib


What I have that you do not:
   cli - create command line interface executable program.
   calendar - fancy tricks with dates.
   pear - a library of handy functions
   gd-native-ttf
   pdflib - create pdf files
   ming - create swf files
   magic-quotes - eliminates a lot of addslashes()
   mm - I'm not sure
   pspell - spelling checker

I don't think anything I added would make any difference.

Things that look wrong to me:

--with-low-memory, --with-elf and --with-x are not listed as valid options 
in ./configure --help, and look scary to me.  Get rid of them.


You used enable-zlib, but the correct statement is with-zlib or with-zlib-dir.


--enable-track-vars - is enabled by default and ignored for a couple of php 
versions now.

--enable-versioning - is only needed when you want to run more than one PHP 
module version at the same time.



The next thing to try...

xpm-dir, bz2, imap, iconv  are the modules you are using that I am 
not.  Try compiling without them and see what happens.



I don't see where any of these _should_ affect things, but I've gotten in 
trouble before using options I did not need...

--prefix - --with-apache specifies where the resulting files are placed, so 
prefix is not relevant to static install.

localstatedir, infodir, mandir - not relevant to a static install because a 
php module does not use any of the directories specified by these.



Rick


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



Re: [PHP] Warning: 1 is not a valid File-Handle resource - HELP!

2002-12-29 Thread Rick Emery
The last line cannot be producing the warning; it does not refer to a file.
Please show us the EXACT error message.

Are you certain the file was opened?  Did you try to print $stuff after reading it?  
Did it have the
info you thought it should?

- Original Message -
From: "Phil Powell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, December 29, 2002 3:08 AM
Subject: [PHP] Warning: 1 is not a valid File-Handle resource - HELP!


Ok, I am a bad coder. :(  I can't figure this out at all:

   $fileID = fopen("nicknames.txt", 'r');
$stuff = fread($fileID, filesize("nicknames.txt")); fclose($fileID);
if (strlen($stuff) > 0) $priorNickNewLine = "\n";
$nicks = explode("\n", $stuff);

The last line produces the Warning.. why?  I am trying to read contents from 
nicknames.txt and split
according to the newline character so that each nickname is an array element.

What did I do wrong? :(

Phil



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




Re: [PHP] Auto_incerement value

2002-12-30 Thread Rick Widmer
At 06:41 AM 12/30/02 -0300, Cesar Aracena wrote:

Hi all,

This is a fast question. Does anyone remembers how to obtain the ID auto
assigned after an INSERT statement under MySQL?


   http://www.php.net/manual/en/function.mysql-insert-id.php


Rick


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




Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Rick Widmer
At 06:20 PM 12/30/02 +0800, Jason Wong wrote:

On Monday 30 December 2002 18:13, Boget, Chris wrote:
> I'm switching from a MySQL environment to PGSQL and I'm
> going through and trying to learn the differences between the
> two.




The things that bothered me the most:

o Pg doesn't have DATE_FORMAT(), or the types SET and ENUM.

o Changing database structure is harder.  With PG, I usually found it
  easier to dump, edit, then reload the database to make changes I did
  in MySQL with ALTER TABLE.

o The command line program's exit command starts with a \.  It took me
  a long time to find that...



The command line interface for pg is much better.
o  Large result sets are returned in less, and the command editor feels better.

o There are lots of cool things you can look at with the \ commands in
  the command line program.try \help

o You can see the source code of the queries that make up the \ commands.
  I don't remember exactly how, but it is either in \help or the man page.



> * MySQL has a function to reset the result set so that it can be
> iterated through again - mysql_data_seek().


pg_fetch_array() has a third parameter that specifies which record to return.



In most cases you wouldn't
need to use that because if you're going to be using the results more than
once you could store them in an array.


I disagree...  You have easy access to the entire result set, in any order,
with either database.  You are wasting time and memory making another copy
of the data.


Rick


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




RE: [PHP] PHP & PostgreSQL

2002-12-30 Thread Rick Widmer
At 04:41 AM 12/30/02 -0600, Boget, Chris wrote:

You can do this in mysql.  I just don't know
why you can't do this in pgsql.


The basic answer to why the interfaces to the databases differ is because
the PHP interfaces reflects the C interface provided by the database
authors.  Most PHP extensions are just wrappers that allow you to call
existing libraries.

Rick


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




Re: [PHP] PHP & PostgreSQL

2002-12-30 Thread Rick Widmer
At 07:59 AM 12/30/02 -0600, Michael Sims wrote:

On Mon, 30 Dec 2002 04:11:02 -0700, you wrote:

>, or the types SET and ENUM.

I'm not sure what SET is, never used it,


Color set( 'red', 'green', 'blue' ) can contain only the following
values:

NULL;'blue';   'green';  'green,blue';
'red';   'red,blue';   'red,green';  'red,green,blue';

You can enter the color names in any order, but they always come
out like this.  Only words contained in the set are allowed.  You
can also look at a set as a number, and do bit manipulation on it.
The list of values above are 0 to 7 when used in a numeric context.



but ENUM is totally unnecessary in Postgres because it supports
foreign keys.


The big difference using set and enum is in data storage.  If you look
on the disk you will find both types are stored in the smallest integer
they fit in.  Even 'red,green,blue' fits in a single byte each time it
is stored.



  This is more standard anyway, and if you need to update
the set there is no need to touch the database schema.



I like being able to define some things in the schema.  I have widgets
in my toolkit that build arrays of checkboxes, radio buttons or drop
down lists based on the values allowed in an enum or set.  They get used
quite a bit, in fact losing these widgets may be the biggest thing
keeping me using MySQL.  (Harder prototyping is a close second.)

Rick.

P.S.  Thanks for the info on handling dates!



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




Re: [PHP] Date problem

2002-12-31 Thread Rick Widmer
At 05:23 PM 12/31/02 +0800, Denis L. Menezes wrote:

Hello friends.

Is there a routine in PHP I can use to find if today's date fits between 
the commencing date and the ending date?


SELECT * FROM Table WHERE NOW() >= StartDate AND NOW() <= EndDate

Rick





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




Re: [PHP] Php 4.3.0 and Mail() function

2002-12-31 Thread Rick Widmer
At 10:11 AM 12/31/02 -0500, Carl Bélanger wrote:

I just upgraded to php 4.3.0 and all by bulletin board are now returning 
error about the mail function:

Fatal error: Call to undefined function: mail() in 
/var/wwwx/htdocs/forum/private.php on line 687


What could be missing?


./configure looks for sendmail if it is not found the mail function is not 
compiled in, resulting in the undefined function call.  Mine is in 
/usr/sbin/sendmail.  Grep the results of ./configure for 'sendmail' to see 
what happened.


  ./configure ... > tempfile

  grep sendmail tempfile


Rick


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



Re: [PHP] Re: loading a db table into a php array from mysql

2002-12-31 Thread Rick Widmer
At 02:57 PM 12/31/02 -0500, David T-G wrote:

...and then Tularis said...
%
% Usually,
% using mysql to handle your tables is *way* faster than letting php
% handle it.


Yes, do as much as you can in the database.  The people who wrote it spent 
a lot of time trying to optimize it.



%
% In your case, you could just do a complex join I think. That would give

Ahhh...  A new term.  Back to the books for me!


Here is a query from one of my projects...

$R1 = $DB->Query( "SELECT ScheduleID, CourseName, DepartmentName, " .
  "   TimeStart, TimeStop, BuildingName, " .
  "   BuildingNumber, RoomName, RoomNumber, " .
  "   a.GradeLevel AS MinGrade, " .
  "   b.GradeLevel AS MaxGrade " .
  "FROM Schedule " .
  "LEFT JOIN Courses USING( CourseID ) " .
  "LEFT JOIN Departments " .
  " ON Schedule.DepartmentID = 
Departments.DepartmentID " .
  "LEFT JOIN Periods " .
  " ON Schedule.PeriodID = Periods.PeriodID " .
  "LEFT JOIN Rooms " .
  " ON Schedule.RoomID = Rooms.RoomID " .
  "LEFT JOIN Buildings USING( BuildingID ) " .
  "LEFT JOIN Levels a " .
  " ON a.LevelID = MinLevel " .
  "LEFT JOIN Levels b " .
  " ON b.LevelID = MaxLevel " .
  "WHERE YearID = '$CurrYearID' " .
  "  AND TeacherID = '{$_SESSION[ 'CurrentUserID' ]}' " .
  "ORDER BY TimeStart " );

This combines data from seven different tables, and pulls two different 
values out of one of the tables (Levels) to create a single result set.  In 
many cases you can collect all the data you need in a single query.

Every field in the Schedule table is a key to another table that has to be 
looked up and translated to something people will understand.  Note the two 
different ways of connecting tables with LEFT JOIN.  USING( fieldname ) 
connects the  table being joined, with the table listed right before it, 
using the same fieldname in both.  The ON syntax allows you to use 
differently named fields, and/or a different table.

Courses has two fields (MinLevel, MaxLevel) that contain the highest and 
lowest grade that is allowed to take the course.  Look closely at how the 
table aliases (a and b) are used to join two different fields to the same 
table. (Levels)

The table structures are listed below.

Rick




CREATE TABLE Buildings (
  BuildingID bigint(20) NOT NULL auto_increment,
  BuildingName varchar(20) default NULL,
  BuildingNumber varchar(20) default NULL,
  NumRooms int(11) default NULL,
  FirstYear bigint(20) default NULL,
  LastYear bigint(20) default NULL,
  PRIMARY KEY  (BuildingID),
  KEY BuildingName (BuildingName)
) TYPE=MyISAM;


CREATE TABLE Courses (
  CourseID bigint(20) NOT NULL auto_increment,
  DepartmentID bigint(20) NOT NULL default '0',
  CurriculumID bigint(20) NOT NULL default '0',
  CourseName varchar(20) default NULL,
  MinLevel bigint(20) NOT NULL default '0',
  MaxLevel bigint(20) NOT NULL default '0',
  BeginYear bigint(20) default NULL,
  EndYear bigint(20) default NULL,
  PRIMARY KEY  (CourseID),
  KEY DepartmentID (DepartmentID),
  KEY CurriculumID (CurriculumID)
) TYPE=MyISAM;


CREATE TABLE Departments (
  DepartmentID bigint(20) NOT NULL auto_increment,
  DepartmentHead bigint(20) default NULL,
  DepartmentName varchar(30) default NULL,
  MinGrade int(11) default NULL,
  MaxGrade int(11) default NULL,
  DepartmentOrder decimal(4,2) default NULL,
  PRIMARY KEY  (DepartmentID)
) TYPE=MyISAM;


CREATE TABLE Levels (
  LevelId bigint(20) NOT NULL auto_increment,
  DepartmentID bigint(20) NOT NULL default '0',
  LevelName varchar(30) default NULL,
  GradeLevel int(11) default NULL,
  PRIMARY KEY  (LevelId)
) TYPE=MyISAM;


CREATE TABLE Periods (
  PeriodID bigint(20) NOT NULL auto_increment,
  PeriodGroupID bigint(20) default NULL,
  TimeStart time default NULL,
  TimeStop time default NULL,
  Days set('Sun','Mon','Tue','Wed','Thu','Fri','Sat') default NULL,
  RollReqd char(2) default NULL,
  PRIMARY KEY  (PeriodID),
  KEY DepartmentID (PeriodGroupID)
) TYPE=MyISAM;


CREATE TABLE Rooms (
  RoomID bigint(20) NOT NULL auto_increment,
  BuildingID bigint(20) NOT NULL default '0',
  RoomName varchar(20) default NULL,
  RoomNumber varchar(20) default NULL,
  PRIMARY KEY  (RoomID),
  KEY BuildingID (BuildingID)
) TYPE=MyISAM;


CREATE TABLE Schedule (
  ScheduleID bigint(20) NOT NULL auto_increment,
  YearID bi

Re: [PHP] use included GD of external

2002-12-31 Thread Rick Widmer
At 03:13 AM 1/1/03 +0100, Richard Pijnenburg wrote:

Hi list,

What is better to use? The included GD library or the external (
Boutell.com ) GD library?


Unless you have to use the external library because other things are 
sharing it, just use the GD that comes with PHP.

We are talking about 4.3.0, right?

Rick


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



Re: [PHP] Php 4.3.0 and Mail() function

2003-01-01 Thread Rick Widmer
At 02:07 AM 1/2/03 +0800, Jason Wong wrote:

On Thursday 02 January 2003 01:26, Carl Bélanger wrote:
> Exactly!!
>
> "checking for sendmail... no"
>
> I've browsed the configure's help and I can't find an option to specify
> the path to sendmail (which is not at a regular place as we run qmail).
>  Is the a "--with-sendmail-path" option or something like that?


I don't believe there is one.  At the very least you can:

   touch /usr/sbin/sendmail

which creates an empty file where ./configure expects to find sendmail.



qmail comes with a wrapper called sendmail which emulates sendmail. I'm not
sure where php's configure expects to find sendmail but you can try
copying/linking the wrapper to /usr/lib and/or /usr/sbin.


This is best:

ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail

Now any program expecting to find sendmail in the default location will 
find the Qmail wrapper instead, and will work.

Rick


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



Re: [PHP] Re: loading a db table into a php array from mysql

2003-01-02 Thread Rick Widmer



% different ways of connecting tables with LEFT JOIN.  USING( fieldname )
% connects the  table being joined, with the table listed right before it,
% using the same fieldname in both.  The ON syntax allows you to use
% differently named fields, and/or a different table.

I still don't get what a left or right or outer or inner join is...


When looking up values in a second table, LEFT JOIN has two properties
that make it my choice:

o It lets me specify exactly how the tables are linked together.

o It returns results for the first table even if there are no entries
in the second table.  For example, if one of my classes did not yet have
a room assigned, the rest of the data will still be returned.


> I've read the mysql docs for the syntax and some examples, but this is
> a place where I'll need to go to outside tutorials.  Do you know of
> any (on the web) which will give me the background?

   http://www.devshed.com/Server_Side/MySQL/Join/page5.html


   http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=sql+join+tutorial


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




Re: [PHP] Using mail() for mailist list app

2003-01-02 Thread Rick Widmer
At 06:33 PM 1/1/03 -0500, Michael J. Pawlowsky wrote:


Personally I simply get the e-mail addresses spit out to me from the 
database and then I  input them into a application made just for bulk mailingt.
You can also easily write a quick perl or shell script to send it out from 
a file of names and this way you can "nice" the process so as not to 
bog  down the machine.


PHP now offers a command line SAPI that lets you write these programs with 
PHP.  Leave the names in the database, and use PHP's mail() to send the 
messages.  It works very well.  I've been using PHP at the command line for 
quite a while now.  4.3.0 is the first version that creates the CLI version 
of PHP by default.

Rick


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



Re: [PHP] Re: loading a db table into a php array from mysql

2003-01-02 Thread Rick Widmer
At 06:32 AM 1/1/03 -0500, David T-G wrote:


I still don't get what a left or right or outer or inner join is...


The reason I chose LEFT JOIN are:

o You get better control over how the query is executed.

o Values from the first table are returned even if there is no associated 
entry in the second table.  For eaxample if no building or room was set on 
an entry in my previous query, the rest of the data will still be returned.


  Do you know of any (on the web) which will give me the background?



   http://www.devshed.com/Server_Side/MySQL/Join/page1.html

   http://www.devshed.com/Server_Side/MySQL/Normal

   http://www.devshed.com/Server_Side/MySQL/SQLJoins/page1.html



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




Re: [PHP] PHP Testing

2003-01-02 Thread Rick Widmer
At 05:25 PM 1/2/03 -0800, Jim Lucas wrote:




  DocumentRoot  /some/path/public_html
  php_admin_value engine On


try

php_admin_value php_engine on|off

Rick


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




Re: [PHP] 2 servers for mail implementation

2003-01-03 Thread Rick Widmer
At 07:11 PM 1/2/03 -0800, Roger Thomas wrote:

dear all,
i have 2 servers that were *given* to me to setup and implement webmail
solution for our client. i have done some groundwork in terms of the backend
applications that are needed to do this.



This doesn't have much to do with PHP.  In fact it can probably be done 
without PHP.

The ideal setup depends on your situation.  How many domans?  How many 
users?  How much email?


If you have multiple domains, I suggest you look at

  http://inter7.com/freesoftware/


They have a complete package to manage multiple virtual domains on a Qmail 
server using only one system user.  I've been using it for a couple years, 
with good luck.  There is an active development effort


If I was going to setup two machines as mail servers, I would put half the 
users on each, with all the programs running on both.  Then I would setup 
MX records so that each server backed up the other, collecting email for 
later delivery if the other server is down.This way if one of the 
machines goes down, half your users still get mail, and the messages for 
the other half are queued on the remaining server.

Be sure to keep a backup copy of one machine's configuration on the 
other.  You should have everything you need to re-build a dead server on 
the other machine.  If you put the user mailboxes and mail queue on 
separate hard drives you can pop that drive from one machine to another 
very quickly.


You can run Apache on the mail server to manage email accounts, and for 
webmail, but keep all non-mail related web services off of it.  You don't 
want all the web developers logging on to the mail server.


Rick


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



Re: [PHP] Re: PHP memory usage

2003-01-03 Thread Rick Widmer
At 01:25 AM 1/3/03 -0200, Fernando Serboncini wrote:



function a(myclass c)
{
return c;
}

would create another copy of "c" in memory. Things get a bit larger when you
go with linked-list like structures in classes, where you have to take
really good care to don't duplicate data. If you're not taking care, then
maybe 5MB is normal.



Not really.  PHP has its own method of handling variables which does not 
make a copy of data unless it has to.  See:

   http://www.zend.com/zend/art/ref-count.php


This may be the most important paragraph in the article:

   Note that PHP 4 is not like C: passing variables by reference is not
   necessarily faster than passing them by value. Indeed, in PHP 4 it is
   usually better to pass a variable by value, except if the function
   changes the passed value or if a reference is being passed.


Rick


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



Re: [PHP] Recommend payment processors?

2003-01-03 Thread Rick Emery
I use PayPal.  Does not require a merchant account.  PHP payment interface and 
interaction is easy
to implement.  Via HTML in your webpage, you pass to PayPal the URL of the PHP script 
to be executed
when a payment is received.

- Original Message -
From: "Chad Day" <[EMAIL PROTECTED]>
To: "php general" <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 10:14 AM
Subject: [PHP] Recommend payment processors?


Just wondering what people are using/recommend out there.. I'm going to be
getting a merchant account and let people purchase services through my
website on a secure server, all in PHP.  What concerns me is this archived
post I came across:

http://marc.theaimsgroup.com/?l=php-general&m=102165623600464&w=2

Reading that, it sounds like it's not possible to use Payment Pro, or
possibly other systems, with PHP .. is this correct?  Some of the other
posts in the archive sounded like people were using it, so I'm not really
sure what is possible at this point.

Thanks,
Chad


--
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] Still executing afte die()?

2003-01-03 Thread Rick Emery
You'll never get to the die() statement, because you redirected with the header() 
statement.

- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 03, 2003 6:14 PM
Subject: [PHP] Still executing afte die()?


I have a page called 404.php which is set as the 404 page in a .htaccess
file.  At the top of this file, it has this:
if(strtolower($_SERVER['REQUEST_URI']) != $_SERVER['REQUEST_URI']){
header("Location:
http://{$_SERVER['HTTP_HOST']}".strtolower($_SERVER['REQUEST_URI']));
die;
}
which redirects to the same page with a lowercase URL if there are any
uppercase characters.  After that, it inserts the 404 into the database
for checking later.  But, when I test it with something like
PaGeTHATSHOULDBELOWERCASE.php, it redirects to
pagethatshouldbelowercase.php but still inserts it into the database
(with the uppercase page name) even though the redirected page is
404-free.  What am I doing wrong?

--
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] Mysql update problems

2003-01-05 Thread Rick Emery
what appeared when you printed the text of your query:
 $query = "update bloggers set cache='$blog', title='$title' where url='$address'";
 print $query;

I'm thinking that your single quotes preventd $blog, $title, $address form being 
expanded.
- Original Message - 
From: "Jesse Lawrence" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 10:27 AM
Subject: [PHP] Mysql update problems


I've been scratching my head over the following code
for a while now.  It's supposed to check a given
weblog for specific tags, and if they're present,
update the weblog's table in my database.  I believe
the problem is around the execution of the db query,
but I can't seem to get it figured out.

function is_news($address, $blogtitle, $host, $user,
$pass, $dbname){
   $f = fopen($address, 'r');
   $read = fread($f, 2);
   fclose($f);
   $title_start = strpos($read, "");
   $title_end = strpos($read, "");
   $title = substr($read, $title_start, ($title_end -
$title_start));


   $blog_start = strpos($read, "");
   $blog_end = strpos($read, "");
   $blog = substr($read, $blog_start, ($blog_end -
$blog_start));

   $link = mysql_connect($host, $user, $pass) 
 or die("Can't connect to
database");
  
  $query = "update bloggers set cache='$blog',
title='$title' where url='$address'";
  if(mysql_db_query ($dbname, $query, $link)) {
 $is_news = 1; 
  }else{
 $is_news = 0;
  }

   return $is_news;

}

Thanks a million for any help,

Jesse Lawrence



__ 
Post your free ad now! http://personals.yahoo.ca

-- 
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] Mysql update problems

2003-01-05 Thread Rick Emery
Then the problem is in MYSQL.  to help determine this, ALWAYS--ALWAYS include the "or
die(mysql_error())" as part of the mysql_query():

mysql_db_query ($dbname, $query, $link) or die("Error: cannot read
table$query".mysql_error());

- Original Message -
From: "jesse" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 05, 2003 11:50 AM
Subject: Re: [PHP] Mysql update problems


No, the query is working fine... all variables are printing correctly.
This is what has me confused.  Everything seems to be as it should, it's
just not updating the db table.

Rick Emery wrote:
> what appeared when you printed the text of your query:
>  $query = "update bloggers set cache='$blog', title='$title' where url='$address'";
>  print $query;
>
> I'm thinking that your single quotes preventd $blog, $title, $address form being 
>expanded.
> - Original Message -
> From: "Jesse Lawrence" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, January 05, 2003 10:27 AM
> Subject: [PHP] Mysql update problems
>
>
> I've been scratching my head over the following code
> for a while now.  It's supposed to check a given
> weblog for specific tags, and if they're present,
> update the weblog's table in my database.  I believe
> the problem is around the execution of the db query,
> but I can't seem to get it figured out.
>
> function is_news($address, $blogtitle, $host, $user,
> $pass, $dbname){
>$f = fopen($address, 'r');
>$read = fread($f, 2);
>fclose($f);
>$title_start = strpos($read, "");
>$title_end = strpos($read, "");
>$title = substr($read, $title_start, ($title_end -
> $title_start));
>
>
>$blog_start = strpos($read, "");
>$blog_end = strpos($read, "");
>$blog = substr($read, $blog_start, ($blog_end -
> $blog_start));
>
>$link = mysql_connect($host, $user, $pass)
>  or die("Can't connect to
> database");
>
>   $query = "update bloggers set cache='$blog',
> title='$title' where url='$address'";
>   if(mysql_db_query ($dbname, $query, $link)) {
>  $is_news = 1;
>   }else{
>  $is_news = 0;
>   }
>
>return $is_news;
>
> }
>
> Thanks a million for any help,
>
> Jesse Lawrence
>
>
>
> __
> Post your free ad now! http://personals.yahoo.ca
>


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




Fw: [PHP] Unexpected $end error?

2003-01-05 Thread Rick Emery
When you get an error that points to , it means you did not close a {} or ""

In this case, you did not close the:   if ($row = mysql_fetch_array($result)) {

Although you did close the "while do {}" immediately thereafter.

- Original Message - 
From: "Vincent Bouret" <[EMAIL PROTECTED]>
To: <>
Sent: Sunday, January 05, 2003 4:56 PM
Subject: [PHP] Unexpected $end error?


Can someone tell me why I keep getting that error:

Parse error: parse error, unexpected $end in D:\Program Files\Apache
Group\Apache2\htdocs\proxy\acc_new.php on line 62

line 62 refers to 

Thanks for your help

Vincent

Here is the content of acc_new.php




Account Management Tools - Add a new account





Accounts Management Tools
Add a new account

Username:
  

  Password:

Must contain between 4 and 20 characters.
  Firstname:

  
  Lastname:

  
  Email address:

  
  Usergroup:
  
  

  
   
   

  

  



Back to Account Management Tools




and here is the content of auth.php



and mysql.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




Fw: [PHP] time stamp screwing up

2003-01-06 Thread Rick Emery
show us your database table structure (the whole thing).  the NOW() will always work 
with a "date"
or "timestamp" field

- Original Message -
From: "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]>
To: <>
Sent: Monday, January 06, 2003 11:28 AM
Subject: Re: [PHP] time stamp screwing up


Well i am still getting all the zero's

: ( : (

"- Edwin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "- [ Paul Ferrie ] -" <[EMAIL PROTECTED]> wrote:
> > So
> >
> > Is NOW() a mysql function?
>
> Well, you can check for yourself ;)
>
> It should be somewhere around here:
>
>   http://www.mysql.com/doc/en/Date_and_time_functions.html
>
> - E
>
> ...[snip]...
>
> __
> Do You Yahoo!?
> Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/
>



--
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] Defaults in drop down list...

2003-01-06 Thread Rick Widmer
At 11:54 AM 1/6/03 -0600, Steven Kallstrom wrote:



Alabama
Alaska
Arizona
.


$stateselected['$state'] is an array that stores the state that was
selected on the prior form.  is there an easier way, to have a default
state picked out of this drop down list.???



Write a function that paints selects:

$States = array( 'AL' => 'Alabama', ...


function PaintSelect( $Name, $Values, $Selected ) {

echo "\n";

reset( $Values );
while( list( $Index, $Value ) = each( $Values )) {
   $Selected = ( $Selected == $Index ) ? ' SELECTED' : '';
   echo "   $Value\n'
   }

echo "\n";

}


Then call lt like this ...

State: 


Rick




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




Fw: [PHP] Img src

2003-01-07 Thread Rick Emery
the problem is the "" before the width word
it should be  "\"
- Original Message - 
From: "Ezequiel Sapoznik" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, January 07, 2003 7:30 PM
Subject: [PHP] Img src


I am having a parse error in the following sentence:

  print "";

Thanks!

Ezequiel



-- 
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 - WHILE in FOREACH

2003-01-07 Thread Rick Emery
Is this your exact code?  I ask, because the following should generate a parse error:
echo "";

You have 3 double-quotes (").

- Original Message - 
From: "James Brennan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 07, 2003 7:29 PM
Subject: [PHP] help - WHILE in FOREACH


The while statement is only executing correctly for the first run through 
the foreach loop. Why?

Thanks,
loop

foreach($desc as $key=>$value) {
printf("Show %s Description ", $key, $key);
echo "";

while($row = mysql_fetch_row($show_names)) {
printf("%s", $row[0], $row[1]);
}
echo "";
}

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


-- 
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] $_SERVER content

2003-01-08 Thread Rick Widmer
At 12:00 PM 1/8/03 +0100, Fritzek wrote:

Hi folks,

I've seen a lot phpinfo() on different platforms, different PHP versions
with different web servers. Always the content of $_SERVER is different.
i.e PHP4.3.0 on win32 with Apache2 doesn't show PATH_TRANSLATED and 
HTTP_REFERER.
someone knows how to get a consitent content of $_SERVER? Or where and how
can I configure my system to see the above?

There isn't anything PHP can do about this, all it can do is return what 
the server sends.   Browsers, firewalls and proxies can all decide to hide 
information from you.

Rick



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



Re: [PHP] How can I redirect to another php page

2003-01-08 Thread Rick Emery
header("location: nextpage.php");

the above must be sent before any other text is output

- Original Message - 
From: "Teo Petralia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 08, 2003 2:46 PM
Subject: [PHP] How can I redirect to another php page


Hi All!
I would like to redirect the user to another php page accordingly to 
his/her chosen options, example:
if ($Color == "Yellow") {
go to page 
else if ($Color == "Green")
go to page 
}

Does anyone knows how to achieve the goal??

Thanks

Teo

-- 
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] apache + mod_php question

2003-01-08 Thread Rick Widmer
At 05:16 AM 1/9/03 +1000, Timothy Hitchens \(HiTCHO\) wrote:

use: apachectl graceful

It will reload the config's and allow operation to continue!!



Yes, in many cases this is the best option.  The only time I've found it 
will not work is when you are adding or changing SSL certificates.  For all 
other changes graceful is much better choice because Apache will not lose 
any connections.  Anything that comes in after the graceful gets handled 
based on the new configuration.  Things that are already running will 
complete using the old configuration.  The important thing, your machine 
never ignores requests.

Rick


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



Re: [PHP] building web album - design questions

2003-01-09 Thread Rick Emery
1.  Store images separately with pointers in the database.  It permits faster database 
queries.

2.

3.  int imagecopyresized ( resource dst_im, resource src_im, int dstX, int dstY, int 
srcX, int srcY,
int dstW, int dstH, int srcW, int srcH)

- Original Message -
From: "Anders Thoresson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 09, 2003 2:20 PM
Subject: [PHP] building web album - design questions


Hi,

  I'm planning to build a web album for my digital photographs, and have
some questions regarding the design:

  1) Is it better to store the images within the database, or just store
pointers to the images which is put outside, in the filesystem?

  2) At log in, I want to show to which albums new pictures have been added
since last visit. For performance reasons, should information about last
added pictures be added to the database, or is it ok to make a MySQL-query
each time, comparing the add-date for every picture in every album with the
users last log in date?

  3) If I've understood things right, there is functions within PHP that
can handle picture resizing? Is that correct?

  Best regards,

   Anders Thoresson


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




Fw: [PHP] What means "ioctl"

2003-01-12 Thread Rick Emery
"ioctl" is an IO controls structure.

Just look at the fopen("","r").  Do you notice anything missing?

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <>
Sent: Sunday, January 12, 2003 3:59 PM
Subject: [PHP] What means "ioctl"


I got the error-message:
Warning: fopen("", "r") - Inappropriate ioctl for device
what means ioctl?
Harry



-- 
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] Error in variable when looping

2003-01-13 Thread Rick Emery
so where is $rowe set?

Show us code that calls this page
- Original Message -
From: "menezesd" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 6:21 PM
Subject: [PHP] Error in variable when looping


Hello friends,

I have made the following table of data and a button on every row to view the details. 
The code is
working fine and the table is displayed with the buttons.

The problem I have is that the $SelectedItemNumber posted to the next page remains the 
same number
no matter which row button I click. I have my relevant code below. Please help me. I 
know I am
making a mistake somewhere but I cannot figure out where.

Quote :


while($row=mysql_fetch_array($result)){

Print "  ";
Print "" ;
Print   "  $row[OrgName] ";
print "   ";
Print "" ;
Print  $row[OrgCountry];
print "   ";
Print "" ;
Print  $row[OrgNumber];
print "   ";
Print "" ;
Print  $row[Orgaddress];
print "   ";
Print "" ;
Print  $row[OrgChief];
print "   ";
Print "" ;
Print"";
print "";
Print"";}
  }
?>



Unquote

Thanks
Denis

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




  1   2   3   4   5   6   7   8   9   10   >