RE: [PHP] Re: rewrite rule help anyone?

2003-02-25 Thread Siddharth Hegde
Sorry did not get you there specifically this part

> > ---This:
> > index.php?file=test&cmd=display&what=all
> > ---Becomes:
> > index-get-file-is-test+cmd-is-display+what-is-all.html

Anyway, I have written a rewrite rule to rewrite
www..some-domain.com to
www.some-domain.com/index.php?somevar=

Is this what you are looking for?

- Sid

> -Original Message-
> From: Shawn McKenzie [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 24, 2003 4:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: rewrite rule help anyone?
> 
> No takers???
> 
> Did I say, Please!
> 
> Thanks!
> Shawn
> 
> "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Slightly off topic, but I have some PHP also ;-)
> >
> > I am trying to make search engine friendly URLs for a site, but want
> this
> to
> > be fairly dynamic and work with any new script and vars.
> >
> > If anyone would be willing, I need help on a mod_rewrite rule or
rules?
> I'm
> > thinking it should be fairly simple, but I know nothing about reg
> > expressions.  Maybe not the greatest, but here's the code that
generates
> the
> > HTML with altered URLs.  This works great, but then I need Apache to
> rewrite
> > these.
> >
> > ---This:
> > index.php?file=test&cmd=display&what=all
> > ---Becomes:
> > index-get-file-is-test+cmd-is-display+what-is-all.html
> >
> > --Here's the code:
> >
> > ob_start();
> > echo $htmlpage;
> > $newdisplay = ob_get_contents();
> > ob_clean_flush();
> > echo rewrite($newdisplay);
> >
> > function rewrite($newdisplay)
> > {
> > $search = array(
> > ".php?", ".php", "=", "&", "&");
> >
> > $replace = array(
> > "-get-", "", "-is-", "+", "+");
> >
> > $hrefs = find_hrefs($newdisplay);
> > $tmphrefs = str_replace($search, $replace, $hrefs);
> > foreach($tmphrefs as $key => $array) {
> > $newhrefs[$key] = $array.".html";
> > }
> > $newdisplay = str_replace($hrefs, $newhrefs, $newdisplay);
> >
> > return $newdisplay;
> > }
> >
> > //finds href=" in the string containing the html
> > function find_hrefs($tmpcontent)
> > {
> > while($start = strpos($tmpcontent, 'href="', $end)) {
> > $start = $start +6;
> > $end = strpos($tmpcontent, '"', $start);
> > $href[] = substr($tmpcontent, $start, $end - $start);
> > }
> > return $href;
> > }
> >
> > TIA,
> > Shawn
> >
> >
> 
> 
> 
> --
> 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] reminder mail when date is within a month of today.

2003-02-25 Thread Siddharth Hegde


> -Original Message-
> From: Petre Agenbag [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 2:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] reminder mail when date is within a month of today.
> 
> HI
> I'm having a bad thinking day. I know it's going to be a very easy
> solution, but please humour me.
> I have a mysql table with a bunch of subscribers and the date that
they
> subscribed.
> I want to query the table to find all the subscribers who will come up
> for renewal within the current month. So, each time I access the page,
> it must generate a table with those who's subscription is going to
> expire in this month, as well as those who might already be past the
> renewal date.
> I can handle the generation of the table and all, I'm just not coping
> with the query string.
> 
> 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] Session SID curio

2003-02-25 Thread Bryan Lipscy
I ran into a weird curiosity playing with sessions.

Consider this working code:



If I access http://hostname/sess.php from my internal network this is
the result:

Session ID == 

If I access http://www.domainname.net/sess.php from my internal network
this is the result:

Session ID == PHPSESSID=aed42b1e8e514e2b28e630729edfa24b 


Server: Apache/1.3.27 (Unix) PHP/4.3.0
www.domainname.net maps to hostname.  They are the same server, just
accessed differently.

Maybe I missed it but I didn't see anything in the docs, archives or
bugs about this.  

Anyone know why this happens?

Bryan




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



Re: [PHP] getimagesize() issues starting with PHP 4.3..

2003-02-25 Thread Tom Rogers
Hi,

Wednesday, February 26, 2003, 2:27:10 PM, you wrote:
JD> Can anyone reproduce this problem?

JD> I am involved in running a large forum, and ever since our upgrade to PHP 
JD> 4.3.1, there have been fairly random issues with getimagesize().  It 
JD> happens only on certain images it seems.  However, it wasn't happening with 
JD> 4.2.  When using the following code:

JD>  $retval=getimagesize('http://armanii.c.crosslink.net/arcticsilver/dtmsig4.j
JD> pg');
JD> echo "$retval[0] $retval[1] $retval[3] \n\n\n";
?>>

JD> I get echo'd back.  It does go an fetch the image according to a tcpdump, 
JD> but something fails after that.  That is an example of one of the images 
JD> that is failing.

JD> I am running PHP 4.3.1 w/ Apache 1.3.27 on FreeBSD 4.7.  Is there something 
JD> I'm missing?  Is this a bug as I think it is?

JD> Thanks in advance!

JD> -JD-

JD> --
JD> Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
JD> Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
JD> Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/

JD> PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08


Try
$retval=getimagesize("http://armanii.c.crosslink.net/arcticsilver/dtmsig4.jpg",$info);

..seems to wake it up :) ..possible bug??

-- 
regards,
Tom


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



[PHP] Re: getimagesize() issues starting with PHP 4.3..

2003-02-25 Thread Jason DiCioccio
Oops.. Big typo.. It should read that I get *nothing* echo'd back, except 
newlines :).

Thanks again,
-JD-
--On Tuesday, February 25, 2003 23:27 -0500 Jason DiCioccio 
<[EMAIL PROTECTED]> wrote:

Can anyone reproduce this problem?

I am involved in running a large forum, and ever since our upgrade to PHP
4.3.1, there have been fairly random issues with getimagesize().  It
happens only on certain images it seems.  However, it wasn't happening
with 4.2.  When using the following code:
http://armanii.c.crosslink.net/arcticsilver/dtmsig4
.j pg');
echo "$retval[0] $retval[1] $retval[3] \n\n\n";
?>
I get echo'd back.  It does go an fetch the image according to a tcpdump,
but something fails after that.  That is an example of one of the images
that is failing.
I am running PHP 4.3.1 w/ Apache 1.3.27 on FreeBSD 4.7.  Is there
something I'm missing?  Is this a bug as I think it is?
Thanks in advance!

-JD-

--
Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/
PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08


--
Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/
PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08

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


Re: [PHP] Running system commands

2003-02-25 Thread Jason Wong
On Wednesday 26 February 2003 03:28, [EMAIL PROTECTED] wrote:
>  Before I ask, I have read the documentation but nothing seems to work.
>
>  I want to run a system command from behind the scenes (totally secure
> area of my server) that creates a directory and changes permissions on it.
>
> i.e. system ("mkdir $path");
>
>  Example above uses a value from a form passed to the script and is
> assigned from $_POST['path'];
>
>  When I run it no directory is created. Ideas??

Error message?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Never trust anyone who says money is no object.
*/


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



Re: [PHP] to Bryan Lipscy Re: [PHP] how___??

2003-02-25 Thread Jason Wong
On Wednesday 26 February 2003 07:52, Luis A wrote:
> MEN I DONT HAVE INTERNET ACCESS
>
> thanks anyway
>
> if some one else can help m e please

I can email the manual to you if that would help?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Executive ability is prominent in your make-up.
*/


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



[PHP] getimagesize() issues starting with PHP 4.3..

2003-02-25 Thread Jason DiCioccio
Can anyone reproduce this problem?

I am involved in running a large forum, and ever since our upgrade to PHP 
4.3.1, there have been fairly random issues with getimagesize().  It 
happens only on certain images it seems.  However, it wasn't happening with 
4.2.  When using the following code:

http://armanii.c.crosslink.net/arcticsilver/dtmsig4.j
pg');
echo "$retval[0] $retval[1] $retval[3] \n\n\n";
?>
I get echo'd back.  It does go an fetch the image according to a tcpdump, 
but something fails after that.  That is an example of one of the images 
that is failing.

I am running PHP 4.3.1 w/ Apache 1.3.27 on FreeBSD 4.7.  Is there something 
I'm missing?  Is this a bug as I think it is?

Thanks in advance!

-JD-

--
Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/
PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08

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


[PHP] Object programming with PHP5

2003-02-25 Thread Patrick LOK
Is there anyone out there can tell me do I have to rewrite my PHP4 object programs in 
PHP5?

./pl


[PHP] Win32 problems with 4.2.3

2003-02-25 Thread Ashley M. Kirchner
   Code snippet:

   \n";
 print_r($url_array);
   ?>
   This works fine under Apache 1.3.27 with PHP 4.2.3 running on Linux. 
But on a Win32 environment, no go.  I have Apache 1.3.24 with PHP 4.2.3 
on WinXP and $url_array is just plain blank...for that matter, so is 
$REQUEST_URI when I try to echo it.  However, when I look at phpinfo(), 
the data is there, so why is the array empty, and why does it echo as 
empty as well?  Apache settings are the same on both environments by the 
way.

--
M | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.


smime.p7s
Description: S/MIME Cryptographic Signature


RE: [PHP] Newbie Question

2003-02-25 Thread Cal Evans
you have 2 functions named DBField.  This was ok until 4.3. After 4.3 you
couldn't re-declare a function like this.

PHP does not allow for overloading like Java and C++ (It looks like that's
what you are trying to do)

Check the docs for overloading.  There is some support for it but it's a bit
of a kludge. (IMHO, etc.)

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Greg Luce [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 9:47 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie Question


Can someone explain why this code works on the hosting company's server,
but won't run on my local server? I'm not sure what version is on the
host server, but I'm running 4.0.5 locally on winXP Pro. The error says:
Fatal error: Cannot redeclare dbfield() in
c:\inetpub\wwwroot\livinginnaples\database.php on line 30

7.class DBField
8.{
9.  var $name;
10. var $type;
11. var $table;
12. var $title;
13.
14. var $size;
15. var $rows;
16. var $maxlength;
17. var $value;
18. var $prefix;
19. var $postfix;
20. var $display;
21.
22. function DBField()
23. {
24. $name = "";
25. $table = "";
26.
27. $this->display = true;
28. }
29.
30. function DBField( $name, $table, $size, $value )
31. {
32. if( $size == "" ) $size=20;
33.
$this->display = true;
$this->name = $name;
$this->table = $table;
$this->size = $size;
$this->rows = 5;
$this->value = $value;
$this->title = ucwords( $name );
}

function display()
{
if( !$this->display ) return;

$prefix = str_replace( "[TITLE]", $this->title,
$this->prefix );
echo $prefix;

switch( $this->type )
{
case "blob": ?>
value ?>value != "" ) $time =
strtotime( $this->value );
else $time = strtotime( "now" ); ?>
">/">/">
postfix . "\r\n";
}
}



--
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] Newbie Question

2003-02-25 Thread Greg Luce
Can someone explain why this code works on the hosting company's server,
but won't run on my local server? I'm not sure what version is on the
host server, but I'm running 4.0.5 locally on winXP Pro. The error says:
Fatal error: Cannot redeclare dbfield() in
c:\inetpub\wwwroot\livinginnaples\database.php on line 30

7.class DBField
8.{
9.  var $name;
10. var $type;
11. var $table;
12. var $title;
13. 
14. var $size;
15. var $rows;
16. var $maxlength;
17. var $value;
18. var $prefix;
19. var $postfix;
20. var $display;
21. 
22. function DBField()
23. {
24. $name = "";
25. $table = "";
26.
27. $this->display = true;
28. }
29.
30. function DBField( $name, $table, $size, $value )
31. {
32. if( $size == "" ) $size=20;
33. 
$this->display = true;
$this->name = $name;
$this->table = $table;
$this->size = $size;
$this->rows = 5;
$this->value = $value;
$this->title = ucwords( $name );
}

function display()
{
if( !$this->display ) return;

$prefix = str_replace( "[TITLE]", $this->title,
$this->prefix );
echo $prefix;

switch( $this->type )
{
case "blob": ?>
value ?>value != "" ) $time =
strtotime( $this->value );
else $time = strtotime( "now" ); ?>
">/">/">
postfix . "\r\n";
}
}



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



[PHP] query to Active Directory

2003-02-25 Thread Ezra Nugroho


This one is really puzzling... 
It has taken me days..

I need to do an LDAP search to an Active Directory server.
I was able to connect and bind to the server fine, but my searches are always in
vain. OK, here we go:

box name: mydomain-71.mydomain.myschools.org
domain name: mydomain.myschools.org
user to search: [EMAIL PROTECTED]
(names and and passwords are of course ficticious)

my code:



it gives me:

Resource id #1
AUTH: 1

Warning: LDAP: Unable to perform the search: can't contact LDAP server in
ldap_test.php on line 16

Warning: ldap_get_entres(): supplied argument is not a valid ldap result
resource  blah  blah...

Now, I was able to connect and authenticate to it, but why ldap_search() says
that I can't connect to it?


If I change $base_dn to "dc=mydomain-71,dc=mydomain,dc=myschools,dc=org";
The error message is changed to :
Unable to perform the search: No such object in ldap_test.php on line 16.

It doesn't complain about not being able to connect anymore! But of course the
search fails because the domain really is only mydomain.myschools.org.

What on earth did I do wrong??

Thanks, 

-
This mail sent through IMP: http://horde.org/imp/

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



Re: [PHP] $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread CF High
Hey John et. al

I tried your method John, and it works!

Re: excessive single quotes in the sql, but I tried stripping them out to no
effect.  Using curly braces in the sql statement wasn't an option I knew
about.  Thanks again for illuminating another bit of the PHP world.

--Noah


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >
> ('1','1','$date','$_POST['jersey_id'][$x]','$_POST['first'][$x]','$_POST
> ['
>
> Let's just be smart and think about this for a second. Look at all of
> the single quotes you've got. How do you expect PHP to be able to tell
> what's a variable and what's text? Do you mean $_POST or
> $_POST['jersey_id'] or $_POST['jersey_id'][$x] as the variable? PHP
> can't read your mind.
>
> Anyway, if you're going to use this method, put braces around your
> variable, so PHP knows what you are sending it.
>
> ('1','1','$date','{$_POST['jersey_id'][$x]}','{$_POST['first'][$x]}'
>
> or this method
>
> ('1','1','$date','$_POST[jersey_id][$x]','$_POST[first][$x]'
>
> PHP will be greedy, I think, and assume you mean $_POST[jersey_id][$x]
> as the variable.
>
> Or this method
>
> ('1','1','$date','".$_POST['jersey_id'][$x]."','".$_POST['first'][$x]."'
>
> ---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



Re: [PHP] file upload and a browse for file box

2003-02-25 Thread Joshua Moore-Oliva
plain html



On February 25, 2003 08:32 pm, Sunfire wrote:
> hi..
>
> i looked in the manual about file uploads and basically know how it works
> other than a little playing around with it but was wondering how you could
> make a browse for file button that opens a box on the users computer so
> then can look for the file rather than type it in.. or is this something
> with java/javascript that i have to find out elsewhere
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.458 / Virus Database: 257 - Release Date: 2/24/2003


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



[PHP] Sorting Arrays

2003-02-25 Thread Bill MacAllister
Hello,

I am running PHP 4.2.2 on an Alpha Linux system.  The array sorting 
functions don't seem to be doing anything, i.e. pass an array in and 
get exactly the same thing back.  I have tried to isolate the problem 
by just cutting a simple example out of the documentation, for example 
the asort example, and it still doesn't work.  Is there something I am 
missing in the config.

Note, sorting works fine on an older Alpha Linux system running PHP 
4.0.5.

Suggestions will be heartily welcomed.

Thanks,

Bill

+
| Bill MacAllister
| 14219 Auburn Road
| Grass Valley, CA 95949
| Phone: 530-272-8555

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



Re: [PHP] Include files

2003-02-25 Thread Jinky Otacan Cocalon
the problem was solved by creating an include file and using using 
require() method

i was just wondering what are the advantages and disadvantages of using 
require_once() instead of require()?

thanx =)



John W. Holmes wrote:
How do I include external library files in PHP???
I would like to put the lines that are repeated in each php files, in
a

separate file.
e.g.



Just throw caution to the wind and try the include() function I'm
not responsible for the consequences!!! Do not blame me if your file is
included!!
---John W. Holmes...

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


--

"Gravity can't be held responsible for people falling in love."

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


[PHP] Re: MIME help needed please...

2003-02-25 Thread Manuel Lemos
Hello,

On 02/23/2003 08:01 PM, Shawn McKenzie wrote:
I got this from the user contributed notes in the php.net manual.  It seems
to work fine most of the time, but Eudora and Pegasus users either get
mangled attachments or no attachments.
Can anyone see a problem (most files are zip, but sometimes tar.gz or sit) I
tried using Content-Type: application/zip with the same results.  I'm
thinking it is some issue with the headers, content-types, boundaries or
something.  Or maybe Pegasus/Eudora don't understand MIME or base64
(doubtful)???
It could be one of many bugs of the mail() function.

You may want to try this class for composing and sending MIME messages 
as it works around some of those bugs:

http://www.phpclasses.org/mimemessage

--

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


RE: [PHP] Include files

2003-02-25 Thread Bryan Lipscy
Funny thing about online manuals.

include() http://www.php.net/manual/en/function.include.php
include_once() http://www.php.net/manual/en/function.include-once.php

Please read: http://www.catb.org/~esr/faqs/smart-questions.html


-Original Message-
From: Kenneth Suralta [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 4:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Include files


How do I include external library files in PHP???
I would like to put the lines that are repeated in each php files, in a 
separate file.
e.g.


Kenneth



-- 
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] no session id

2003-02-25 Thread Bryan Lipscy
RTM: http://www.php.net/manual/en/ref.session.php
Tutorial: http://www.zend.com/zend/tut/session.php






-Original Message-
From: php [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 4:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] no session id


this code doesn't ouput a session-id.
is the code right? and if not, any suggestions what's wrong? i'm new
into sessions, so forgive me for stupid questions.. thanx michiel






-- 
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] file upload and a browse for file box

2003-02-25 Thread Sunfire
hi..

i looked in the manual about file uploads and basically know how it works
other than a little playing around with it but was wondering how you could
make a browse for file button that opens a box on the users computer so then
can look for the file rather than type it in.. or is this something with
java/javascript that i have to find out elsewhere




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


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



Re: [PHP] Include files

2003-02-25 Thread Larry E. Ullman
How do I include external library files in PHP???
I would like to put the lines that are repeated in each php files, in 
a separate file.
e.g.

$db_host = "localhost";
$db_port = "3306";
$db_name = "test";
...
?>
I find the include() function to be quite useful for including external 
files. Check out the relevant pages of the "PHP Manual":
www.php.net/include
and
www.php.net/include_once
and
www.php.net/require
and
www.php.net/require_once

Larry

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


RE: [PHP] mysql trouble

2003-02-25 Thread Bryan Lipscy
Create a user with appropriate privledges for the database.  DO NOT use
root.  





You did not mention where the $nombre, $direccion, $telefono, or $email
variables are being initialized.
To capture the values from a form use $_POST['name'] where name is the
name of the field on the form.

HTH

-Original Message-
From: Luis A [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 4:21 PM
To: [EMAIL PROTECTED]
Subject: [PHP] to paulm Re: [PHP] mysql trouble


hey i think the root does not need password to connect to mysql

or yes 

on my server the root user does not have password
thats why i dont know why he does not update the database?

- Original Message -
From: "paulm" <[EMAIL PROTECTED]>
To: "Luis A" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 6:48 PM
Subject: Re: [PHP] mysql trouble


> you don't have a password for root in mysql_connect
> - Original Message -
> From: "Luis A" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 26, 2003 1:04 AM
> Subject: [PHP] mysql trouble
>
>
> hi pasl i got a troblem here
>
>
> if some one can help me ?
>
> take a look at this
>  // process form
> $link = mysql_connect("localhost", "root"); 
> mysql_select_db("mydb",$db); $sql = "INSERT INTO agenda (nombre, 
> direccion, telefono, email) " +
>   "VALUES ('$nombre', '$direccion', '$telefono', '$email')"; $result =

> mysql_query($sql); echo "¡Gracias! Hemos recibido sus datos.\n";
>
> ?>
>
>
>
> HE DOES NOT WORKING
>
> any subjest ?
>
>



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

2003-02-25 Thread John W. Holmes
> ###  ### // process form
> ### $link = mysql_connect("localhost", "root");
> you need to have the password as the third argument
> $link = mysql_connect("localhost", "root", "password");
> 
> Also, why is it in a variable?
> Just make it:
> mysql_connect("localhost", "root", "password");

Sometime there are users that do not have a password. Every parameter to
mysql_connect() is optional, by the way.

Also, you want to assign the result of mysql_connect() to a variable so
you can tell the connections apart. If you only have one connection per
script, then it's not a big deal. But, if you connect to several
databases, then you need that result to tell them apart when you do
queries later so PHP knows what connection to send your query through.

> ### mysql_select_db("mydb",$db);
> ### $sql = "INSERT INTO agenda (nombre, direccion, telefono, email) "
+

Problem is the plus (+) sign at the end of this line.

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



Re: [PHP] no session id

2003-02-25 Thread Justin French
on 26/02/03 11:39 AM, php ([EMAIL PROTECTED]) wrote:



Justin


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



RE: [PHP] no session id

2003-02-25 Thread John W. Holmes
> this code doesn't ouput a session-id.
> is the code right? and if not, any suggestions what's wrong?
> i'm new into sessions, so forgive me for stupid questions..
> thanx
> michiel
> 
> 
>  session_start ();
> Header("Content-Type: text/html");
> echo "session id: " . $session_id;
> ?>

Where do you think $session_id is coming from? If you want to get the
current session id, use the session_id() function.

scho "session id: " . session_id();

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



RE: [PHP] Include files

2003-02-25 Thread John W. Holmes
> How do I include external library files in PHP???
> I would like to put the lines that are repeated in each php files, in
a
> separate file.
> e.g.
>  $db_host = "localhost";
> $db_port = "3306";
> $db_name = "test";
> ...
> ?>

Just throw caution to the wind and try the include() function I'm
not responsible for the consequences!!! Do not blame me if your file is
included!!

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



RE: [PHP] to paulm Re: [PHP] mysql trouble

2003-02-25 Thread John W. Holmes
> hey i think the root does not need password to connect to mysql
> 
> or yes 
> 
> on my server the root user does not have password
> thats why i dont know why he does not update the database?

You have no internet access, you think root does not need a password,
and you're a programmer... wow. 

You can set a password for the root user in MySQL. I guess it's not
"required" to have one, but it's a very good idea to have one. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/
 
> - Original Message -
> From: "paulm" <[EMAIL PROTECTED]>
> To: "Luis A" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 25, 2003 6:48 PM
> Subject: Re: [PHP] mysql trouble
> 
> 
> > you don't have a password for root in mysql_connect
> > - Original Message -
> > From: "Luis A" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 26, 2003 1:04 AM
> > Subject: [PHP] mysql trouble
> >
> >
> > hi pasl i got a troblem here
> >
> >
> > if some one can help me ?
> >
> > take a look at this
> >  > // process form
> > $link = mysql_connect("localhost", "root");
> > mysql_select_db("mydb",$db);
> > $sql = "INSERT INTO agenda (nombre, direccion, telefono, email) " +
> >   "VALUES ('$nombre', '$direccion', '$telefono', '$email')";
> > $result = mysql_query($sql);
> > echo "¡Gracias! Hemos recibido sus datos.\n";
> >
> > ?>
> >
> >
> >
> > HE DOES NOT WORKING
> >
> > any subjest ?
> >
> >
> 
> 
> 
> --
> 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] $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread John W. Holmes
>
('1','1','$date','$_POST['jersey_id'][$x]','$_POST['first'][$x]','$_POST
['

Let's just be smart and think about this for a second. Look at all of
the single quotes you've got. How do you expect PHP to be able to tell
what's a variable and what's text? Do you mean $_POST or
$_POST['jersey_id'] or $_POST['jersey_id'][$x] as the variable? PHP
can't read your mind.

Anyway, if you're going to use this method, put braces around your
variable, so PHP knows what you are sending it. 

('1','1','$date','{$_POST['jersey_id'][$x]}','{$_POST['first'][$x]}'

or this method

('1','1','$date','$_POST[jersey_id][$x]','$_POST[first][$x]'

PHP will be greedy, I think, and assume you mean $_POST[jersey_id][$x]
as the variable.

Or this method

('1','1','$date','".$_POST['jersey_id'][$x]."','".$_POST['first'][$x]."'

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



RE: [PHP] mysql trouble

2003-02-25 Thread John W. Holmes
> take a look at this
>  // process form
> $link = mysql_connect("localhost", "root");
> mysql_select_db("mydb",$db);
> $sql = "INSERT INTO agenda (nombre, direccion, telefono, email) " +
>   "VALUES ('$nombre', '$direccion', '$telefono', '$email')";
> $result = mysql_query($sql);

You use a period (.) to concatenate strings, not a plus (+) symbol.

If you displayed $sql, like you should when you're debugging your
script, you'd of realized this a long time ago. 

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



Re: [PHP] mysql trouble

2003-02-25 Thread Richard Whitney
Quoting Luis A <[EMAIL PROTECTED]>:

### hi pasl i got a troblem here 
### 
### 
### if some one can help me ?
### 
### take a look at this 
### 
### 
### 
### 
### HE DOES NOT WORKING 
### 
### any subjest ?
### 
### 
### 
### 


-- 
Richard Whitney   *
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]   *
http://xend.net*
602-971-2791
  * *   *
*  *  *__**
 _/  \___  *
 *  /   *\**
  */ * *  \
**/\_ |\
 /   \_  /  \
/  \/\
   /  \ 
  /\
 /  \


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



[PHP] no session id

2003-02-25 Thread php
this code doesn't ouput a session-id.
is the code right? and if not, any suggestions what's wrong?
i'm new into sessions, so forgive me for stupid questions..
thanx
michiel






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



[PHP] Include files

2003-02-25 Thread Kenneth Suralta
How do I include external library files in PHP???
I would like to put the lines that are repeated in each php files, in a 
separate file.
e.g.

$db_host = "localhost";
$db_port = "3306";
$db_name = "test";
...
?>

Kenneth



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


[PHP] to paulm Re: [PHP] mysql trouble

2003-02-25 Thread Luis A
hey i think the root does not need password to connect to mysql

or yes 

on my server the root user does not have password
thats why i dont know why he does not update the database?

- Original Message -
From: "paulm" <[EMAIL PROTECTED]>
To: "Luis A" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 6:48 PM
Subject: Re: [PHP] mysql trouble


> you don't have a password for root in mysql_connect
> - Original Message -
> From: "Luis A" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 26, 2003 1:04 AM
> Subject: [PHP] mysql trouble
>
>
> hi pasl i got a troblem here
>
>
> if some one can help me ?
>
> take a look at this
>  // process form
> $link = mysql_connect("localhost", "root");
> mysql_select_db("mydb",$db);
> $sql = "INSERT INTO agenda (nombre, direccion, telefono, email) " +
>   "VALUES ('$nombre', '$direccion', '$telefono', '$email')";
> $result = mysql_query($sql);
> echo "¡Gracias! Hemos recibido sus datos.\n";
>
> ?>
>
>
>
> HE DOES NOT WORKING
>
> any subjest ?
>
>



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



Re: [PHP] $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread Joshua Moore-Oliva
I believe that single quotes will display exactly what you type in, and double 
quotes will actually process it..  e.g.

$foo = "hello";

echo '$foo';
You see $foo

echo "$foo";
You see hello

On February 25, 2003 09:42 pm, CF High wrote:
> Hey all.
>
> Got a problem with this sql statement -- php vars are evaluated (e.g. the
> $date var), but not the $_POST arrays..
>
> All of the arrays return correct values -- What am I missing here?
>
> $sql = "INSERT into rosters (school_id, sport_id, date, jersey_id, first,
> last, position, grade, town, state, country, height, weight, DOB)
> VALUES
> ('1','1','$date','$_POST['jersey_id'][$x]','$_POST['first'][$x]','$_POST['l
>a st'][$x]','$_POST['position'][$x]','$_POST['grade'][$x]',
>
> '$_POST['town'][$x]','$_POST['state'][$x]','$_POST['country'][$x]','$_POST[
>' height'][$x]',
>'$_POST['weight'][$x]','$DOB[$i]')";
>
> I still have some hair left on my head..
>
> --Noah
>
> --


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



Re: [PHP] Uploading Images

2003-02-25 Thread Justin French
http://php.net/filesize
http://php.net/getimagesize

http://www.php.net/manual/en/features.file-upload.php
Also mentions "Related Configurations Note: See also the file_uploads,
upload_max_filesize, upload_tmp_dir, and post_max_size directives in
php.ini"

Please search the manual first -- it isn't hard to find what you need!


Justin French


on 26/02/03 5:12 AM, clarionhaze ([EMAIL PROTECTED]) wrote:

> Hey guys I need to make a place for people to upload images and then I need to
> make sure the file size is alright and the pixel size too...  Could someone
> please send me in the right direction?
> 
> -steven


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



[PHP] Re: $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread Philip Hallstrom
Try

sql = ".'" . $_POST['jersey_id'][$x] . "',.

Also make sure you're form is being submitted with POST and not GET...

-philip

On Tue, 25 Feb 2003, CF High wrote:

> Hey all.
>
> Got a problem with this sql statement -- php vars are evaluated (e.g. the
> $date var), but not the $_POST arrays..
>
> All of the arrays return correct values -- What am I missing here?
>
> $sql = "INSERT into rosters (school_id, sport_id, date, jersey_id, first,
> last, position, grade, town, state, country, height, weight, DOB)
> VALUES
> ('1','1','$date','$_POST['jersey_id'][$x]','$_POST['first'][$x]','$_POST['la
> st'][$x]','$_POST['position'][$x]','$_POST['grade'][$x]',
>
> '$_POST['town'][$x]','$_POST['state'][$x]','$_POST['country'][$x]','$_POST['
> height'][$x]',
>'$_POST['weight'][$x]','$DOB[$i]')";
>
> I still have some hair left on my head..
>
> --Noah
>
> --
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



[PHP] to Bryan Lipscy Re: [PHP] how___??

2003-02-25 Thread Luis A
MEN I DONT HAVE INTERNET ACCESS

thanks anyway

if some one else can help m e please
- Original Message -
From: "Bryan Lipscy" <[EMAIL PROTECTED]>
To: "'Luis A'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 6:16 PM
Subject: RE: [PHP] how___??


> Please read the online documentation at http://www.php.net
>
> Also read through examples at http://www.zend.com/tips/tips.php?CID=113
>
> And before you ask another question please read:
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> Each of these pages may be translated at http://babel.altavista.com
>
> Bryan
>
>
> -Original Message-
> From: Luis A [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 2:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] how___??
>
>
> i need to do this
>
>
> $link = mysql_connect("remote host", "mysql_user", "mysql_password") or
> die("Could not connect: " . mysql_error());
>
> how is that ???
> do i have to put the same function ?
>
> or is diferent?
>
> - Original Message -
> From: "Bryan Lipscy" <[EMAIL PROTECTED]>
> To: "'Luis A'" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, February 25, 2003 4:57 PM
> Subject: RE: [PHP] how___??
>
>
> > RTM first please:
> > http://www.php.net/manual/en/function.mysql-connect.php
> >
> > $link = mysql_connect("localhost", "mysql_user", "mysql_password") or
> > die("Could not connect: " . mysql_error());
> >
> > Replace localhost with the hostname of your mysql server.
> >
> >
> >
> > -Original Message-
> > From: Luis A [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 25, 2003 1:34 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] how___??
> >
> >
> > hlelooww>)
> >
> > i need some one can help me please?
> >
> > i need to make this quine of conection
> >
> > for example
> >
> > i want to connect to a remote mysql  server
> >
> > i realy apreciate if some one can help me
> >
> > please?
> >
> > >)
> >
> >
>
>
> --
> 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] $_POST arrays not evaluated in sql statement -- why?

2003-02-25 Thread CF High
Hey all.

Got a problem with this sql statement -- php vars are evaluated (e.g. the
$date var), but not the $_POST arrays..

All of the arrays return correct values -- What am I missing here?

$sql = "INSERT into rosters (school_id, sport_id, date, jersey_id, first,
last, position, grade, town, state, country, height, weight, DOB)
VALUES
('1','1','$date','$_POST['jersey_id'][$x]','$_POST['first'][$x]','$_POST['la
st'][$x]','$_POST['position'][$x]','$_POST['grade'][$x]',

'$_POST['town'][$x]','$_POST['state'][$x]','$_POST['country'][$x]','$_POST['
height'][$x]',
   '$_POST['weight'][$x]','$DOB[$i]')";

I still have some hair left on my head..

--Noah

--




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



Re: [PHP] Auto Incrementing a Variable name?

2003-02-25 Thread Leif K-Brooks
Should be:
${name$i}
Jeff Pauls wrote:

I get an error with this. PHP doesn't like "$name$i".

for ($i = 1; $i <= 3; $i++)  {
$arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
}
I've looked at Variable variables but I don't think that is what I need.
What about if I wanted something like
$name_1_ff
$name_2_ff
$name_3_ff
neither of these  work.

$name_$i_ff
$name_.$i._ff
Having something after causing more of a problem. First of all PHP can't
find the value of "$name_" and "_ff" just breaks it more.
Jeff

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Jeff Pauls" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:26 PM
Subject: Re: [PHP] Auto Incrementing a Variable name?
 

You're on the right track:
for ($i = 1; $i <= 3; $i++)  {
$arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
}
- Original Message -
From: "Jeff Pauls" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:18 PM
Subject: [PHP] Auto Incrementing a Variable name?
Hi,
I've been playing with this for a while now. Say I had the following
   

variables:
 

$name1 = "joe";
$name2 = "janis";
$name3 = "joanne";
Is there a way in php to increment the variable name not the value?
   

Something like this
 

for ($i = 1; $i <= 3; $i++)  {
$arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc
}
This way say if I had 500 database queries that need to be updated I could
   

just loop through each
 

and just change the record id.

for ($i = 1; $i <= 500; $i++)  {

$query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE
   

person_id='$i";
 

$result_update = mysql_query($query_update) or die("Query failed");
}
instead of doing something like this:

$query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
$result_update1 = mysql_query($query_update1) or die("Query failed");
$query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
$result_update2 = mysql_query($query_update2) or die("Query failed");
$query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
$result_update3 = mysql_query($query_update3) or die("Query failed");
etc.

Anybody? There has to be a way of doing this...

Thanks,

Jeff



   



 

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



Re: [PHP] Re: MIME help needed please...

2003-02-25 Thread Jason k Larson
If you are having problems with Eudora or Pegasus, why don't you send an 
attachment from a Eudora||Pegasus and replicate whatever headers are 
getting generated their.  Then you'd have a test case for something you 
are trying to perform in PHP, and then (even better) you don't have to 
wonder if you are asking the list stupid questions.

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


[PHP] mysql trouble

2003-02-25 Thread Luis A
hi pasl i got a troblem here 


if some one can help me ?

take a look at this 




HE DOES NOT WORKING 

any subjest ?





RE: [PHP] how___??

2003-02-25 Thread Bryan Lipscy
Please read the online documentation at http://www.php.net

Also read through examples at http://www.zend.com/tips/tips.php?CID=113

And before you ask another question please read:
http://www.catb.org/~esr/faqs/smart-questions.html

Each of these pages may be translated at http://babel.altavista.com

Bryan


-Original Message-
From: Luis A [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 2:16 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] how___??


i need to do this


$link = mysql_connect("remote host", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());

how is that ???
do i have to put the same function ?

or is diferent?

- Original Message -
From: "Bryan Lipscy" <[EMAIL PROTECTED]>
To: "'Luis A'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 4:57 PM
Subject: RE: [PHP] how___??


> RTM first please: 
> http://www.php.net/manual/en/function.mysql-connect.php
>
> $link = mysql_connect("localhost", "mysql_user", "mysql_password") or 
> die("Could not connect: " . mysql_error());
>
> Replace localhost with the hostname of your mysql server.
>
>
>
> -Original Message-
> From: Luis A [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 1:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how___??
>
>
> hlelooww>)
>
> i need some one can help me please?
>
> i need to make this quine of conection
>
> for example
>
> i want to connect to a remote mysql  server
>
> i realy apreciate if some one can help me
>
> please?
>
> >)
>
>


-- 
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] Auto Incrementing a Variable name?

2003-02-25 Thread Jeff Pauls
I think I have something that will do the trick thanks to everyones help.

$name_1_aaa = "Jimmy";
$name_2_aaa = "Janis";
$name_3_aaa = "Joe";

for ($i = 1; $i <= 3; $i++)  {
$arr_name[$i] = 'name_'.$i.'_aaa';
}

echo ${$arr_name[1]}.'';
echo ${$arr_name[2]}.'';
echo ${$arr_name[3]}.'';

Displays:

Jimmy
Janis
Joe

Now I can do something like this for all my updates

for ($i = 1; $i <= 3; $i++)  {
$query_update = "UPDATE table SET name='${$arr_name[$i]}' WHERE
name_id='$i'";
 $result_update = mysql_query($query_update) or die("Query failed");
}


Thanks for all the help!

Jeff


- Original Message -
From: "Jason k Larson" <[EMAIL PROTECTED]>
To: "Jeff Pauls" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:37 PM
Subject: Re: [PHP] Auto Incrementing a Variable name?


> $name1 = 'Hello, World!';
> $i = 1;
> $var = 'name'.$i;
> print ${$var};
>
> HTH,
> Jason k Larson
>
>
> Jeff Pauls wrote:
> > Hi,
> > I've been playing with this for a while now. Say I had the following
variables:
> >
> > $name1 = "joe";
> > $name2 = "janis";
> > $name3 = "joanne";
> >
> > Is there a way in php to increment the variable name not the value?
Something like this
> >
> > for ($i = 1; $i <= 3; $i++)  {
> >  $arr_name[$i] = $name.$i; // I want $name1,$name2,$name3
etc
> > }
> >
> >
> > This way say if I had 500 database queries that need to be updated I
could just loop through each and just change the record id.
> >
> > for ($i = 1; $i <= 500; $i++)  {
> >
> > $query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE
person_id='$i";
> > $result_update = mysql_query($query_update) or die("Query failed");
> > }
> >
> > instead of doing something like this:
> >
> > $query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
> > $result_update1 = mysql_query($query_update1) or die("Query failed");
> >
> > $query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
> > $result_update2 = mysql_query($query_update2) or die("Query failed");
> >
> > $query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
> > $result_update3 = mysql_query($query_update3) or die("Query failed");
> >
> > etc.
> >
> > Anybody? There has to be a way of doing this...
> >
> > Thanks,
> >
> > Jeff
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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



[PHP] Re: MIME help needed please...

2003-02-25 Thread Shawn McKenzie
Is this a stupid question, or does no one know what is wrong???

Thanks!
Shawn

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I got this from the user contributed notes in the php.net manual.  It
seems
> to work fine most of the time, but Eudora and Pegasus users either get
> mangled attachments or no attachments.
>
> Can anyone see a problem (most files are zip, but sometimes tar.gz or sit)
I
> tried using Content-Type: application/zip with the same results.  I'm
> thinking it is some issue with the headers, content-types, boundaries or
> something.  Or maybe Pegasus/Eudora don't understand MIME or base64
> (doubtful)???
>
> Help appreciated.  Thanks!
>
> function send_mail($from_name, $from_email, $to_name, $to_email, $subject,
> $text, $path, $filename)
> {
> // encode file attachments
> foreach($filename as $key => $file) {
>$fp = fopen($path[$key].$file, "r");
>$content = fread($fp, filesize($path[$key].$file));
>$attachment[$key] = chunk_split(base64_encode($content));
> }
> // headers need to be in the correct order...
> $headers = "From: $from_name<$from_email>\n";
> $headers .= "Reply-To: <$from_email>\n";
> $headers .= "MIME-Version: 1.0\n";
>
> // the following must be one line (post width too small)
> $headers .= "Content-Type: multipart/related;
> type=\"multipart/alternative\";
> boundary=\"=MIME_BOUNDRY_main_message\"\n";
> $headers .= "X-Sender: $from_name<$from_email>\n";
> $headers .= "X-Mailer: PHP4\n"; //mailer
> $headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
> $headers .= "Return-Path: <$from_email>\n";
> $headers .= "This is a multi-part message in MIME format.\n";
> $headers .= "--=MIME_BOUNDRY_main_message \n";
> $headers .= "Content-Type: multipart/alternative;
> boundary=\"=MIME_BOUNDRY_message_parts\"\n";
>
> // plaintext section begins
> $message = "--=MIME_BOUNDRY_message_parts\n";
> $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
> $message .= "Content-Transfer-Encoding: quoted-printable\n";
> $message .= "\n";
>
> // your text goes here
> $message .= "$text\n";
> $message .= "\n";
>
> // this ends the message part
> $message .= "--=MIME_BOUNDRY_message_parts--\n";
> $message .= "\n";
>
> // now we add attachments (images, etc)
> foreach($filename as $key => $file) {
>$message .= "--=MIME_BOUNDRY_main_message\n";
>$message .= "Content-Type: application/octet-stream;
> name=\"$file\"\n";
>$message .= "Content-disposition: attachment\n";
>$message .= "Content-Transfer-Encoding: base64\n";
>$message .= "\n";
>$message .= "$attachment[$key]\n";
>$message .= "\n";
> }
> // message ends
> $message .= "--=MIME_BOUNDRY_main_message--\n";
>
> // send the message
> $stat = mail("$to_name<$to_email>", $subject, $message, $headers);
> return $stat;
> }
>
>



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



Re: [PHP] how___??

2003-02-25 Thread Luis A
i need to do this


$link = mysql_connect("remote host", "mysql_user", "mysql_password") or
 die("Could not connect: " . mysql_error());

how is that ???
do i have to put the same function ?

or is diferent?

- Original Message -
From: "Bryan Lipscy" <[EMAIL PROTECTED]>
To: "'Luis A'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 4:57 PM
Subject: RE: [PHP] how___??


> RTM first please:
> http://www.php.net/manual/en/function.mysql-connect.php
>
> $link = mysql_connect("localhost", "mysql_user", "mysql_password") or
> die("Could not connect: " . mysql_error());
>
> Replace localhost with the hostname of your mysql server.
>
>
>
> -Original Message-
> From: Luis A [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 1:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how___??
>
>
> hlelooww>)
>
> i need some one can help me please?
>
> i need to make this quine of conection
>
> for example
>
> i want to connect to a remote mysql  server
>
> i realy apreciate if some one can help me
>
> please?
>
> >)
>
>


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



Re: [PHP] how___??

2003-02-25 Thread Ernest E Vogelsinger
At 22:34 25.02.2003, Luis A said:
[snip]
>i need some one can help me please?
>
>i need to make this quine of conection 
>
>for example
>
>i want to connect to a remote mysql  server
[snip] 

Check out http://www.php.net/manual/en/ref.mysql.php for what is available
for MySQL.


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



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



RE: [PHP] how___??

2003-02-25 Thread Bryan Lipscy
RTM first please:
http://www.php.net/manual/en/function.mysql-connect.php

$link = mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());

Replace localhost with the hostname of your mysql server.



-Original Message-
From: Luis A [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 1:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how___??


hlelooww>)

i need some one can help me please?

i need to make this quine of conection 

for example

i want to connect to a remote mysql  server

i realy apreciate if some one can help me 

please?

>)


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



Re: [PHP] Auto Incrementing a Variable name?

2003-02-25 Thread John Nichel
Jeff Pauls wrote:
I get an error with this. PHP doesn't like "$name$i".

for ($i = 1; $i <= 3; $i++)  {
 $arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
}
Try $arr_name[$i] = $name . $i;

 I've looked at Variable variables but I don't think that is what I need.
What about if I wanted something like
$name_1_ff
$name_2_ff
$name_3_ff
neither of these  work.

 $name_$i_ff
 $name_.$i._ff
Try  $name . "_" . $i . "_ff";

Having something after causing more of a problem. First of all PHP can't
find the value of "$name_" and "_ff" just breaks it more.
Jeff

- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Jeff Pauls" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:26 PM
Subject: Re: [PHP] Auto Incrementing a Variable name?


You're on the right track:
for ($i = 1; $i <= 3; $i++)  {
$arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
}
- Original Message -
From: "Jeff Pauls" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:18 PM
Subject: [PHP] Auto Incrementing a Variable name?
Hi,
I've been playing with this for a while now. Say I had the following
variables:

$name1 = "joe";
$name2 = "janis";
$name3 = "joanne";
Is there a way in php to increment the variable name not the value?
Something like this

for ($i = 1; $i <= 3; $i++)  {
$arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc
}
This way say if I had 500 database queries that need to be updated I could
just loop through each

and just change the record id.

for ($i = 1; $i <= 500; $i++)  {

$query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE
person_id='$i";

$result_update = mysql_query($query_update) or die("Query failed");
}
instead of doing something like this:

$query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
$result_update1 = mysql_query($query_update1) or die("Query failed");
$query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
$result_update2 = mysql_query($query_update2) or die("Query failed");
$query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
$result_update3 = mysql_query($query_update3) or die("Query failed");
etc.

Anybody? There has to be a way of doing this...

Thanks,

Jeff









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


[PHP] how___??

2003-02-25 Thread Luis A
hlelooww>)

i need some one can help me please?

i need to make this quine of conection 

for example

i want to connect to a remote mysql  server

i realy apreciate if some one can help me 

please?

>)


Re: [PHP] Auto Incrementing a Variable name?

2003-02-25 Thread Jeff Pauls
I get an error with this. PHP doesn't like "$name$i".

for ($i = 1; $i <= 3; $i++)  {
 $arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
}

 I've looked at Variable variables but I don't think that is what I need.
What about if I wanted something like

$name_1_ff
$name_2_ff
$name_3_ff

neither of these  work.

 $name_$i_ff
 $name_.$i._ff

Having something after causing more of a problem. First of all PHP can't
find the value of "$name_" and "_ff" just breaks it more.

Jeff


- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "Jeff Pauls" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:26 PM
Subject: Re: [PHP] Auto Incrementing a Variable name?


> You're on the right track:
> for ($i = 1; $i <= 3; $i++)  {
>  $arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
> }
>
> - Original Message -
> From: "Jeff Pauls" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, February 25, 2003 3:18 PM
> Subject: [PHP] Auto Incrementing a Variable name?
>
>
> Hi,
> I've been playing with this for a while now. Say I had the following
variables:
>
> $name1 = "joe";
> $name2 = "janis";
> $name3 = "joanne";
>
> Is there a way in php to increment the variable name not the value?
Something like this
>
> for ($i = 1; $i <= 3; $i++)  {
>  $arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc
> }
>
>
> This way say if I had 500 database queries that need to be updated I could
just loop through each
> and just change the record id.
>
> for ($i = 1; $i <= 500; $i++)  {
>
> $query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE
person_id='$i";
> $result_update = mysql_query($query_update) or die("Query failed");
> }
>
> instead of doing something like this:
>
> $query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
> $result_update1 = mysql_query($query_update1) or die("Query failed");
>
> $query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
> $result_update2 = mysql_query($query_update2) or die("Query failed");
>
> $query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
> $result_update3 = mysql_query($query_update3) or die("Query failed");
>
> etc.
>
> Anybody? There has to be a way of doing this...
>
> Thanks,
>
> Jeff
>
>
>



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



Re: [PHP] Auto Incrementing a Variable name?

2003-02-25 Thread Jason k Larson
$name1 = 'Hello, World!';
$i = 1;
$var = 'name'.$i;
print ${$var};
HTH,
Jason k Larson
Jeff Pauls wrote:
Hi,
I've been playing with this for a while now. Say I had the following variables:
$name1 = "joe";
$name2 = "janis";
$name3 = "joanne";
Is there a way in php to increment the variable name not the value? Something like this

for ($i = 1; $i <= 3; $i++)  { 
 $arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc 
}

This way say if I had 500 database queries that need to be updated I could just loop through each and just change the record id.

for ($i = 1; $i <= 500; $i++)  { 

$query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE person_id='$i";
$result_update = mysql_query($query_update) or die("Query failed");
}
instead of doing something like this:

$query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
$result_update1 = mysql_query($query_update1) or die("Query failed");
$query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
$result_update2 = mysql_query($query_update2) or die("Query failed");
$query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
$result_update3 = mysql_query($query_update3) or die("Query failed");
etc.

Anybody? There has to be a way of doing this...

Thanks,

Jeff


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


RE: [PHP] Re: Submit buttons

2003-02-25 Thread Bryan Lipscy
HTML:


JS:
Function DoThis(){
frmMain.method = "POST";
frmMain.action = "admin.php";
frmMain.submit();
}

Where frmMain is the name for the FORM:


Read all about it in: http://www.oreilly.com/catalog/jscript4/

Bryan

-Original Message-
From: Greg [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 12:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Submit buttons


I'm horrible at javascript, does anyone have a script that will do this?
Thanks again!!

"Oliver Witt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greg schrieb:
>
> > Is there any way that I can have a form submit to different pages
depending
> > on the submit button that is pressed?  Thanks!
>
> dont use submit buttons, but buttons... (type="button") calling a 
> script
that
> submits the form to whatever page you want it to.
> Olli
>



-- 
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] Auto Incrementing a Variable name?

2003-02-25 Thread Rick Emery
You're on the right track:
for ($i = 1; $i <= 3; $i++)  {
 $arr_name[$i] = $name$i; // I want $name1,$name2,$name3 etc
}

- Original Message -
From: "Jeff Pauls" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:18 PM
Subject: [PHP] Auto Incrementing a Variable name?


Hi,
I've been playing with this for a while now. Say I had the following variables:

$name1 = "joe";
$name2 = "janis";
$name3 = "joanne";

Is there a way in php to increment the variable name not the value? Something like 
this

for ($i = 1; $i <= 3; $i++)  {
 $arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc
}


This way say if I had 500 database queries that need to be updated I could just loop 
through each
and just change the record id.

for ($i = 1; $i <= 500; $i++)  {

$query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE person_id='$i";
$result_update = mysql_query($query_update) or die("Query failed");
}

instead of doing something like this:

$query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
$result_update1 = mysql_query($query_update1) or die("Query failed");

$query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
$result_update2 = mysql_query($query_update2) or die("Query failed");

$query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
$result_update3 = mysql_query($query_update3) or die("Query failed");

etc.

Anybody? There has to be a way of doing this...

Thanks,

Jeff


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



Re: [PHP] WE NEED SOME ADVICES: What is the best way for sending a huge amount of emails?

2003-02-25 Thread Chris Knipe
Get mailing list software such as majordomo / mailman.

PHP isn't the best way to do these kind of things...

--
me


- Original Message -
From: "Jean Fábio Barros" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:59 PM
Subject: [PHP] WE NEED SOME ADVICES: What is the best way for sending a huge
amount of emails?


> Hi everyone!
>
> We will appreciate some advices. We are new to PHP, thus, please, be
> patient! :)
> We want to make a script which needs to send a huge amount of emails
> (The emails are stored in a MySQL DB). We would like to take control of
> sending errors and put these in a log file. The script needs to send
> TXT, HTML,images, and even small files. Both the email content and the
> settings will be prepared through a HTML interface. We will need a sort
> of queue where we would be able to put some "Bad emails" on it in order
> to resend them as much times as it was set in the settings (HTML).
>
> So, How is the best way for making that PHP script, considering
> security, reliability (Handling email errors) and speed?
>
> Thanks in advance
>
>
>
> --
> 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] Auto Incrementing a Variable name?

2003-02-25 Thread Kevin Stone
Variable variables allows you to define a variable name from a string.

http://www.php.net/manual/en/language.variables.variable.php

- Kevin

- Original Message -
From: "Jeff Pauls" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 2:18 PM
Subject: [PHP] Auto Incrementing a Variable name?


Hi,
I've been playing with this for a while now. Say I had the following
variables:

$name1 = "joe";
$name2 = "janis";
$name3 = "joanne";

Is there a way in php to increment the variable name not the value?
Something like this

for ($i = 1; $i <= 3; $i++)  {
 $arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc
}


This way say if I had 500 database queries that need to be updated I could
just loop through each and just change the record id.

for ($i = 1; $i <= 500; $i++)  {

$query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE
person_id='$i";
$result_update = mysql_query($query_update) or die("Query failed");
}

instead of doing something like this:

$query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
$result_update1 = mysql_query($query_update1) or die("Query failed");

$query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
$result_update2 = mysql_query($query_update2) or die("Query failed");

$query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
$result_update3 = mysql_query($query_update3) or die("Query failed");

etc.

Anybody? There has to be a way of doing this...

Thanks,

Jeff



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



Re: [PHP] Out of Range

2003-02-25 Thread 1LT John W. Holmes
Probably means that only one row was returned from your query, so 2 is out
of range.

---John Holmes...

- Original Message -
From: "Todd Barr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 5:11 PM
Subject: [PHP] Out of Range


here is my code

$Query = "SELECT Last_Login and Current_Login from Security where
PM_ID=$_SESSION[ID]";
$Getdates = odbc_do($link, $Query);
while(odbc_fetch_row($Getdates))
 {
$Last=odbc_result($Getdates, 1);
$Now=odbc_result($Getdates, 2);


Now I get an error that tells me that #2 is out of the range

Any suggestions


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



Re: [PHP] simple problem about authentication

2003-02-25 Thread 1LT John W. Holmes
> I'm trying to set up a password section on my website. But I don't want
> a window popping up asking for a username and password. I'd rather like
> to have a form that submits the data. I did that and it works fine, but
> the browser seems to not save the username and password, because if i
> click on any link, it returns an "unauthorized message"... any ideas?
> thnx,

Show some code... the possibilities are endless for what you're doing wrong.

---John Holmes...


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



Re: [PHP] Empty Query

2003-02-25 Thread 1LT John W. Holmes
>From what I can tell, if $img is an empty string, and $file_dir is not a
directory, $sql will not be assigned a value. This could be what's causing
your error when you try to run an empty query.

---John Holmes...

- Original Message -
From: "Richard Whitney" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 3:25 PM
Subject: [PHP] Empty Query


> ### I have this:
> ###
> ### [serial]
> ### [model]
> ### [yr_blt]
> ### [km]
> ### [price]
> ### [hours]
> ### [details]
> ### [location]
> ### double[style]
>
> All of the 1 are the variables being passed, the word is hardcoded for
clarity
>
>
> What I get half the time:   Couldn't insert dataQuery was empty
> ###
> ### The variables are obviously being passed
> ###
> ### Here's my insert query:
> ###
> ### if($img == ""){$sql = "INSERT INTO vehicles ( `id` ,`serial`,
`model` ,
> ### `yr_blt` , `km` , `price` , `hours` , `details` , `location` , `img`,
> ### `tstamp`,
> ### `style`)
> ### VALUES ('', '$serial',
> '$model', '$yr_blt', '$km', '$price',
> ### '$hours',
> ### '$details', '$location', '0', '$tstamp', '$style');";
> ### }
> ### else
> ### {
> ###
> ###
>
$file_dir="/services/webpages/o/f/offroad-imports.com/public/uploads/mogs/$s
erial";
> ### if (!is_dir($file_dir)){
> ### umask(000);
> ### mkdir($file_dir,0777);
> ### }
> ### else{
> ### umask(000);
> ###
> ### $path = $file_dir . "/1.jpg";
> ### move_uploaded_file($img, $path)or die('Could not upload
photo');
> ### $sql = "INSERT INTO vehicles ( `id` ,`serial`,  `model` ,
`yr_blt` ,
> `km`
> ### ,
> ### `price` , `hours` , `details` , `location` , `img`, `tstamp`, `style`)
> ### VALUES ('', '$serial',
> '$model', '$yr_blt', '$km', '$price',
> ### '$hours',
> ### '$details', '$location', '1', '$tstamp', '$style');";
> ### }
> ###
> ### }
>
> Any thoughts? Enlightenment?
>
> Thanks
>
> --
> Richard Whitney   *
> Transcend Development
> Producing the next phase of your internet presence.
> [EMAIL PROTECTED]   *
> http://xend.net*
> 602-971-2791
>   * *   *
> *  *  *__**
>  _/  \___  *
>  *  /   *\**
>   */ * *  \
> **/\_ |\
>  /   \_  /  \
> /  \/\
>/  \
>   /\
>  /  \
>
>
> --
> 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] Auto Incrementing a Variable name?

2003-02-25 Thread Jeff Pauls
Hi,
I've been playing with this for a while now. Say I had the following variables:

$name1 = "joe";
$name2 = "janis";
$name3 = "joanne";

Is there a way in php to increment the variable name not the value? Something like 
this

for ($i = 1; $i <= 3; $i++)  { 
 $arr_name[$i] = $name.$i; // I want $name1,$name2,$name3 etc 
}


This way say if I had 500 database queries that need to be updated I could just loop 
through each and just change the record id.

for ($i = 1; $i <= 500; $i++)  { 

$query_update = "UPDATE table SET name=' $arr_name[$i]',  WHERE person_id='$i";
$result_update = mysql_query($query_update) or die("Query failed");
}

instead of doing something like this:

$query_update1 = "UPDATE table SET name=' $name1',  WHERE person_id='1";
$result_update1 = mysql_query($query_update1) or die("Query failed");

$query_update2 = "UPDATE table SET name=' $name2',  WHERE person_id='2";
$result_update2 = mysql_query($query_update2) or die("Query failed");

$query_update3 = "UPDATE table SET name=' $name3',  WHERE person_id='3";
$result_update3 = mysql_query($query_update3) or die("Query failed");

etc.

Anybody? There has to be a way of doing this...

Thanks,

Jeff

Re: [PHP] Javascript

2003-02-25 Thread Scott St. John
Usually you would have the actual page between the () so it would be:

echo "

-Scott



At 04:10 PM 2/25/2003 -0800, Todd Barr wrote:

I have tried this 3 different ways and none of them worked...

I am trying to get javascript to generate a popup, with a variable passed 
along in the url.

echo"";

this doesn't work, neither does stopping PHP and then restarting...

Blah, any advice on how to embed javascript?



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.456 / Virus Database: 256 - Release Date: 2/18/2003

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

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

[PHP] WE NEED SOME ADVICES: What is the best way for sending a huge amountof emails?

2003-02-25 Thread Jean Fábio Barros
Hi everyone!

We will appreciate some advices. We are new to PHP, thus, please, be
patient! :)
We want to make a script which needs to send a huge amount of emails
(The emails are stored in a MySQL DB). We would like to take control of
sending errors and put these in a log file. The script needs to send
TXT, HTML,images, and even small files. Both the email content and the
settings will be prepared through a HTML interface. We will need a sort
of queue where we would be able to put some "Bad emails" on it in order
to resend them as much times as it was set in the settings (HTML).
So, How is the best way for making that PHP script, considering
security, reliability (Handling email errors) and speed?
Thanks in advance



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


Re: [PHP] Javascript

2003-02-25 Thread 1LT John W. Holmes
Nothing to do with PHP at all but,

Pretty sure you have to tack on the URL variables within the window.open()
function. When you specify the name of the file to open, try putting the
variable there.

---John Holmes...

- Original Message -
From: "Todd Barr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 7:10 PM
Subject: [PHP] Javascript


I have tried this 3 different ways and none of them worked...

I am trying to get javascript to generate a popup, with a variable passed
along in the url.

echo"";

this doesn't work, neither does stopping PHP and then restarting...

Blah, any advice on how to embed javascript?


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



[PHP] NEED AN ADVICES: The best way for sending a huge amount of emails

2003-02-25 Thread Jean Fábio Barros
Hi everyone!

We will appreciate some advices. We are new to PHP, thus, please, be 
patient! :)
We want to make a script which needs to send a huge amount of emails 
(The emails are stored in a MySQL DB). We would like to take control of 
sending errors and put these in a log file. The script needs to send 
TXT, HTML,images, and even small files. Both the email content and the 
settings will be prepared through a HTML interface. We will need a sort 
of queue where we would be able to put some "Bad emails" on it in order 
to resend them as much times as it was set in the settings (HTML).

So, How is the best way for making that PHP script, considering 
security, reliability (Handling email errors) and speed?

Thanks in advance

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


[PHP] Javascript

2003-02-25 Thread Todd Barr
I have tried this 3 different ways and none of them worked...

I am trying to get javascript to generate a popup, with a variable passed along in the 
url.

echo"";

this doesn't work, neither does stopping PHP and then restarting...

Blah, any advice on how to embed javascript?


Re: [PHP] Output Numerical Month as String?

2003-02-25 Thread 1LT John W. Holmes
> http://www.zend.com/manual/function.date.php
> --- CF High <[EMAIL PROTECTED]> wrote:
> > Hey all.
> >
> > Easy question here (can't find the answer in php
> > manual)
> >
> > In Cold Fusion I'm able to format a given numerical
> > month value, say the
> > third month, as #MonthAsString(3)# and it returns
> > "March"
> >
> > What's the equivalent in PHP?
> >
> > Thanks for any ideas..

I know you can use date() and mktime(), but wouldn't it be easier to just
make an array?

$MonthAsString = array (1=>'January',2=>'February',3=>'March',...);

and then just echo $MonthAsString[3] when you need it?

---John Holmes...


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



Re: [PHP] Running system commands

2003-02-25 Thread Chris Hewitt
[EMAIL PROTECTED] wrote:

Before I ask, I have read the documentation but nothing seems to work.

I want to run a system command from behind the scenes (totally secure
area of my server) that creates a directory and changes permissions on it.
i.e. system ("mkdir $path");

Example above uses a value from a form passed to the script and is
assigned from $_POST['path'];
When I run it no directory is created. Ideas??

Does the user that the webserver is running as have permissions to make 
that directory?

HTH
Chris


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


Re: [PHP] Output Numerical Month as String?

2003-02-25 Thread Daniel Guerrier
http://www.zend.com/manual/function.date.php
--- CF High <[EMAIL PROTECTED]> wrote:
> Hey all.
> 
> Easy question here (can't find the answer in php
> manual)
> 
> In Cold Fusion I'm able to format a given numerical
> month value, say the
> third month, as #MonthAsString(3)# and it returns
> "March"
> 
> What's the equivalent in PHP?
> 
> Thanks for any ideas..
> 
> --Noah
> 
> --
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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

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



Re: [PHP] Output Numerical Month as String?

2003-02-25 Thread Noah
Cool.

I'll check it out.

Thanks!

--Noah

- Original Message - 
From: "Dennis Cole" <[EMAIL PROTECTED]>
To: "CF High" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 12:21 PM
Subject: RE: [PHP] Output Numerical Month as String?


> [code]
> 
> date ("F", mktime(0,0,0,6,1,2000));
> 
> [\code]
> 
> Replace 6 with the month number and your on your way
> -Original Message-
> From: CF High [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 5:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Output Numerical Month as String?
> 
> 
> Hey all.
> 
> Easy question here (can't find the answer in php manual)
> 
> In Cold Fusion I'm able to format a given numerical month value, say the
> third month, as #MonthAsString(3)# and it returns "March"
> 
> What's the equivalent in PHP?
> 
> Thanks for any ideas..
> 
> --Noah
> 
> --
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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



Re: [PHP] Submit buttons

2003-02-25 Thread Rick Emery



in the PHP script:

extract($HTTP_POST_VARS);
if( isset($submit1) ) header("location: thispage.php");
else if( isset($submit2) ) header("location: thatpage.php");


- Original Message - 
From: "Rick Emery" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 2:25 PM
Subject: Re: [PHP] Submit buttons


Yes, you can.   Simply give the buttons differnt names:



in the PHP script:
extract($HTTP_POST_VARS);
is( isset($submit1) )
{
}
else if( isset($submit2) )
{
}

- Original Message - 
From: "Greg" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, February 25, 2003 2:11 PM
Subject: [PHP] Submit buttons


Is there any way that I can have a form submit to different pages depending
on the submit button that is pressed?  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



[PHP] Empty Query

2003-02-25 Thread Richard Whitney
### I have this:
###
### [serial]
### [model]
### [yr_blt]
### [km]
### [price]
### [hours]
### [details]
### [location]
### double[style]

All of the 1 are the variables being passed, the word is hardcoded for clarity


What I get half the time:   Couldn't insert dataQuery was empty
###
### The variables are obviously being passed
###
### Here's my insert query:
###
### if($img == ""){$sql = "INSERT INTO vehicles ( `id` ,`serial`,  `model` ,
### `yr_blt` , `km` , `price` , `hours` , `details` , `location` , `img`,
### `tstamp`,
### `style`)
### VALUES ('', '$serial',
'$model', '$yr_blt', '$km', '$price',
### '$hours',
### '$details', '$location', '0', '$tstamp', '$style');";
### }
### else
### {
###
###
$file_dir="/services/webpages/o/f/offroad-imports.com/public/uploads/mogs/$serial";
### if (!is_dir($file_dir)){
### umask(000);
### mkdir($file_dir,0777);
### }
### else{
### umask(000);
###
### $path = $file_dir . "/1.jpg";
### move_uploaded_file($img, $path)or die('Could not upload photo');
### $sql = "INSERT INTO vehicles ( `id` ,`serial`,  `model` , `yr_blt` ,
`km`
### ,
### `price` , `hours` , `details` , `location` , `img`, `tstamp`, `style`)
### VALUES ('', '$serial',
'$model', '$yr_blt', '$km', '$price',
### '$hours',
### '$details', '$location', '1', '$tstamp', '$style');";
### }
###
### } 

Any thoughts? Enlightenment?

Thanks

-- 
Richard Whitney   *
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]   *
http://xend.net*
602-971-2791
  * *   *
*  *  *__**
 _/  \___  *
 *  /   *\**
  */ * *  \
**/\_ |\
 /   \_  /  \
/  \/\
   /  \ 
  /\
 /  \


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



Re: [PHP] Submit buttons

2003-02-25 Thread Rick Emery
Yes, you can.   Simply give the buttons differnt names:



in the PHP script:
extract($HTTP_POST_VARS);
is( isset($submit1) )
{
}
else if( isset($submit2) )
{
}

- Original Message - 
From: "Greg" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, February 25, 2003 2:11 PM
Subject: [PHP] Submit buttons


Is there any way that I can have a form submit to different pages depending
on the submit button that is pressed?  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] Output Numerical Month as String?

2003-02-25 Thread Dennis Cole
[code]

date ("F", mktime(0,0,0,6,1,2000));

[\code]

Replace 6 with the month number and your on your way
-Original Message-
From: CF High [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 5:54 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Output Numerical Month as String?


Hey all.

Easy question here (can't find the answer in php manual)

In Cold Fusion I'm able to format a given numerical month value, say the
third month, as #MonthAsString(3)# and it returns "March"

What's the equivalent in PHP?

Thanks for any ideas..

--Noah

--




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


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



[PHP] Re: Submit buttons

2003-02-25 Thread Greg
I'm horrible at javascript, does anyone have a script that will do this?
Thanks again!!

"Oliver Witt" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greg schrieb:
>
> > Is there any way that I can have a form submit to different pages
depending
> > on the submit button that is pressed?  Thanks!
>
> dont use submit buttons, but buttons... (type="button") calling a script
that
> submits the form to whatever page you want it to.
> Olli
>



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



RE: [PHP] Submit buttons

2003-02-25 Thread Cal Evans
using JavaScript you can use an  and in the onClick call
a function that sets the form's target and then calls
document.formname.submit();

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Greg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 2:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Submit buttons


Is there any way that I can have a form submit to different pages depending
on the submit button that is pressed?  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] Re: Submit buttons

2003-02-25 Thread Oliver Witt
Greg schrieb:

> Is there any way that I can have a form submit to different pages depending
> on the submit button that is pressed?  Thanks!

dont use submit buttons, but buttons... (type="button") calling a script that
submits the form to whatever page you want it to.
Olli


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



[PHP] Submit buttons

2003-02-25 Thread Greg
Is there any way that I can have a form submit to different pages depending
on the submit button that is pressed?  Thanks!



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



[PHP] Output Numerical Month as String?

2003-02-25 Thread CF High
Hey all.

Easy question here (can't find the answer in php manual)

In Cold Fusion I'm able to format a given numerical month value, say the
third month, as #MonthAsString(3)# and it returns "March"

What's the equivalent in PHP?

Thanks for any ideas..

--Noah

--




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



Re: [PHP] line number

2003-02-25 Thread Leif K-Brooks
Use the __LINE__ "magic constant".

Chandler, Jacob R wrote:

What function can I use to find out the current line number?

 

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


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


[PHP] Re: line number

2003-02-25 Thread Justin Garrett
http://www.php.net/manual/en/language.constants.predefined.php

Justin Garrett

"Jacob R Chandler" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
What function can I use to find out the current line number?



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



Re: [PHP] line number

2003-02-25 Thread 1LT John W. Holmes
The constant __LINE__ works well.

---John Holmes...

- Original Message - 
From: "Chandler, Jacob R" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 2:21 PM
Subject: [PHP] line number


What function can I use to find out the current line number?


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



[PHP] Running system commands

2003-02-25 Thread ed

 Before I ask, I have read the documentation but nothing seems to work.

 I want to run a system command from behind the scenes (totally secure
area of my server) that creates a directory and changes permissions on it.

i.e. system ("mkdir $path");

 Example above uses a value from a form passed to the script and is
assigned from $_POST['path'];

 When I run it no directory is created. Ideas??

Thanks,

Ed
 


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



[PHP] simple problem about authentication

2003-02-25 Thread Oliver Witt
Hi,
I'm trying to set up a password section on my website. But I don't want
a window popping up asking for a username and password. I'd rather like
to have a form that submits the data. I did that and it works fine, but
the browser seems to not save the username and password, because if i
click on any link, it returns an "unauthorized message"... any ideas?
thnx,
Olli


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



[PHP] line number

2003-02-25 Thread Chandler, Jacob R
What function can I use to find out the current line number?


[PHP] browscap file problem?

2003-02-25 Thread solex
Hi all
I am trying to use the get_browser() function
It relies on the browscap directive in php.ini to be set to the absolute
path location of the browscap.ini file.

I have no control over the php.ini file as I am on a shared server.
My hosting company have put the browscap.ini file on the server and set the
path to
/etc/browscap.ini

It is not finding it..
Any ideas why not?

solex



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



[PHP] Out of Range

2003-02-25 Thread Todd Barr
here is my code

$Query = "SELECT Last_Login and Current_Login from Security where PM_ID=$_SESSION[ID]";
$Getdates = odbc_do($link, $Query);
while(odbc_fetch_row($Getdates))
 {
$Last=odbc_result($Getdates, 1);
$Now=odbc_result($Getdates, 2);


Now I get an error that tells me that #2 is out of the range

Any suggestions


Re: [PHP] help please

2003-02-25 Thread John Nichel
My guess is that register globals is turned off on your new site.  Or 
maybe, the new site isn't set up to parse php with *.html extensions. 
Being that it's all embedded flash, I can't give you much more than that.

bionicegg wrote:
John,

  Im so sorry about the posting three times, I didnt know how to do it, then
I subscribed after I sent it twice.
  I cant figure out what is wrong with the script.  I do not get an error
message.  Basically, I am suppsed to get an email with the info that the
user entered.  I get the email from http://www.bionicegg.com/html/Mail.html
, but It doesnt work for http://www.nypalet.com/Mail.html .
I do not know jack about PDP, I got the script from www.flashkit.com.

Thanks so much for the response.

Mark J

- Original Message -
From: "John Nichel" <[EMAIL PROTECTED]>
To: "bionicegg" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 1:20 PM
Subject: Re: [PHP] help please


Do you need an answer for each of the times that you posted it?

1)  Posting code is good, however telling us it "doesn't work" is no
good.  What are the error messages, if any?  Why is it not working, ie
what did you expect it to do?
2)  What version of php on the old site as compared to the new site?

3)  Where are your variables coming from?  Like $Firstname and $Email?

4)  Did you look at this
http://www.php.net/manual/en/language.variables.scope.php
http://www.php.net/manual/en/language.variables.external.php
bionicegg wrote:

Hello all,

   I am having problems with a script.  The script works great on one

of my

sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
  Here is the script:


$ToEmail = "[EMAIL PROTECTED]";

$ToSubject = "Flash Contact Form";

$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessage
Sent:\n$ToComments\n";
mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From:

".$FirstName."

<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this)

You

help is greatly appreciated!

Thanks in advance,
mark johnson












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


Re: [PHP] Uploading Images

2003-02-25 Thread Marek Kilimajer
http://www.php.net/manual/en/

sections
18. Handling file uploads
XXX. Filesystem 
functions
XLI. Image functions 


clarionhaze wrote:

Hey guys I need to make a place for people to upload images and then I need to make sure the file size is alright and the pixel size too...  Could someone please send me in the right direction?

-steven
 



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


RE: [PHP] help please

2003-02-25 Thread Van Andel, Robbert
It would be helpful to find out what error messages you are getting when you run the 
script.

if(!mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: 
".$FirstName."<".$Email.">")) die("Unable to send message");
would be a good start. I'm not sure if there is a system error you could replace 
"unable to send message" with.

Robbert van Andel 



-Original Message-
From: bionicegg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 9:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP] help please


Hello all,


I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:

",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!

Thanks in advance,
mark johnson





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

2003-02-25 Thread John Nichel
Do you need an answer for each of the times that you posted it?

1)  Posting code is good, however telling us it "doesn't work" is no 
good.  What are the error messages, if any?  Why is it not working, ie 
what did you expect it to do?

2)  What version of php on the old site as compared to the new site?

3)  Where are your variables coming from?  Like $Firstname and $Email?

4)  Did you look at this
http://www.php.net/manual/en/language.variables.scope.php
http://www.php.net/manual/en/language.variables.external.php
bionicegg wrote:
Hello all,

I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:


$ToEmail = "[EMAIL PROTECTED]";

$ToSubject = "Flash Contact Form";

$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessage
Sent:\n$ToComments\n";
mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");
?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!
Thanks in advance,
mark johnson






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


Re: [PHP] help please

2003-02-25 Thread Chris Hayes


Mark,
you've GOT to give us something to work on. We're not ESP, well, at least I 
am not.

Try debugging a bit. Echo all values just before you do the mail(), see 
whether they really are what you thought they were.

Try a simple script that will only send a mail, take the example from the 
manual (www.php.net/mail)

Try setting the error warning level high for a while, by adding this to the 
file:

   error_reporting (E_ALL);



PS please keep the discussion in the list
At 19:15 25-2-03, you wrote:
Chris,

  Im so sorry about the posting three times, I didnt know how to do it, then
I subscribed after I sent it twice.
  I cant figure out what is wrong with the script.  I do not get an error
message.  Basically, I am suppsed to get an email with the info that the
user entered.  I get the email from http://www.bionicegg.com/html/Mail.html
, but It doesnt work for http://www.nypalet.com/Mail.html .
I do not know jack about PDP, I got the script from www.flashkit.com.

Thanks so much for the response.

Mark J
- Original Message -
From: "Chris Hayes" <[EMAIL PROTECTED]>
To: "bionicegg" <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 1:07 PM
Subject: Re: [PHP] help please
> There is no need to post this thrice.
> Anyway. What went wrong? Did you get an error message? Are both sites on
> the same machine?
>
>
> At 18:40 25-2-03, you wrote:
> >Hello all,
> >
> >
> > I am having problems with a script.  The script works great on one
of my
> >sights, however, when I transferred it to another site, it does not
> >function.  I contacted my hosting company (both sites are on the same
> >server), they told me that I needed to check the script and that it has
> >nothing to do with them, since they ran a  test.php and it worked fine.
> >Here is the script:
> >
> > >
> >$ToEmail = "[EMAIL PROTECTED]";
> >
> >$ToSubject = "Flash Contact Form";
> >
> >$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessage
> >Sent:\n$ToComments\n";
> >
> >mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From:
".$FirstName."
> ><".$Email.">");
> >
> >?>
> >
> >Please if anyone knows anything about this stuff (Im a newbie to this)
You
> >help is greatly appreciated!
> >
> >Thanks in advance,
> >mark johnson
> >
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>


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


[PHP] Re: help please

2003-02-25 Thread R'twick Niceorgaw
Please don't multi post.

How you getting the $ToName $FirstName etc fields ? Are they submitted via a
form? If so, check the register_globals setting on the server where it is
not working. You need to set it on or use $_POST /$_GET variables.

HTH
R'twick
"Bionicegg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello all,
>
>
> I am having problems with a script.  The script works great on one of
my
> sights, however, when I transferred it to another site, it does not
> function.  I contacted my hosting company (both sites are on the same
> server), they told me that I needed to check the script and that it has
> nothing to do with them, since they ran a  test.php and it worked fine.
>Here is the script:
>
> 
> $ToEmail = "[EMAIL PROTECTED]";
>
> $ToSubject = "Flash Contact Form";
>
> $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessage
> Sent:\n$ToComments\n";
>
> mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From:
".$FirstName."
> <".$Email.">");
>
> ?>
>
> Please if anyone knows anything about this stuff (Im a newbie to this) You
> help is greatly appreciated!
>
> Thanks in advance,
> mark johnson
>
>
>
>



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



[PHP] Uploading Images

2003-02-25 Thread clarionhaze
Hey guys I need to make a place for people to upload images and then I need to make 
sure the file size is alright and the pixel size too...  Could someone please send me 
in the right direction?

-steven

Fwd: Re: [PHP] help please

2003-02-25 Thread Chris Hayes


There is no need to post this thrice.
Anyway. What went wrong? Did you get an error message? Are both sites on 
the same machine?

At 18:40 25-2-03, you wrote:
Hello all,

I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:


$ToEmail = "[EMAIL PROTECTED]";

$ToSubject = "Flash Contact Form";

$EmailBody = "Sent By: $FirstName\nSenders Email: $Email\n\nMessage
Sent:\n$ToComments\n";
mail($ToName." <".$ToEmail.">",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");
?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!
Thanks in advance,
mark johnson




--
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] help me please

2003-02-25 Thread Rick Emery
You don't have to break up the strings:
mail("$ToName <$ToEmail>",$ToSubject, $EmailBody, "From: $FirstName <$Email>");

What are values of $ToName and $FirstName?

why did you submit tghis 3 times?
- Original Message - 
From: "bionicegg" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, February 25, 2003 11:38 AM
Subject: [PHP] help me please


Hello all,


I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:

",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!

Thanks in advance,
mark johnson






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

2003-02-25 Thread Pierre Vaudrey
The download address is :

http://www.maguma.com/products/download.php

Pierre

-Message d'origine-
De : James Hatridge [mailto:[EMAIL PROTECTED]
Envoyé : mardi 25 février 2003 15:40
À : Pierre Vaudrey; Karl James; [EMAIL PROTECTED]
Objet : [PHP] Re: Editors

HI Pierre et al

On Sunday 23 February 2003 11:14, Pierre Vaudrey wrote:
> Hi,
>
>   The site is http://www.maguma.com
>
> Pierre

This interested me too. So I looked at the site but was only able to find an
exe file. Do you know where I can get a Linux tar ball or RPM file?

Thanks

JIM




> -Message d'origine-
> De : Karl James [mailto:[EMAIL PROTECTED]
> Envoye : dimanche 23 fevrier 2003 10:19
> A : [EMAIL PROTECTED]
> Objet : [PHP] Editors
>
> Anyone have the link on where I can download maguma php editor? Whatever
> the latest version is.
> I need if for my class.
> I tried to do a search on google and they are were dead links.
>
>
> Karl

--
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


--
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] help please

2003-02-25 Thread bionicegg
Hello all,


I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:

",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!

Thanks in advance,
mark johnson





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



[PHP] help please

2003-02-25 Thread bionicegg
Hello all,


I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:

",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!

Thanks in advance,
mark johnson





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



[PHP] Please help me with this .php file

2003-02-25 Thread bionicegg
Hello all,

I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:

",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!

Thanks in advance,
mark johnson



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



[PHP] help me please

2003-02-25 Thread bionicegg
Hello all,


I am having problems with a script.  The script works great on one of my
sights, however, when I transferred it to another site, it does not
function.  I contacted my hosting company (both sites are on the same
server), they told me that I needed to check the script and that it has
nothing to do with them, since they ran a  test.php and it worked fine.
   Here is the script:

",$ToSubject, $EmailBody, "From: ".$FirstName."
<".$Email.">");

?>

Please if anyone knows anything about this stuff (Im a newbie to this) You
help is greatly appreciated!

Thanks in advance,
mark johnson






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



  1   2   >