[PHP] Re: Can't pass query string from HTML to PHP

2003-06-19 Thread Jan Grafström
Hi Robby,
try to add this line to your php-file:
$name=$_GET['name'] ;
change to:


Good luck!
Jan


"Robby Ku" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Hi,
>
> I've got a problem passing a query string from a HTML file to a PHP file.
I created a HTML file called "welcome.html" with the following link:
>
>Hi, I'm Andy 
>
> I am trying to pass the query string Andy to a PHP file called
"welcome.php" with the following command:
>
>  
>
> After i load "welcome.html" in my browser, i try linking it to
"welcome.php" through the hyperlink i created. But the result i got was
>
>  "Welcome, !"
>
> Where is Andy? If the code has got no problem, could it be the Web server
(IIS) or the browser (IE) im using? Or the configuration of the Web server
is not correct? Pls help!
>
> Thank You
>
> Beginner,
> Robbie
>
>
> -
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!



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



[PHP] How to secure site?

2003-06-19 Thread Andrew Afliatunov
Hello!
I have an Apache web-server with PHP-4.3.2 installed. Directory
structure of my DocRoot is as follows:
www/
docs/
tm/
tts/
cache/
lib/
index.html
docs, tm, tts are directories of projects, published through ftp by
different people,
lib - common directory, containing php-scripts,
cache - common directory, where scripts of all projects must be able to
create temporary files.
I want my projects not to be able to read scripts of each other, BUT use
common dirs.
open_base_dir in each directory of docs, tm, tts seems to be be a good
idea. BUT, in this case projects scripts won't be able to use cache and lib.
Other way - I can turn on safe_mode and include www/lib in
safe_mode_include_dir. In this case projects will be able to include
scripts from lib, BUT won't be able to create files in cache because
scripts and cache have different owners.
So, can you tell me some decision to solve my problem?
--
Andrew


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


RE: [PHP] Can't pass query string from HTML to PHP

2003-06-19 Thread Martin Towell
check your php.ini file to see if you have register_globals set to "on" or
"off" (probably "off")

You can either turn it "on" or use $_GET["name"]

-Original Message-
From: Robby Ku [mailto:[EMAIL PROTECTED]
Sent: Friday, 20 June 2003 4:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can't pass query string from HTML to PHP


Hi,
 
I've got a problem passing a query string from a HTML file to a PHP file. I
created a HTML file called "welcome.html" with the following link:
 
   Hi, I'm Andy 
 
I am trying to pass the query string Andy to a PHP file called "welcome.php"
with the following command:
 
 
 
After i load "welcome.html" in my browser, i try linking it to "welcome.php"
through the hyperlink i created. But the result i got was 
 
 "Welcome, !"
 
Where is Andy? If the code has got no problem, could it be the Web server
(IIS) or the browser (IE) im using? Or the configuration of the Web server
is not correct? Pls help!
 
Thank You
 
Beginner, 
Robbie


-
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
__ Information from NOD32 1.436 (20030612) __

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com




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



[PHP] Can't pass query string from HTML to PHP

2003-06-19 Thread Robby Ku
Hi,
 
I've got a problem passing a query string from a HTML file to a PHP file. I created a 
HTML file called "welcome.html" with the following link:
 
   Hi, I'm Andy 
 
I am trying to pass the query string Andy to a PHP file called "welcome.php" with the 
following command:
 
 
 
After i load "welcome.html" in my browser, i try linking it to "welcome.php" through 
the hyperlink i created. But the result i got was 
 
 "Welcome, !"
 
Where is Andy? If the code has got no problem, could it be the Web server (IIS) or the 
browser (IE) im using? Or the configuration of the Web server is not correct? Pls help!
 
Thank You
 
Beginner, 
Robbie


-
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

[PHP] preg_match

2003-06-19 Thread Aaron Axelsen
Title: preg_match






-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I am trying to code a search, and i need to get my matching
_expression_ to work right.  The user can enter a value swhich is
stored in the vraible $search.

What the below loop needs to do, is search each entry of the array
for any occurance of the $search string.  If i hard code in the
string it works, but not when passed as a varaible.  Is there
something I am missing? Do i need to convert the $search variable to
soetmhing?

    if (preg_match ("/.*?\\\$search.*?/i",$date[$i])) {
    print "$date[$i]";
    }

- ---
Aaron Axelsen
AIM: AAAK2
Email: [EMAIL PROTECTED]

Want reliable web hosting at affordable prices?
www.modevia.com

Web Dev/Design Community/Zine
www.developercube.com



-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBPvKWA7rnDjSLw9ADEQIfGQCgwAO5ikh/RIN5OXoVkC8F4FH/YAoAoJE5
zMxHkRssHbU2Vm4svv2hId8O
=DJOi
-END PGP SIGNATURE-




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

[PHP] Image Border Help

2003-06-19 Thread Nilaab Y.
Hey guys,

I want to know how I can add different border "styles" around an image.
Here's what I do to create an image:

function output_new_img () {

$new = $this->calc_new_size ($this->max_w, $this->max_h);
$new_w = $new[0];
$new_h = $new[1];

$src_img = ImageCreateFromJPEG ($this->temp_img);
$dst_img = ImageCreateTrueColor ($new_w, $new_h);
ImageCopyResampled ($dst_img, $src_img, 0, 0, 0, 0, $new_w, $new_h,
ImageSX($src_img), ImageSY($src_img));

if (ImageJPEG($dst_img, $this->dst_path . $this->img_name, 95)) {
return true;
}
}

Now, what I want to do is draw a border style around that certain image. The
border can be different widths. It can either be created outside the borders
of the image, or on the inside of the borders of the image, I need to have
it both ways. Since this is a .jpg file being created, I want to do this
"while" I'm creating this image before it saves it to file. The reason for
this is that a *.jpg image compresses itself each time it is saved, which
results in poor quality the more you change it and save it.

Now to the question. Which combinations of image functions do I need to
achieve this goal? And how will each of these functions help me. For
example, will a certain function overlap a border style on top of the image
itself? Or does a certain function just draw lines around the image. Just
need an explaination of why I must use a certain function that any of you
would recommend. I think maybe Jason Wong would be a good candidate to
answer this one for me. He's good at pointing out references. I just need a
starting point and some suggestions on the different ways to achieve my
goal.

Thanks guys...


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



RE: [PHP] Multiple Submission of the Same Form

2003-06-19 Thread Miranda, Joel Louie M
Do you have examples?

-Original Message-
From: Mark Tehara [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 20, 2003 11:33 AM
To: Miranda, Joel Louie M
Subject: Re: [PHP] Multiple Submission of the Same Form


Use a Databace and have a DateStamp String and an IP string, then when the
post has happened it cheks for the IP and Time and if its with in the last
minute or something the email won't send ...

/ Mark

- Original Message -
From: "Miranda, Joel Louie M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 3:31 PM
Subject: [PHP] Multiple Submission of the Same Form


> Hello,
>
> Any ideas on this? I have a form some users try and try to reload and 
> it floods my mailbox
>
> Thanks,
> Louie
>
> --
> 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] Multiple Submission of the Same Form

2003-06-19 Thread Leif K-Brooks
Miranda, Joel Louie M wrote:

Hello,

Any ideas on this? I have a form some users try and try to reload and it
floods my mailbox
This is one of the most asked questions, right behind "OMG!  MY 
VARIABLES DONT PASS111".  Search the archives.

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


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


Re: [PHP] Multiple Submission of the Same Form

2003-06-19 Thread John W. Holmes
Miranda, Joel Louie M wrote:
Any ideas on this? I have a form some users try and try to reload and it
floods my mailbox
Restrict them from submitting the form for X seconds?

or

Use a middle-man page that processes your form and then redirects back 
to the form with a clean URL; the refresh will only refresh the form.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





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


[PHP] Multiple Submission of the Same Form

2003-06-19 Thread Miranda, Joel Louie M
Hello,

Any ideas on this? I have a form some users try and try to reload and it
floods my mailbox

Thanks,
Louie

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



Re: [PHP] [Newman] Passing an image through a php file.

2003-06-19 Thread Mark Tehara


This seemed to do the trick for me.  Thank you.

/ Mark

- Original Message -
From: "CPT John W. Holmes" <[EMAIL PROTECTED]>
To: "Awlad Hussain" <[EMAIL PROTECTED]>; "Mark Tehara"
<[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 1:14 AM
Subject: Re: [PHP] [Newman] Passing an image through a php file.


> > try this:
> >  >
> > header("Content-type: image/jpeg");
> > fopen ("d:/crushme/images/1.jpg", "r");
>
> Just my opinion, but maybe you should try reading the file and echoing the
> data instead of just opening it. :)
>
> ---John Holmes...
>
>
> > I would like to pass an image throught
> > http://server/newman/ImageTEST/image.php
> >
> > 1. I need the headers (Assuming)  ?>
> > would make the computer think its a image file.
> > 2. load the image using fopen ("d://crushme//images//1.jpg", "r");
> >
> >
> >  >
> > header("Content-type: image/jpeg");
> > fopen ("d://crushme//images//1.jpg", "r");
> >
> > ?>
> >
> >
> >  The image "http://server/newman/ImageTEST/image.php"; cannot be
displayed,
> > because it contains errors.
> >
> > This returns this error (above)
> >
> > Yes 1. Image is in the right location.
> > Yes 2. I'm stuck.
> >
> > Any Suggestions would be very good.
>
>



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



Re: [PHP] securing a graphic

2003-06-19 Thread Hugh Bothwell
> From: "Ryan Holowaychuk" <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Sent: Friday, June 20, 2003 2:26 AM
> Subject: [PHP] securing a graphic
>> Is there a way in PHP that I can secure a graphic, so that when the page
is
>> loaded it will show the graphic, but is not able to be right clicked on
or
>> downloaded to there desktop.
>>
>> Thanks
>> Ryan
>
>
>"Haseeb Iqbal" <[EMAIL PROTECTED]> wrote in message
news:LAW15->[EMAIL PROTECTED]
> yeah there is a way you have to use some third party tools for that.
> http://www.antssoft.com/htmlprotector/index.htm
> .php can't do this AFAIK


This "security tool" will stop 95% of the general public,
mostly by looking scary.  Anyone who knows what they're
doing will go through it in about 20 seconds.


They work in three steps:

  first, they have a decryption function which is url-encrypted:


function hp_d01(s) {
  var
o="",
ar = new Array(),
os = "",
ic = 0;

  for ( i = 0; i < s.length; i++ ) {// for each char in the
encrypted string
c = s.charCodeAt(i);// get the ascii value

if ( c < 128 )// if 7bit ie all alphanumberics
and punctuation
  c = c^2;// XOR with 0010ie flip
second-lowest bit

os += String.fromCharCode(c);// cast back to char and append
to working string

// this stuff is for working around Javascript's slow string
concatenation:
// work with a temporary string until it gets up to 80
characters long,
// then store it and start a new working string.
if ( os.length > 80 ) {
  ar[ic++] = os;
  os=""
}
  }

// concatenate all the temporary strings to get the final
decrypted string
  o = ar.join("") + os;
  document.write(o)
}



  second, they use their decryptor to expand a block of code
  which tries to lock down the browser to as great an extent
  as possible, encrypted in their custom code.


  third, in the body of the page, they use their decryptor to
  expand the actual body of the page.


Here is the page code with all the decryption/lockdown junk
stripped out:




Sample page protected by HTMLProtector





Sample page protected by HTMLProtector
  


  

  


  It's a sample text paragraph.
It's a sample link.
mailto:[EMAIL PROTECTED]">It's a sample email
link.

  

This page has been protected by HTMLProtector with follow features:

  Protect BODY section
  Make page expire immediately
  Disable Internet Explorer 6 image toolbar
  
  Disable right mouse button
  Disable text select
  Disable off-line viewing
  Don't display links in status bar
  Disable page printing
  Disable clipboard and printscreen
  Disable drag and drop
  Disable adobe acrobat web capture
  
  Kill frame
  Domain lock
  URL lock

Please take a look on what HTMLProtector can do for you!
  





As you are looking specifically for image
protection, notice the line


Try visiting
http://www.antssoft.com/image/sample.gif

Real secure, eh?


The bottom line is, the web page and graphic must
be publically available and decryptable in order for
people to view it in a browser.  If the browser can
decode it, so can just about anyone that knows what
they're doing.

Also note, this scheme adds about 4 1/2 kb to
the size of your page and makes it unusable by
non-Javascript-enabled browsers.  Why bother?

--
Hugh Bothwell [EMAIL PROTECTED] Kingston ON Canada
v3.1 GCS/E/AT d- s+: a- C+++ L++>+++$ P+ E- W+++$ N++ K? w++ M PS+
PE++ Y+ PGP+ t-- 5++ !X R+ tv b DI+++ D-(++) G+ e(++) h-- r- y+




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



[PHP] RE: CRM for website

2003-06-19 Thread YC Nyon
this is slightly off-topic. I run a nonprofit website where people are
invited to contribute articles, papers, etc.
i'm in search of a system where i can manage all this website maintainence
(backups, restarting servers) and on-going correspondence. in some cases,
they ask me to contact them 2 months later, etc. What i don't need is a
content management system.
I need a system to hold all this task together. It doesn't have to be
web-based.
thanks.

Rgds
nyon


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 17/03/2003


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



[PHP] When to escape slashes, and when not to???

2003-06-19 Thread Gerard Samuel
I have a class method that does one thing and one thing only.
Escape characters before going to the DB.
Part of it is ->
if (!get_magic_quotes_gpc())
{
   $string = pg_escape_string( $string );
}
return "'" . $string . "'";

In everyday get/post operation it seems to work flawlessly.
I've come across a situation where Im parsing an XML file to insert into 
the DB.
The content needed to be escaped, so I modified the above to ->
if (!get_magic_quotes_gpc() || !get_magic_quotes_runtime())
{
   $string = pg_escape_string( $string );
}

return "'" . $string . "'";

And the XML data is escaped correctly for DB insertion.

Now going back to my everyday get/post operation, the code is broken 
somehow, as content,
that is not normally escaped is escaped, and breaking stuff, like 
serialized data in the DB.
Is the above code valid for escaping characters in get/post/cookie and 
external data operation?
Can they be safetly used together as in my example above. (Where if one 
condition doesn't meet, and the other does, escape characters).
Or there may be something else in my code that is messing things up.

Any pointers/experience would be greatly appreciated.
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] email pipe -> attachment problem (zip files)

2003-06-19 Thread Duncan
Hi,

I just wrote an script, which scans emails passed to it via a pipe and 
adds the content to a MySQL database.
Attachments are also supported, however, zip files simply don't work. 
They get processed & saved into the database just fine, but once i grab 
such a zip file from the database, it shows up as being empty, whereas 
it still has the same filesize as the file attached to the email.
I checked and the zip file attachment gets base64 encoded, which the 
script supports as well, so i am quite clueless, what could be causing 
the zip file to appear empty.

I only found some similar posts in the net, but none offered a solution.

If anyone knows, what could be the possible problem with those zip 
files, then please let me know :)

Thanks,
Duncan


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


[PHP] safe mode and mail

2003-06-19 Thread Senih Ö.
Hi,

safe mode on and mass mailing wished. I know that it's not possible to set
the time limit, when safe mode is on. Sure mass mailing using mail function
takes longer than default execution time of the script. My codes should be
portable, that why modification of php.ini is not an option. The users
shouldn't be experinced and authorized to do this. In brief, I have to find
a solution without a need to work in shell.
So, due to my theoratical knowledge it seems to be a solution, to queue the
mails to sendmail by using popen. Is it true? Or what could be your
suggestion for this issue.

Thanks in advance,

Senih

---
Outgoing mail is certified Virus Free.
Bu mesaj virüs taramasından geçmiştir.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.489 / Virus Database: 288 - Release Date: 10.06.2003


RE: [PHP] Pre-4.1 / register_globals=off

2003-06-19 Thread Sævar Öfjörð

>From manual on www.php.net:
"Use $HTTP_SESSION_VARS with PHP 4.0.6 or less"

Sævar - ICELAND


-Original Message-
From: Lee Herron QCS [mailto:[EMAIL PROTECTED] 
Sent: 20. júní 2003 00:01
To: [EMAIL PROTECTED]
Subject: [PHP] Pre-4.1 / register_globals=off

If register_globals is turned off, and the php version being used is
pre-4.1
(meaning no $_SESSION array) how do you access sessions values? How do
you
"register" them?



-- 
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] Pre-4.1 / register_globals=off

2003-06-19 Thread Lee Herron QCS
If register_globals is turned off, and the php version being used is pre-4.1
(meaning no $_SESSION array) how do you access sessions values? How do you
"register" them?



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



Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Joseph Szobody
For (2) you could even build an array, object, etc. if you need to store several 
values and use serialize() right before setting the cookie, and unserialize when you 
retrieve the cookie.

Joseph


"Henning Sittler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> 1. Set a big value in seconds for the time argument
> 
> 2. Send 2 cookies 
> OR 
> Create one string value containing the two values you want to save,
> seperated by a a sepcific character of your choice and send this new value
> as your cookie.  Remember to parse the cookie's value when you request it in
> your script, so that you determine the two seperatevalues actually stored
> there.
> 
> 
> Henning Sittler
> www.inscriber.com
> 
> 
> 
> -Original Message-
> From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 19, 2003 4:10 PM
> To: PHP General
> Subject: [PHP] Cookies- peanut butter or chocolate??
> 
> 
> Yes, this question is about PHP cookies.
> 
> Two questions: 
> 1. How do you setup a cookie that will not expire?? 
> 2. How do you put 2 items that you want to save in the cookie and retrieve??
> Examples in the PHP manual only show how to work with a single value.
> 
> Thanks!
> 
> Robin E. Kopetzky
> Black Mesa Computers/Internet Services
> www.blackmesa-isp.net
> 


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



Re: [PHP] strange crypt() problem

2003-06-19 Thread Huzz
Thanks guys for your suggestions ...

"Jeff Harris" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
It looks like "Some operating systems support more than one type of
encryption. In fact, sometimes the standard DES-based encryption is
replaced by an MD5-based encryption algorithm. The encryption type is
triggered by the salt argument. At install time, PHP determines the
capabilities of the crypt function and will accept salts for other
encryption types. If no salt is provided, PHP will auto-generate a
standard two character salt by default, unless the default encryption type
on the system is MD5, in which case a random MD5-compatible salt is
generated. PHP sets a constant named CRYPT_SALT_LENGTH which tells you
whether a regular two character salt applies to your system or the longer
twelve character salt is applicable."

The first server you were using was using DES, this new server is using
MD5. Since hashes are one-way algorithms, you appear to be SOL. However,
you might be able to work something with mcrypt and someone who knows
anything about it.

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

Jeff

On Jun 19, 2003, "Sævar Öfjörð" claimed that:

|
|Well, if you don't find another solution for this, you could generate
|random passwords for each member and mail them to them. Then you would
|md5() them and update the DB with new md5()'ed passwords... This is not
|the easy way out so I hope someone finds out why the crypt() is behaving
|strangely.
|
|Sævar - ICELAND
|
|-Original Message-
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 22:43
|To: [EMAIL PROTECTED]
|Subject: Re: [PHP] strange crypt() problem
|
|I already have about 1000 members their password crypted using crypt();
|would they able to login using their password or they have to change it
|again??
|
|Thanks
|
|
|"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
|news:[EMAIL PROTECTED]
|Try using md5() instead because it is more widely supported than crypt()
|and it leaves no room for errors.
|
|Hope it helps,
|Sævar ICELAND
|
|
|-Original Message-
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 21:43
|To: [EMAIL PROTECTED]
|Subject: [PHP] strange crypt() problem
|
|I have this bit of code to crypt user password in user registration as
|shown
|below.
|
| $cryptpass=crypt($makepass);
|which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0
|
|And am using the codes below to check for valid login..
|// $pass -  from login page
|// $dbpass - from the database
| $pass=crypt($pass,substr($dbpass,0,2));
|}
|if (strcmp($dbpass,$pass)) {
|return(0);
|}
|
|
|Recently i have moved the same file to a new server with php 4.3.1 the
|problem is the same piece of codes above generates completely differen
|crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
|codes above does not work... :(
|
|Please someone tell me that  i am not going mad
|
|please help
|huzz
|
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED




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



RE: [PHP] How to UPDATE only certain fields

2003-06-19 Thread Sævar Öfjörð
The right SQL syntax would be:

UPDATE $table SET type='$type', year='$year' WHERE id='$id';

Sævar - ICELAND



-Original Message-
From: Matt Hedges [mailto:[EMAIL PROTECTED] 
Sent: 19. júní 2003 23:07
To: [EMAIL PROTECTED]
Subject: [PHP] How to UPDATE only certain fields

Hello,

I am building an database of wines.  I have fields of stuff like year,
grape, etc.  However, I want to be able to go in and change something
without having to retype every field.  As I have it right now, I use the
UPDATE where id=$id function.  However, this changes EVERY field. For
example, if I want to only change the grape field and leave everything
else
the same (so I thus leave those fields blank) it overwrites the others
with
a blank field.

Is there anyway to where if it reads a blank field instead of deleting
the
old information, the update php file just leaves it the same?


thanks very much for any help,
Matt Hedges





-- 
___
| Matt Hedges
| http://hedgesinnovations.com
|



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



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



Re: [PHP] How to UPDATE only certain fields

2003-06-19 Thread Thorsten Körner
Hi Matt
Am Freitag, 20. Juni 2003 01:06 schrieb Matt Hedges:
> Hello,
>
> I am building an database of wines.  I have fields of stuff like year,
> grape, etc.  However, I want to be able to go in and change something
> without having to retype every field.  As I have it right now, I use the
> UPDATE where id=$id function.  However, this changes EVERY field. For
> example, if I want to only change the grape field and leave everything else
> the same (so I thus leave those fields blank) it overwrites the others with
> a blank field.
 UPDATE tablename SET grape = 'someNewGrape' WHERE id = '$id'
This updates only the grape-field and leaves everything else as is.

CU
Thorsten
-- 
Thorsten Körner http://www.123tkShop.org

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



[PHP] How to UPDATE only certain fields

2003-06-19 Thread Matt Hedges
Hello,

I am building an database of wines.  I have fields of stuff like year,
grape, etc.  However, I want to be able to go in and change something
without having to retype every field.  As I have it right now, I use the
UPDATE where id=$id function.  However, this changes EVERY field. For
example, if I want to only change the grape field and leave everything else
the same (so I thus leave those fields blank) it overwrites the others with
a blank field.

Is there anyway to where if it reads a blank field instead of deleting the
old information, the update php file just leaves it the same?


thanks very much for any help,
Matt Hedges





-- 
___
| Matt Hedges
| http://hedgesinnovations.com
|



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



RE: [PHP] strange crypt() problem

2003-06-19 Thread Jeff Harris
It looks like "Some operating systems support more than one type of
encryption. In fact, sometimes the standard DES-based encryption is
replaced by an MD5-based encryption algorithm. The encryption type is
triggered by the salt argument. At install time, PHP determines the
capabilities of the crypt function and will accept salts for other
encryption types. If no salt is provided, PHP will auto-generate a
standard two character salt by default, unless the default encryption type
on the system is MD5, in which case a random MD5-compatible salt is
generated. PHP sets a constant named CRYPT_SALT_LENGTH which tells you
whether a regular two character salt applies to your system or the longer
twelve character salt is applicable."

The first server you were using was using DES, this new server is using
MD5. Since hashes are one-way algorithms, you appear to be SOL. However,
you might be able to work something with mcrypt and someone who knows
anything about it.

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

Jeff

On Jun 19, 2003, "Sævar Öfjörð" claimed that:

|
|Well, if you don't find another solution for this, you could generate
|random passwords for each member and mail them to them. Then you would
|md5() them and update the DB with new md5()'ed passwords... This is not
|the easy way out so I hope someone finds out why the crypt() is behaving
|strangely.
|
|Sævar - ICELAND
|
|-Original Message-
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 22:43
|To: [EMAIL PROTECTED]
|Subject: Re: [PHP] strange crypt() problem
|
|I already have about 1000 members their password crypted using crypt();
|would they able to login using their password or they have to change it
|again??
|
|Thanks
|
|
|"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
|news:[EMAIL PROTECTED]
|Try using md5() instead because it is more widely supported than crypt()
|and it leaves no room for errors.
|
|Hope it helps,
|Sævar ICELAND
|
|
|-Original Message-
|From: Huzz [mailto:[EMAIL PROTECTED]
|Sent: 19. júní 2003 21:43
|To: [EMAIL PROTECTED]
|Subject: [PHP] strange crypt() problem
|
|I have this bit of code to crypt user password in user registration as
|shown
|below.
|
| $cryptpass=crypt($makepass);
|which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0
|
|And am using the codes below to check for valid login..
|// $pass -  from login page
|// $dbpass - from the database
| $pass=crypt($pass,substr($dbpass,0,2));
|}
|if (strcmp($dbpass,$pass)) {
|return(0);
|}
|
|
|Recently i have moved the same file to a new server with php 4.3.1 the
|problem is the same piece of codes above generates completely differen
|crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
|codes above does not work... :(
|
|Please someone tell me that  i am not going mad
|
|please help
|huzz
|
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED



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



RE: [PHP] strange crypt() problem

2003-06-19 Thread Sævar Öfjörð

Well, if you don't find another solution for this, you could generate
random passwords for each member and mail them to them. Then you would
md5() them and update the DB with new md5()'ed passwords... This is not
the easy way out so I hope someone finds out why the crypt() is behaving
strangely.

Sævar - ICELAND

-Original Message-
From: Huzz [mailto:[EMAIL PROTECTED] 
Sent: 19. júní 2003 22:43
To: [EMAIL PROTECTED]
Subject: Re: [PHP] strange crypt() problem 

I already have about 1000 members their password crypted using crypt();
would they able to login using their password or they have to change it
again??

Thanks


"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Try using md5() instead because it is more widely supported than crypt()
and it leaves no room for errors.

Hope it helps,
Sævar ICELAND


-Original Message-
From: Huzz [mailto:[EMAIL PROTECTED]
Sent: 19. júní 2003 21:43
To: [EMAIL PROTECTED]
Subject: [PHP] strange crypt() problem

I have this bit of code to crypt user password in user registration as
shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
 $pass=crypt($pass,substr($dbpass,0,2));
}
if (strcmp($dbpass,$pass)) {
return(0);
}


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad

please help
huzz




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




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



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



Re: [PHP] explode, split, or what?

2003-06-19 Thread Steve Keller
At 6/19/2003 10:41 PM, Kyle Babich wrote:

> Inside of another file I'm trying to read setup.txt into $rawSetupData 
and explode that with \r\n's
> into an array called $setupData.

Why on earth?

http://us4.php.net/file

> 
> if (file_exists("setup.txt")) {
>$rawSetupData = readfile("setup.txt");
>$setupData = explode("\r\n", $rawSetupData);
>echo $setupData[0];
> }
> else echo "Error opening \"setup.txt\"";
>
> ?>
No no nonono


--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] explode, split, or what?

2003-06-19 Thread Sævar Öfjörð


why don't you just do this?

***

***

file() returns the file in an array, each line as new value, so line nr.
1 is $line[0], line nr. 2 is $line[1] etc...
I added stripslashes() on the output so that you won't get "John\'s X
Log"


Sævar - ICELAND


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



Re: [PHP] strange crypt() problem

2003-06-19 Thread Huzz
I already have about 1000 members their password crypted using crypt();
would they able to login using their password or they have to change it
again??

Thanks


"SævË Ölêöyp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Try using md5() instead because it is more widely supported than crypt()
and it leaves no room for errors.

Hope it helps,
Sævar ICELAND


-Original Message-
From: Huzz [mailto:[EMAIL PROTECTED]
Sent: 19. júní 2003 21:43
To: [EMAIL PROTECTED]
Subject: [PHP] strange crypt() problem

I have this bit of code to crypt user password in user registration as
shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
 $pass=crypt($pass,substr($dbpass,0,2));
}
if (strcmp($dbpass,$pass)) {
return(0);
}


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad

please help
huzz




-- 
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] explode, split, or what?

2003-06-19 Thread Kyle Babich
Thank you to those of you who helped me with my last problem earlier today.

Now I have a text file (setup.txt) that has a series of values all seperated by 
\r\n's.  Inside of another file I'm trying to read setup.txt into $rawSetupData and 
explode that with \r\n's into an array called $setupData.  My problem is that the 
explode function doesn't seem to be doing anything, and neither is split which I tried 
also.  Here is my code:

setup.txt
***
John\'s X Log
10
5
example.com
treeclimber56
ab3c45def
***

test.php
***

***

Actual results of running test.php
***
John\'s X Log 10 5 example.com treeclimber56 ab3c45def 61
***

Desired reults of running test.php
***
John's X Log
***

Other problem:
In the actual results of running test.php where is the 61 coming from?

Thank you,
--
Kyle

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



Re: [PHP] securing a graphic

2003-06-19 Thread Steve Keller
At 6/20/2003 02:33 AM, Haseeb Iqbal wrote:

> yeah there is a way

No there is not a way. The way the web works is by sending your content to 
someone else' computer. Once it's there, they have a copy, whether it's in 
their cache or actually saved as a file. There's no way to prevent a 
determined user from stealing your images, trust me on this one, a good 
number of my photoshops are being sent around as anonymous "funny" emails.

You can disable right-clicking with javascript, but this is pointless. In 
IE, the user can just drag your image up to the address bar and poof, your 
javascript is gone. And on browsers that can't do that, there's still the 
cache. Even if, by some scripting voodoo you manage to keep your images 
from ending up in the cache, what's the keep the user from just doing a 
screen capture?
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

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


RE: [PHP] strange crypt() problem

2003-06-19 Thread Sævar Öfjörð
Try using md5() instead because it is more widely supported than crypt()
and it leaves no room for errors.

Hope it helps,
Sævar ICELAND


-Original Message-
From: Huzz [mailto:[EMAIL PROTECTED] 
Sent: 19. júní 2003 21:43
To: [EMAIL PROTECTED]
Subject: [PHP] strange crypt() problem 

I have this bit of code to crypt user password in user registration as
shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
 $pass=crypt($pass,substr($dbpass,0,2));
}
if (strcmp($dbpass,$pass)) {
return(0);
}


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad

please help
huzz




-- 
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] strange crypt() problem

2003-06-19 Thread Huzz
I have this bit of code to crypt user password in user registration as shown
below.

 $cryptpass=crypt($makepass);
which generated crypted password like eg 37Q9fppLHc4fQ with php 4.0

And am using the codes below to check for valid login..
// $pass -  from login page
// $dbpass - from the database
 $pass=crypt($pass,substr($dbpass,0,2));
}
if (strcmp($dbpass,$pass)) {
return(0);
}


Recently i have moved the same file to a new server with php 4.3.1 the
problem is the same piece of codes above generates completely differen
crypted  value eg.$1$RjZHv7qx$h/L9ZUNT48rilHB6fGoMP/  .. hence the login
codes above does not work... :(

Please someone tell me that  i am not going mad

please help
huzz




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



[PHP] Problem while retrieving data from cookie with unserialize

2003-06-19 Thread Sævar Öfjörð
Hi, I’m having this problem:

I set a cookie using this:

$sql = "UPDATE member SET cookie=$cookie WHERE
".
  "id = $this->id";
$this->mysql->query($sql);
$cookie =
urlencode(serialize(array($_SESSION['username'], $cookie)));
setcookie('auth', $cookie, time() + 31104000,
'/', 'www.reddast.is');

And then when I check the cookie using this:

list($username, $cookie) =
@unserialize(urldecode($cookie));


using this query:

"SELECT * FROM member WHERE (username = $username) AND
(cookie = $cookie)";

it looks like this when I debug the script and see the actual query that
is sent to Mysql:

"SELECT * FROM member WHERE (username = 'ofjord') AND
(cookie = '\'86aa5f7e6469efe09a17089957f59b0f\'')";


I hope someone has any answers on this.

Best regards,
Sævar Öfjörð Magnússon
[EMAIL PROTECTED]
ICELAND


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



Re: [PHP] securing a graphic

2003-06-19 Thread Haseeb Iqbal
yeah there is a way you have to use some third party tools for that.
http://www.antssoft.com/htmlprotector/index.htm
.php can't do this AFAIK
- Original Message -
From: "Ryan Holowaychuk" <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Sent: Friday, June 20, 2003 2:26 AM
Subject: [PHP] securing a graphic


> Is there a way in PHP that I can secure a graphic, so that when the page
is
> loaded it will show the graphic, but is not able to be right clicked on or
> downloaded to there desktop.
>
> Thanks
> Ryan
>
>
>
> --
> 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] securing a graphic

2003-06-19 Thread Ryan Holowaychuk
Is there a way in PHP that I can secure a graphic, so that when the page is
loaded it will show the graphic, but is not able to be right clicked on or
downloaded to there desktop.

Thanks
Ryan



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



Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Steve Keller
At 6/19/2003 02:10 PM, Sparky Kopetzky wrote:

> 2. How do you put 2 items that you want to save in the cookie and 
retrieve??

Smuch 'em together into a single variable with a delimiter you're sure 
won't show up in either value, something like "#@@#", between them. Then, 
when you read the cookie value in, just explode it by your delimiter.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Milan Reznicek
Hi,

this is an extract from setcookie documentation - how to handle a cookie
array.

Is this what you were looking for??



You may also set array cookies by using array notation in the cookie name.
This has the effect of setting as many cookies as you have array elements,
but when the cookie is received by your script, the values are all placed in
an array with the cookie's name:


setcookie ("cookie[three]", "cookiethree");
setcookie ("cookie[two]", "cookietwo");
setcookie ("cookie[one]", "cookieone");
if (isset ($cookie)) {
while (list ($name, $value) = each ($cookie)) {
echo "$name == $value\n";
}
}

- Original Message -
From: "Sparky Kopetzky" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 10:10 PM
Subject: [PHP] Cookies- peanut butter or chocolate??


Yes, this question is about PHP cookies.

Two questions:
1. How do you setup a cookie that will not expire??
2. How do you put 2 items that you want to save in the cookie and retrieve??
Examples in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net




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



RE: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Dan Joseph
Hi,

> > 1. How do you setup a cookie that will not expire??
>
> You can't

 however you could just set the year into the distance future a few
years.

-Dan Joseph


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



Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread CPT John W. Holmes
> 1. How do you setup a cookie that will not expire?? 

You can't. 

> 2. How do you put 2 items that you want to save in 
> the cookie and retrieve?? Examples in the PHP manual 
> only show how to work with a single value.

You can't. Use an array or two cookies. 

---John Holmes...

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



Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Brent Baisley
Both.
1. If you don't specify an expiration date, it's good for the session. 
Usually this means until the exit the browser. Otherwise you must set a 
date far into the future.
2. You can name cookies, thus storing multiple values in multiple 
cookies. Or you can store multiple values in one cookie by using your 
own delimiter. A nice PHP function to look at is serialize() and 
unserialize(), which would allow you to store an array in a single 
cookie.

Keep in mind cookie are limited to 4K. Not that you would even want to 
store that much on the client side.

On Thursday, June 19, 2003, at 04:10 PM, Sparky Kopetzky wrote:

Yes, this question is about PHP cookies.

Two questions:
1. How do you setup a cookie that will not expire??
2. How do you put 2 items that you want to save in the cookie and 
retrieve?? Examples in the PHP manual only show how to work with a 
single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Henning Sittler
1. Set a big value in seconds for the time argument

2. Send 2 cookies 
OR 
Create one string value containing the two values you want to save,
seperated by a a sepcific character of your choice and send this new value
as your cookie.  Remember to parse the cookie's value when you request it in
your script, so that you determine the two seperatevalues actually stored
there.


Henning Sittler
www.inscriber.com



-Original Message-
From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 4:10 PM
To: PHP General
Subject: [PHP] Cookies- peanut butter or chocolate??


Yes, this question is about PHP cookies.

Two questions: 
1. How do you setup a cookie that will not expire?? 
2. How do you put 2 items that you want to save in the cookie and retrieve??
Examples in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net


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



Re: [PHP] Month loop

2003-06-19 Thread Tyler Lane

On Thu, 2003-06-19 at 12:57, drparker wrote:
> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?
-- 
Tyler Lane <[EMAIL PROTECTED]>


signature.asc
Description: This is a digitally signed message part


[PHP] Re: exec() and passthru()

2003-06-19 Thread Mignon Hunter
Thanks everybody

system() worked in this case, but safe mode off, had to switch machines
but at least i got something.

The below produced my output:
system('/var/www/html/vertex/a.out');



-
not is more easy use system ?
$output = system('/path/to/a.out');

--
--
Alberto Ferrer
[EMAIL PROTECTED]
  http://www.barrahome.org


On Thu, 2003-06-19 at 13:55, Mignon Hunter wrote:
> Still no out put here's my script test.php:
> $output = shell_exec("/var/www/htdocs/vertex_test/a.out"); 
>   echo $output;
> 
> 
> tried "" and ''.  Both test.php and a.out are in same directory and both
> have 777 perms.
> 
> also tried $output = shell_exec("./a.out");
> 
> 
> 
> *
> In that case what you want is shell_exec():
> 
>   $output = shell_exec('/path/to/a.out'); // note the whole command line has
>   // to be enclosed in '' or "".
>   echo $output;
> 
> 
> 
> On Thu, 2003-06-19 at 12:56, Mignon Hunter wrote:
> > Jason,
> > 
> > I'm only subscribed to digest and found your reply in archives and
> > couldnt figure out how to reply  :{
> > 
> > Anyway, right now I'm just trying to get something to work.  The c exe
> > is as follows:
> > **
> > #include 
> > #define NAME "Mignon"
> > int main(void)
> > {
> > 
> >   int q;
> > 
> >   q = 5;
> >   printf("Hello, %s,%d \n", NAME,q);
> >   return 0;
> > }
> > *
> > 
> > I'm trying to return the "Hello, Mignon, 5" which is what's outputted on
> > the command line.
> > 
> > After I get this to work, I'll be needing it to execute a complex
> > function in c, and bring variables back to my php shopping cart.
> > 
> > Here's my test.php:
> >  > error_reporting (E_ALL);
> > error_reporting  (E_ERROR | E_WARNING | E_PARSE);
> > 
> > echo "Here it comes:";
> > 
> > /*$var1 = exec(a.out);
> > echo $var1;//produces:Here it comes:
> > //tried "a.out"'a.out'"./a.out"'./a.out'
> > //./a.out
> > */
> > //***
> > 
> > /*$var = passthru(a.out, $ret);
> > echo $var;//produces:(nothing)
> > echo $ret;//produces: 127
> > */
> > //**
> > 
> > /*$var2 = system(a.out);
> > echo $var2; //produces:(nothing)
> > */
> > //**
> > 
> > /*$var6 = "./a.out";
> > $var7 = exec($var6, $var_array[], $ret_var);
> > echo $var7;//produces:(nothing)
> > echo $var_array[];//produces:Array
> > echo $ret_var;//produces:127
> > echo $var6;//produces:(nothing)
> > */
> > 
> > //***
> > 
> > /*$var3 = exec(`/var/www/htdocs/vertex_test/a.out`, $var_array[],
> > $ret_var);
> > echo $var3;//produces:Here it comes
> > echo $ret_var;
> > echo $var_array[0];
> > */
> > //
> > 
> > passthru("/var/www/htdocs/vertex_test/a.out", $res);
> > echo $res;
> > 
> > ?>
-- 
Mignon Hunter
Web Master and Developer
Toshiba International
713.466.0277 x 3461


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



Re: [PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 21:13,
lines prefixed by '>' were originally written by you.
> Yes, this question is about PHP cookies.
> Two questions:
> 1. How do you setup a cookie that will not expire??

You can't, but you can use an expiry date in the distant future.

> 2. How do you put 2 items that you want to save in the cookie and
> retrieve??

Have two seperate cookies, one for each value.

All the best,

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



[PHP] Cookies- peanut butter or chocolate??

2003-06-19 Thread Sparky Kopetzky
Yes, this question is about PHP cookies.

Two questions: 
1. How do you setup a cookie that will not expire?? 
2. How do you put 2 items that you want to save in the cookie and retrieve?? Examples 
in the PHP manual only show how to work with a single value.

Thanks!

Robin E. Kopetzky
Black Mesa Computers/Internet Services
www.blackmesa-isp.net



Re: [PHP] header(); Issue

2003-06-19 Thread Chris Shiflett
--- SpyProductions Support Team <[EMAIL PROTECTED]> wrote:
> 
> I have this in a script:
> 
> header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");

A good way to make sure you are sending the header you think you are is to use
echo instead of header() for a quick debugging run. For example:

echo "Location: $Relative/outstanding.php?pdd=1&pddid=$poid";

If the resulting URL is something you can paste into your browser to arrive at
the right place, then your Location header is properly formatted.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] OOT Payflow Urgent

2003-06-19 Thread Haseeb Iqbal
hi all,
i am using curl to post data to the payflow link server.
now here are the questions that i want to ask.
here is the server stats
Linux+ php + mysql + curl + ssl
1) now i want to know if curl is safe to use?
i know about the payflow sdk but i also know that i can execute the sdk by
exec call and if anyone is loged on the computer at the time of the
transection he/she can view all the data passed to the sdk by simply one
command.(i.e. ps.). as

also don't want to show the user any page from verisign. but when i send the
data i get back html output. i want some kind of error codes.how can i
achieve this. know there must some way around this problem.
i want to collect all the information on my page send the data to the
payflow link without leaving my site the get back the result from the
transection and show the result to the user.

thanx in advance
Haseeb




Re: [PHP] Month loop

2003-06-19 Thread drparker
that's what I'm looking for - thanks.

David Nicholson wrote:

> Hello,
>
> This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 20:58,
> lines prefixed by '>' were originally written by you.
>
> > Is there any way I could loop thru and print all the month names (i.e.
> > January, February)?
>
> for($i=1;$i<13;$i++){
> echo date("F",mktime(0,0,0,$i,1,1));
> }
>
> For more info:
> http://uk.php.net/manual/en/function.mktime.php
> http://uk.php.net/date
>
> HTH
>
> David.
>
> --
> phpmachine :: The quick and easy to use service providing you with
> professionally developed PHP scripts :: http://www.phpmachine.com/
>
>   Professional Web Development by David Nicholson
> http://www.djnicholson.com/
>
> QuizSender.com - How well do your friends actually know you?
>  http://www.quizsender.com/
> (developed entirely in PHP)


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



RE: [PHP] Month loop

2003-06-19 Thread Dan Joseph
Hi,

> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?

I suppose you could do something like:

for ($i = 1; $1 >= 12; $i++) {
echo date("F", mktime(0, 0, 0, $i, 1, 2003)) . "";
}

Unless you just want to manually create an array with the month's names in
it.

-Dan Joseph


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



Re: [PHP] Month loop

2003-06-19 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Thu, 19 Jun 2003 at 20:58,
lines prefixed by '>' were originally written by you.

> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?

for($i=1;$i<13;$i++){
echo date("F",mktime(0,0,0,$i,1,1));
}

For more info:
http://uk.php.net/manual/en/function.mktime.php
http://uk.php.net/date

HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



[PHP] SNMP v2

2003-06-19 Thread Russell Handorf
i'm having a heck of a time getting snmpv2 to work with php. does anyone else
have it working yet?

i'm on rh 7.3 with apache v 1.3.23-14 and php v 4.1.2-7.3.6 on a test system
not on the internet.

what i'm trying to accomplish is a mib walk with php on a device that only
supports snmpv2.

here is the code i'm currently using:

";
}
?>

works great on snmpv1 devices- but snmpv2 returns this:
Warning: snmpwalk() [function.snmpwalk]: No response from 10.10.1.1
in /home/httpd/html/snmp.php on line 2

r

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



Re: [PHP] Month loop

2003-06-19 Thread CPT John W. Holmes
> Is there any way I could loop thru and print all the month names (i.e.
> January, February)?

Just make an array and loop through the array. You know the rest of the
names, right? :)

---John Holmes...


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



[PHP] Month loop

2003-06-19 Thread drparker
Is there any way I could loop thru and print all the month names (i.e.
January, February)?


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



Re: [PHP] Convert KB to MB?

2003-06-19 Thread Brent Baisley
Ahhh, but then marketing gets involved and changes the 1024 to 1000 and 
ta da, you now have more MegaBytes. 1024 is the right number to use, 
but don't be surprised if it doesn't match with some numbers you might 
compare it to.

On Thursday, June 19, 2003, at 02:45 PM, Mike Migurski wrote:

Is there a simple script that will take a value in Kilobytes and 
convert
it to MegaBytes?
$value_in_mb = $value_in_kb / 1024;

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: exec() and passthru()

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 02:55, Mignon Hunter wrote:
> Still no out put here's my script test.php:
> $output = shell_exec("/var/www/htdocs/vertex_test/a.out");
>   echo $output;
>
>
> tried "" and ''.  Both test.php and a.out are in same directory and both
> have 777 perms.

OK, it *ought* to work. Possibilities as to why it's not working:

- Your program is not outputting to STDOUT or otherwise not working correctly. 
Try shell_exec('/bin/date') or something similar.

- You've got some safe-mode restrictions enabled and haven't been checking 
your error log.

-- 
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
--
/*
Q:  How many lawyers does it take to change a light bulb?
A:  One.  Only it's his light bulb when he's done.
*/


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



[PHP] Migrating pre-4.1 code to a post-4.1 server with register_globals on

2003-06-19 Thread Johnson, Kirk
A heads-up to those who are moving old code with register_globals "on" to a
server with a newer PHP version and register_globals still "on":

In the old days, the rule was simple. For a session variable, whatever value
was in the global variable at the end of the script was what was saved to
the session, and that value was restored on the next page.

Under a newer version of PHP, e.g., 4.3.2, this is no longer true in one
case. Assume we have a session variable, 'a', that has been assigned some
value:

$a = 'someValue';
session_register('a');
 
Then 

unset($a);

will unset the global variable, $a, but NOT the corresponding element in the
two session arrays, $HTTP_SESSION_VARS and $_SESSION.

The result is that ** $a will be restored with its original value ** on the
next page, which is definitely different behavior than that for the same
code under older versions of PHP.

Or did I screw up my tests somehow? ;)

Kirk

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



[PHP] PHP processing for .html files

2003-06-19 Thread Joshua Chapman
I was wondering if there was a way to stick PHP code into html docs and have it 
processed only in certain web folders.
I'm running a Windows 2000 server... IIS with the CGI version of PHP 4.3.
not very server savvy so I'm not really sure how to make it work.

Re: [PHP] Why Fatal Error ?

2003-06-19 Thread Leif K-Brooks
Tony Arcucci wrote:

Why this error ( Linux Redhat 8.0, PHP 4.2.2):

 Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 1048576 bytes) in /var/www/html/xpai/xmail.class on line 71
 Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 131 bytes) in Unknown on line 0
In PHP.INI memory_limit id 60M.



 

I've had this error caused by PHPA before.  Are you using it?

--
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: file downloading

2003-06-19 Thread Bobby Patel
create a script getFile.php

when this is called first update the database, then  using header you can
stipulate what type of document it is and it will prompt for download
for example  for a Word document


Notes:
make sure you don't echo anything before the headers even suppress any
errors that may come from query
you can call the script through the web page as follows
 Click here to download the document 


"Mark Roberts" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I need to provide a way for users to download data files from a web site.

I know that I could have then right click and save-as, however, I need to
record this action in a database. If they just right click, I don't have any
way to trigger the script to record the transaction.

Does some one have a good way to do this, or at least give me some ideas?
Thanks.

Mark Roberts
Sr. Systems Analyst







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



Re: [PHP] Re: two php installations

2003-06-19 Thread Terje Torkelsen
ok.. thanx

ive looked at it a little, and havent tested this yet as my server "broke" 
down recently. but i thought this might work:

the php4 and php5 modules have different modules name, if i dont remember 
totaly wrong, so writing 

LoadModule php4_module modules/libphp4.so
LoadModule php5_module modules/libphp5.so

should work. Then by changing the mime type of php5 to 
"application/x-httpd-php5" ( in the main/php.h file at line 228 this is 
defined ) on can add to different virtualhost with different mime types:


  DocumentRoot /var/www/html
  ServerName www.domain.com
  AddType application/x-httpd-php .php  #php4



  DocumentRoot /var/www/html
  ServerName www.domain.com
  AddType application/x-httpd-php5 .php  #php5


but then again i havent tested this, its just a thought i was gonna try as 
soon as i get my server online again...

Terje


On Tue, 17 Jun 2003 3:23:08 +0200, Dvdmandt wrote
(in message <[EMAIL PROTECTED]>):

> Hehe, ok... I can't even count the number of servers I use at different
> ports... But I prefer to use the one on port 80...
> // DvDmanDT
> 
> <[EMAIL PROTECTED]> skrev i meddelandet
> news:[EMAIL PROTECTED]
>> hmm to spare the pain i run another instance of apache on a different
>> port , one runs php4.3 one runs php5 :D
>>> If you bug the PHP team some, they might rename the PHP5 module so you
>>> can use both... I have PHP3, 4 and 5 (can someone please give me a
>>> working binary PHP1 and PHP2 for windows? PLEASE!!!) installed and
>>> working on the same server... Simply use the CGI version... But server
>>> gets slower and slower on every request (well, maybe not _every_
>>> request but)...
>>> 
>>> // DvDmanDT
>>> "Terje Torkelsen" <[EMAIL PROTECTED]> skrev i meddelandet
>>> news:[EMAIL PROTECTED]
 is there a way to install two phps on one apache server? want a stable
>>> php4
 on my production site and a php5-dev to test on.. just use different
 virtualhosts, like php5.domain.com for the one with php5 installed.
 looked
>>> in
 the apache docs, seems like LoadModule cant be used inside
 ,
>>> its
 a global var.
 
 thanx
 
>>> 
>>> 
>>> 
>>> --
>>> 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: error handling

2003-06-19 Thread CPT John W. Holmes
> I looked in the manual (twice now).  I want to keep logging to the log
> file but print to browser on this one script.
>
> I have in my script:
> error_reporting (E_ALL);
> error_reporting  (E_ERROR | E_WARNING | E_PARSE);
>
> but they're still only being logged to file.  I dont have access to
> php.ini.

Is display_errors enabled? You should be able to set either of these options
with ini_set().

If it's either log or display and you can't have both, then implement your
own error handler for the page, log the error, then display it also.

---John Holmes...


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



[PHP] Re: exec() and passthru()

2003-06-19 Thread Mignon Hunter
Still no out put here's my script test.php:
$output = shell_exec("/var/www/htdocs/vertex_test/a.out"); 
  echo $output;


tried "" and ''.  Both test.php and a.out are in same directory and both
have 777 perms.

also tried $output = shell_exec("./a.out");



*
In that case what you want is shell_exec():

  $output = shell_exec('/path/to/a.out'); // note the whole command line has
  // to be enclosed in '' or "".
  echo $output;



On Thu, 2003-06-19 at 12:56, Mignon Hunter wrote:
> Jason,
> 
> I'm only subscribed to digest and found your reply in archives and
> couldnt figure out how to reply  :{
> 
> Anyway, right now I'm just trying to get something to work.  The c exe
> is as follows:
> **
> #include 
> #define NAME "Mignon"
> int main(void)
> {
> 
>   int q;
> 
>   q = 5;
>   printf("Hello, %s,%d \n", NAME,q);
>   return 0;
> }
> *
> 
> I'm trying to return the "Hello, Mignon, 5" which is what's outputted on
> the command line.
> 
> After I get this to work, I'll be needing it to execute a complex
> function in c, and bring variables back to my php shopping cart.
> 
> Here's my test.php:
>  error_reporting (E_ALL);
> error_reporting  (E_ERROR | E_WARNING | E_PARSE);
> 
> echo "Here it comes:";
> 
> /*$var1 = exec(a.out);
> echo $var1;//produces:Here it comes:
> //tried "a.out"'a.out'"./a.out"'./a.out'
> //./a.out
> */
> //***
> 
> /*$var = passthru(a.out, $ret);
> echo $var;//produces:(nothing)
> echo $ret;//produces: 127
> */
> //**
> 
> /*$var2 = system(a.out);
> echo $var2; //produces:(nothing)
> */
> //**
> 
> /*$var6 = "./a.out";
> $var7 = exec($var6, $var_array[], $ret_var);
> echo $var7;//produces:(nothing)
> echo $var_array[];//produces:Array
> echo $ret_var;//produces:127
> echo $var6;//produces:(nothing)
> */
> 
> //***
> 
> /*$var3 = exec(`/var/www/htdocs/vertex_test/a.out`, $var_array[],
> $ret_var);
> echo $var3;//produces:Here it comes
> echo $ret_var;
> echo $var_array[0];
> */
> //
> 
> passthru("/var/www/htdocs/vertex_test/a.out", $res);
> echo $res;
> 
> ?>
-- 
Mignon Hunter
Web Master and Developer
Toshiba International
713.466.0277 x 3461


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



Re: [PHP] exec() and passthru()

2003-06-19 Thread Alberto Ferrer
not is more easy use system ?
$output = system('/path/to/a.out');

--
--
Alberto Ferrer
[EMAIL PROTECTED]
  http://www.barrahome.org
--
Syntax Error in KITCHEN.H: COFFEE not found.
"Jason Wong" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> On Friday 20 June 2003 01:56, Mignon Hunter wrote:
>
> > I'm only subscribed to digest and found your reply in archives and
> > couldnt figure out how to reply  :{
> >
> > Anyway, right now I'm just trying to get something to work.  The c exe
> > is as follows:
> > **
> > #include 
> > #define NAME "Mignon"
> > int main(void)
> > {
> >
> >   int q;
> >
> >   q = 5;
> >   printf("Hello, %s,%d \n", NAME,q);
> >   return 0;
> > }
> > *
> >
> > I'm trying to return the "Hello, Mignon, 5" which is what's outputted on
> > the command line.
>
> In that case what you want is shell_exec():
>
>   $output = shell_exec('/path/to/a.out'); // note the whole command line
has
>   // to be enclosed in '' or "".
>   echo $output;
>
> --
> 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
> --
> /*
> Taxes are going up so fast, the government is likely to price itself
> out of the market.
> */
>



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



[PHP] Re: error handling

2003-06-19 Thread Mignon Hunter
I looked in the manual (twice now).  I want to keep logging to the log
file but print to browser on this one script.

I have in my script:
error_reporting (E_ALL);
error_reporting  (E_ERROR | E_WARNING | E_PARSE);

but they're still only being logged to file.  I dont have access to
php.ini.


Yes, manual > Error Handling and Logging Functions

On Friday 20 June 2003 02:11, Mignon Hunter wrote:
> On my dev server the php.ini is set to log all errors and notices.
>
> Isnt there a way to over ride this on a per script basis to output to
> stdout (or my browser) ?




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



Re: [PHP] Convert KB to MB?

2003-06-19 Thread Mike Migurski
>Is there a simple script that will take a value in Kilobytes and convert
>it to MegaBytes?

$value_in_mb = $value_in_kb / 1024;

ta da

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


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



[PHP] Convert KB to MB?

2003-06-19 Thread MIKE YRABEDRA


Is there a simple script that will take a value in Kilobytes and convert it
to MegaBytes?



++
Mike Yrabedra (President)
323 Incorporated 
Home of MacDock, MacAgent and MacSurfshop
++
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: [EMAIL PROTECTED]
I: ichatmacdock
++
"Whatever you do, work at it with all your heart,
as working for the Lord, not for men."
~Colossians 3:23 <{{{><
++



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



Re: [PHP] exec() and passthru()

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 01:56, Mignon Hunter wrote:

> I'm only subscribed to digest and found your reply in archives and
> couldnt figure out how to reply  :{
>
> Anyway, right now I'm just trying to get something to work.  The c exe
> is as follows:
> **
> #include 
> #define NAME "Mignon"
> int main(void)
> {
>
>   int q;
>
>   q = 5;
>   printf("Hello, %s,%d \n", NAME,q);
>   return 0;
> }
> *
>
> I'm trying to return the "Hello, Mignon, 5" which is what's outputted on
> the command line.

In that case what you want is shell_exec():

  $output = shell_exec('/path/to/a.out'); // note the whole command line has
  // to be enclosed in '' or "".
  echo $output;

-- 
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
--
/*
Taxes are going up so fast, the government is likely to price itself
out of the market.
*/


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



[PHP] PHP header and odbc struggle with MS-SQL 2003...

2003-06-19 Thread Scott Fletcher
Any success with making the PHP Header and PHP odbc_connect work
successfully on PHP version 4.0.2 while the IIS 5.0 is hooked up to MS-SQL
2003?  We had no problem with this if IIS 5.0 is hooked up to MS-SQL 2000.

I assumed it had to do with the PHP depending on the named-pipe.  I just
switched the ODBC driver over to TCP/IP then all of a sudden, errors with
PHP Header and PHP odbc_connect.  Problem is force.cgi-redirect doesn't
exist on PHP 4.0.2.  But PHP ODBC have problem with MS-SQL 2003 because it's
a little different.

Yea, we know we need newer PHP version, I already have most of the website
working on the test machine with the newer php version except a few more
websites that have yet to be upgraded to work with newer version.

Thanks,
 Scott



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



Re: [PHP] switch structure...

2003-06-19 Thread Chris Boget
> Oh...  you know, I've gotta stop leaving my brain at home.  Thanks Chris,
> R'twick..  It sure is a relief to know that this list is here when I'm
> having bad PHP days..  which lately, is everyday...  This solved my problem
> perfectly.

np.  
We've all had our brain fart days.  Or weeks. :p

Chris


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



[PHP] file downloading

2003-06-19 Thread Roberts, Mark (Tulsa)
I need to provide a way for users to download data files from a web site.
 
I know that I could have then right click and save-as, however, I need to record this 
action in a database. If they just right click, I don't have any way to trigger the 
script to record the transaction.
 
Does some one have a good way to do this, or at least give me some ideas? Thanks.

Mark Roberts 
Sr. Systems Analyst 


 


Re: [PHP] error handling

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 02:11, Mignon Hunter wrote:
> On my dev server the php.ini is set to log all errors and notices.
>
> Isnt there a way to over ride this on a per script basis to output to
> stdout (or my browser) ?

Yes, manual > Error Handling and Logging Functions

-- 
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
--
/*
Most people's favorite way to end a game is by winning.
*/


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



[PHP] error handling

2003-06-19 Thread Mignon Hunter
On my dev server the php.ini is set to log all errors and notices.  

Isnt there a way to over ride this on a per script basis to output to
stdout (or my browser) ?

Thx
-- 
Mignon 


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



RE: [PHP] switch structure...

2003-06-19 Thread Dan Joseph
Hi,

> Just do a conditional break.

> case 0:
>   blah blah blah.
>   if (my condition == false)
>   break;
> case 1:
> blah blah ..

Oh...  you know, I've gotta stop leaving my brain at home.  Thanks Chris,
R'twick..  It sure is a relief to know that this list is here when I'm
having bad PHP days..  which lately, is everyday...  This solved my problem
perfectly.

-Dan Joseph


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



Re: [PHP] switch structure...

2003-06-19 Thread R'twick Niceorgaw
On 19 Jun 2003 at 13:52, Dan Joseph wrote:

> Hi All,
> 
>   Looking for some guidance on something I want to be able to do with switch,
> and I don't think it exists, but I'd like to consult the list as a last
> resort.
> 
>   I have a switch setup similar to:
> 
>   switch ($step) {
>   case 0 :
>   blah...
>   break;
> 
>   case 1 :
>   blah...
>   breakl
>   }
> 
>   Under case 0, I'd like to do a few things, and then if a certain condition
> is met, move into case 1.  Is this possible?  Am I off the wall here?  Is
> there a better way of doing this madness I've come up with?
> 
> -Dan Joseph
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

case 0:
blah blah blah.
if (my condition == false)
break;
case 1:
blah blah ..




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



Re: [PHP] switch structure...

2003-06-19 Thread Chris Boget
> I have a switch setup similar to:
> Under case 0, I'd like to do a few things, and then if a certain condition
> is met, move into case 1.  Is this possible?  Am I off the wall here?  Is
> there a better way of doing this madness I've come up with?

Just do a conditional break.

Chris


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



[PHP] exec() and passthru()

2003-06-19 Thread Mignon Hunter
Jason,

I'm only subscribed to digest and found your reply in archives and
couldnt figure out how to reply  :{

Anyway, right now I'm just trying to get something to work.  The c exe
is as follows:
**
#include 
#define NAME "Mignon"
int main(void)
{

  int q;

  q = 5;
  printf("Hello, %s,%d \n", NAME,q);
  return 0;
}
*

I'm trying to return the "Hello, Mignon, 5" which is what's outputted on
the command line.

After I get this to work, I'll be needing it to execute a complex
function in c, and bring variables back to my php shopping cart.

Here's my test.php:


-- 
Mignon Hunter
Web Master and Developer
Toshiba International
713.466.0277 x 3461


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



[PHP] switch structure...

2003-06-19 Thread Dan Joseph
Hi All,

Looking for some guidance on something I want to be able to do with switch,
and I don't think it exists, but I'd like to consult the list as a last
resort.

I have a switch setup similar to:

switch ($step) {
case 0 :
blah...
break;

case 1 :
blah...
breakl
}

Under case 0, I'd like to do a few things, and then if a certain condition
is met, move into case 1.  Is this possible?  Am I off the wall here?  Is
there a better way of doing this madness I've come up with?

-Dan Joseph


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



Re: [PHP] call-time pass-by-reference feature really deprecated?

2003-06-19 Thread dorgon
Thanks for the explanation.
Yes, let us drop call-time pass-by-reference!! I'm with you. ;-)
/dorgon

Jason Wong wrote:
On Friday 20 June 2003 01:11, dorgon wrote:

Maybe, there's a setting for this in php.ini.
yes. there is:


Yes, I know there is ;-) The 'maybe' is maybe you have it set different on the 
two systems.


>>declaration of [runtime function name](). If you would like to enable
>>call-time pass-by-reference, you can set
>>allow_call_time_pass_reference to true in your INI file.
"pass-by-reference" has not been dropped, it is "Call-time
pass-by-reference" which is being deprecated.
so call-time pass-by-reference is giving parameters as reference to
functions, e.g.
function returnObjectToAccumulator(&$obj) {...}

If this feature is really dropped, how would you implement
ConnectionPools for DB-connections for instance, or any classes
managing a set of object and providing them by returning references?
many OOP design patterns (primarily adopted from java) would not be
possible anymore. I think this would be worth talking about.
Is there any plausible reason for that decision?


"Call-time pass-by-reference"
=
  function doo($i_may_or_may_not_be_a_reference) {
$i_may_or_may_not_be_a_reference++;
  }
  $i = 1;
  doo($i);
  echo $i; // 1
  doo(&$i);
  echo $i; // 2
// here doo() is not defined to have parameters passed by reference. The 
decision on whether to pass by reference is made at run-time, hence call-time  
pass-by-reference. It is this behaviour which is being deprecated.

So in the newer versions of PHP if call-time pass-by-reference is disabled and 
you wish to pass parameters by reference you'll have to define your functions 
accordingly:

  function doo(&$i_am_passed_by_reference) { ... }



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


Re: [PHP] unique random id

2003-06-19 Thread Don Read

On 19-Jun-2003 Awlad Hussain wrote:
> How do i generate a unique random number? 
> 

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

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.


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



Re: [PHP] call-time pass-by-reference feature really deprecated?

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 01:11, dorgon wrote:
> > Maybe, there's a setting for this in php.ini.
>
> yes. there is:

Yes, I know there is ;-) The 'maybe' is maybe you have it set different on the 
two systems.

>  >>declaration of [runtime function name](). If you would like to enable
>  >>call-time pass-by-reference, you can set
>  >>allow_call_time_pass_reference to true in your INI file.
> >
> > "pass-by-reference" has not been dropped, it is "Call-time
> > pass-by-reference" which is being deprecated.
>
> so call-time pass-by-reference is giving parameters as reference to
> functions, e.g.
>
> function returnObjectToAccumulator(&$obj) {...}
>
> If this feature is really dropped, how would you implement
> ConnectionPools for DB-connections for instance, or any classes
> managing a set of object and providing them by returning references?
>
> many OOP design patterns (primarily adopted from java) would not be
> possible anymore. I think this would be worth talking about.
>
> Is there any plausible reason for that decision?

"Call-time pass-by-reference"
=
  function doo($i_may_or_may_not_be_a_reference) {
$i_may_or_may_not_be_a_reference++;
  }

  $i = 1;
  doo($i);
  echo $i; // 1
  doo(&$i);
  echo $i; // 2

// here doo() is not defined to have parameters passed by reference. The 
decision on whether to pass by reference is made at run-time, hence call-time  
pass-by-reference. It is this behaviour which is being deprecated.

So in the newer versions of PHP if call-time pass-by-reference is disabled and 
you wish to pass parameters by reference you'll have to define your functions 
accordingly:

  function doo(&$i_am_passed_by_reference) { ... }

-- 
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
--
/*
Federal grants are offered for... research into the recreation
potential of interplanetary space travel for the culturally disadvantaged.
*/


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



Re: [PHP] call-time pass-by-reference feature really deprecated?

2003-06-19 Thread dorgon
I think you are absolutely right.
thanx!
I'll fix it and see if the warning still remains.
/Dorgon
Bobby Patel wrote:
Isn't Call-time pass-by-reference the following

$variable = myFunction1(&$x); Where
myFunction1() is defined as function myFunction1($x)
Where as pass-be-reference is called as
$variable = myFunction2($x); Where is defined as function myFunction2
(&$Obj);
I think the latter is better anyways, because the caller shouldn't know the
internals of  the function, so you don't know if the function will copy the
argument and use that instead.
"Dorgon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Maybe, there's a setting for this in php.ini.
yes. there is:
>>declaration of [runtime function name](). If you would like to enable
>>call-time pass-by-reference, you can set
>>allow_call_time_pass_reference to true in your INI file.

"pass-by-reference" has not been dropped, it is "Call-time

pass-by-reference"

which is being deprecated.
so call-time pass-by-reference is giving parameters as reference to
functions, e.g.
function returnObjectToAccumulator(&$obj) {...}

If this feature is really dropped, how would you implement
ConnectionPools for DB-connections for instance, or any classes
managing a set of object and providing them by returning references?
many OOP design patterns (primarily adopted from java) would not be
possible anymore. I think this would be worth talking about.
Is there any plausible reason for that decision?

/dorgon






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


[PHP] Re: Version Independent Sessions?

2003-06-19 Thread dorgon
that's some of my scripts I once used.
have a look at it. it won't run instantly, since I just
took them from a collection of classes
hth
/Dorgon
the most interesting part will be:

// initialize global session object
session_start();
if (isset($_SESSION)) { // php versions >= 4.1.0
if (!isset($_SESSION['userSess'])) {
$_SESSION['userSess'] = new UserSession();
$sess =& $_SESSION['userSess'];
$sess->init();
}
else {
$sess =& $_SESSION['userSess'];
$_SESSION['userSess']->reuse();
}
}
else { // for downward compatibility to old php version (< 4.1.0)
if (!isset($userSess)) {
$userSess = new UserSession();
$sess =& $userSess;
$userSess->init();
session_register("userSess");
}
else {
$sess =& $userSess;
$userSess->reuse();
session_register("userSess");
}
}
Lee Herron Qcs wrote:
Does anyone know of a working snippet to manage sessions using any
combination of Register_Global and pre/post php v4.1?
Would love to look at some examples ..


params = array();
$this->msg = "";
$this->userID = null;
$this->userData = array();

}

/**
 * reuse() should be called on each page request within session scope
 * get-parameters which should be stored in the session can be submitted
 * by a single get-variable: params=KEY1_VALUE1,KEY2_VALUE2,KEY3_VALUE3...
 * ater that the login action is called and
 * finally the proper reuseAction() function of the child class is called
 */
function reuse() {
if (isset($GLOBALS['_GET']['params'])) {
$doubles = explode(".",$GLOBALS['_GET']['params']);
foreach ($doubles as $par) {
$par = explode("_",$par);
$this->params[$par[0]] = $par[1];
}
}
$this->doLogin();
$this->reuseAction();
}

/**
 * login action
 * proper functions loginAction(), log
 */
function doLogin() {
if (isset($GLOBALS['_GET']['dologin'])) {
switch($GLOBALS['_GET']['dologin']) {
case "form":
$this->loginFormAction();
break;
case "login":
if ($GLOBALS['_POST']['user_login'] == "") {
$this->msg = "Please enter your login 
name.";
return false;
}
else {
if(!defined("__USEROBJECT_CLASS")) 
include $GLOBALS['conf']->get("dir_objects")."userobject.inc";
$user = new UserObject();

$user->loadUserByLogin($GLOBALS['_POST']['user_login']);
if 
($user->checkPwd($GLOBALS['_POST']['user_password'])) {
if 
($this->loginAction(&$user)) {
$this->userData = 
$user->getRecord();
$user->unload();

$this->userID = 
$this->userData['user_id'];

$this->params['last_selflogin_time'] = $this->userData['last_login_time'];

$this->params['last_selflogin_host'] = $this->userData['last_login_host'];

$user->loadLastAdmin();

$this->params['last_userlogin_name'] = $user->get("user_first_name")." 
".$user->get("user_last_name");

$this->params['last_userlogin_time'] = $user->get("last_login_time");

$this->params['last_userlogin_host'] = $user->get("last_login_host");

$user->update($this->userID, Array("last_login_time" => "NOW()", "last_login_host" => 
"'".$GLOBALS['_SERVER']['REMOTE_ADDR']."'"), $foo);
$user->unload();
$grant = true;
  

[PHP] Re: Another hosting question....

2003-06-19 Thread Paul Chvostek
On Wed, Jun 18, 2003 at 07:52:21PM -0400, Mike Morton wrote:
> 
> What I am looking for specifically is a company that someone can recommend
> from direct experience, one that is customer friendly, offers dedicated
> servers at a REASONABLE price, offers admin support and server support, etc,
> etc, etc, and most importantly has expertise in compiling PHP.
> 
> If anyone out there know of a company like this and can recommend them - I
> would appreciate it :) It will save literally hours and hours of sorting
> through the  google listings that a php dedicated hosting search brings
> back!  (2 days of sorting to this point anyhow!)

I would tout my own company, but we focus more on co-location of
customer-provided equipment rather than server rental.

So I'll tout the competition and throw http://prioritycolo.com/ into the
fray.  The guy who owns and runs it is friendly, honest and highly
knowledgeable, the upstream connectivity is fast and reliable (though
not multihomed AFAIK).  The servers are FreeBSD with CPanel (unless you
specifically require something else), and the prices are excellent.

Plus, he's local.  :-)  His cage is at 151 Front, just down the hall
from mine.

-- 
  Paul Chvostek <[EMAIL PROTECTED]>
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/


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



Re: [PHP] call-time pass-by-reference feature really deprecated?

2003-06-19 Thread Bobby Patel
Isn't Call-time pass-by-reference the following

$variable = myFunction1(&$x); Where
myFunction1() is defined as function myFunction1($x)

Where as pass-be-reference is called as
$variable = myFunction2($x); Where is defined as function myFunction2
(&$Obj);

I think the latter is better anyways, because the caller shouldn't know the
internals of  the function, so you don't know if the function will copy the
argument and use that instead.

"Dorgon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Maybe, there's a setting for this in php.ini.
>
> yes. there is:
>  >>declaration of [runtime function name](). If you would like to enable
>  >>call-time pass-by-reference, you can set
>  >>allow_call_time_pass_reference to true in your INI file.
>
> > "pass-by-reference" has not been dropped, it is "Call-time
pass-by-reference"
> > which is being deprecated.
>
> so call-time pass-by-reference is giving parameters as reference to
> functions, e.g.
>
> function returnObjectToAccumulator(&$obj) {...}
>
> If this feature is really dropped, how would you implement
> ConnectionPools for DB-connections for instance, or any classes
> managing a set of object and providing them by returning references?
>
> many OOP design patterns (primarily adopted from java) would not be
> possible anymore. I think this would be worth talking about.
>
> Is there any plausible reason for that decision?
>
> /dorgon
>



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



RE: [PHP] Re: header(); Issue

2003-06-19 Thread Mike At Spy

I'll give one of the suggestions a whirl (or both).  I do have this same
sort of thing on a different server with a more recent version of PHP -
which is why I thought it might be a version issue. :)

-Mike


> -Original Message-
> From: Esteban Fernandez [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 19, 2003 12:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: header(); Issue
>
>
> Try
>
> header("Location: ".$Relative."/outstanding.php?pdd=1&pddid=".$poid."");
>
> EF.
>
>
> "Spyproductions Support Team" <[EMAIL PROTECTED]> escribió en el
> mensaje news:[EMAIL PROTECTED]
> >
> > I have this in a script:
> >
> > header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");
> >
> > It works fine elsewhere in the script without the variables.
> Does anyone
> > know if php 4.06 has issues with this?  Or am I making a boneheaded
> mistake
> > here?
> >
> > $Relative is from an include, and outputs fine.  :)
> >
> > Thanks!
> >
> > :)
> >
> > -Mike
> >
> >
>
>
>
> --
> 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] picture help

2003-06-19 Thread Edward Peloke
thanks Jason,

This worked much better!

Eddie

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 18, 2003 5:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] picture help


On Thursday 19 June 2003 05:05, Edward Peloke wrote:
> thanks, I tried and it doesn't help.  For some reason some of the pictures
> I upload look fine and some look bad no matter if I use imagecopyresampled
> or resized

> > $newimg=imagecreate($nw,$nh);

Use imagecreatetruecolor() instead.

--
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
--
/*
Kime's Law for the Reward of Meekness:
Turning the other cheek merely ensures two bruised cheeks.
*/


--
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: Processing Form Data /w $_POST

2003-06-19 Thread Bobby Patel
Yes that's right. this was just from the top of my head and it's early for
me.

it should be
$report .= "key:".$index." => ".$value."\n";

as Dan has pointed out.
"Dan Joseph" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> > $report = "key:".$index." => ".$value."\n";
>
> actually, shouldn't it be:
>
> $report .= "key:".$index." => ".$value."\n";
>
> If you don't have the . there, its going to keep overwriting the report,
> and thus writing only the last $report item that was built.  .= would
concat
> 'em all together.  Am I misunderstanding?
>
> -Dan Joseph
>



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



[PHP] Version Independent Sessions?

2003-06-19 Thread Lee Herron QCS
Does anyone know of a working snippet to manage sessions using any
combination of Register_Global and pre/post php v4.1?

Would love to look at some examples ..



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



[PHP] Re: call-time pass-by-reference feature really deprecated?

2003-06-19 Thread dorgon
whats the difference?

call-time-pass... is function callMe(&$obj) {...}
and pass-by-ref is "return &$obj" ?
I'm not sure if I got you.
tx
dorgon
Rush wrote:
"Dorgon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Will the pass-by-reference feature really be dropped?! Many software
design patterns wouldn't be possible anymore! It's an essential feature.


I think call-pass-by-reference is going away, but pass-by-reference is going
to be default in PHP5.
rush
--
http://www.templatetamer.com/




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


RE: [PHP] Re: Processing Form Data /w $_POST

2003-06-19 Thread Dan Joseph
Hi,

> $report = "key:".$index." => ".$value."\n";

actually, shouldn't it be:

$report .= "key:".$index." => ".$value."\n";

If you don't have the . there, its going to keep overwriting the report,
and thus writing only the last $report item that was built.  .= would concat
'em all together.  Am I misunderstanding?

-Dan Joseph


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



Re: [PHP] call-time pass-by-reference feature really deprecated?

2003-06-19 Thread dorgon
Maybe, there's a setting for this in php.ini.
yes. there is:
>>declaration of [runtime function name](). If you would like to enable
>>call-time pass-by-reference, you can set
>>allow_call_time_pass_reference to true in your INI file.
"pass-by-reference" has not been dropped, it is "Call-time pass-by-reference" 
which is being deprecated.
so call-time pass-by-reference is giving parameters as reference to 
functions, e.g.

function returnObjectToAccumulator(&$obj) {...}

If this feature is really dropped, how would you implement 
ConnectionPools for DB-connections for instance, or any classes
managing a set of object and providing them by returning references?

many OOP design patterns (primarily adopted from java) would not be
possible anymore. I think this would be worth talking about.
Is there any plausible reason for that decision?

/dorgon

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


[PHP] Re: call-time pass-by-reference feature really deprecated?

2003-06-19 Thread rush
"Dorgon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Will the pass-by-reference feature really be dropped?! Many software
> design patterns wouldn't be possible anymore! It's an essential feature.

I think call-pass-by-reference is going away, but pass-by-reference is going
to be default in PHP5.

rush
--
http://www.templatetamer.com/




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



Re: [PHP] call-time pass-by-reference feature really deprecated?

2003-06-19 Thread Jason Wong
On Thursday 19 June 2003 23:53, dorgon wrote:

> I just got a warning message on a system using php version 4.3.1:
>
> 
> Warning: Call-time pass-by-reference has been deprecated - argument
> passed by value; If you would like to pass it by reference, modify the
> declaration of [runtime function name](). If you would like to enable
> call-time pass-by-reference, you can set allow_call_time_pass_reference
> to true in your INI file. However, future versions may not support this
> any longer.
> 
>
> This msg does not appear on my machine running php 4.3.2. Maybe it's
> because of the different configuration?

Maybe, there's a setting for this in php.ini.

> Will the pass-by-reference feature really be dropped?! Many software
> design patterns wouldn't be possible anymore! It's an essential feature.

"pass-by-reference" has not been dropped, it is "Call-time pass-by-reference" 
which is being deprecated.

-- 
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
--
/*
GIVE:   Support the helpless victims of computer error.
*/


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



[PHP] Re: Processing Form Data /w $_POST

2003-06-19 Thread Bobby Patel
$setup_filename = "/path/to/file/on/the/server/";

$fd = fopen($setup_filename , 'a');  #a for appending to file, w to write
from the beginning checkout php.net for more details on fopen

$report = "";
#
#Apply any re-ordering of the Post array here to you 'logical' order
# look at the  manual for asort, ksort, etc

foreach ($HTTP_POST_VARS as $index => $value) {
$report = "key:".$index." => ".$value."\n";
}

fwrite($fd, $report );
fclose($fd);




"Kyle Babich" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I have a form (setup.php) that passes values to processSetup.php when they
are written into setup.txt.  I'm trying to instead of writing every
idividual value into setup.txt from setup.php, write a loop that will take
as many values as there are in the $_POST array and write them all into a
single array in logical order in setup.txt.  I'm new to php and can't figure
out how to do this.  I'm thinking of something like...

for ($_POST) {
 fwrite($setup, /*something to add current $_POST value to the end of an
array within $setup*/);
}

How should I go about this?

Thank you,
--
Kyle



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



Re: [PHP] Re: Processing Form Data /w $_POST

2003-06-19 Thread Kyle Babich
> What kind of 'logical' order do you need for the Post array?
> 
> To clarify:
> Do you need to write to a file the POST variables passed to the script?

Yes, setup.php -> processSetup.php -> setup.txt

> 
> 
> "Kyle Babich" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> I have a form (setup.php) that passes values to processSetup.php when they
> are written into setup.txt.  I'm trying to instead of writing every
> idividual value into setup.txt from setup.php, write a loop that will take
> as many values as there are in the $_POST array and write them all into a
> single array in logical order in setup.txt.  I'm new to php and can't figure
> out how to do this.  I'm thinking of something like...
> 
> for ($_POST) {
>  fwrite($setup, /*something to add current $_POST value to the end of an
> array within $setup*/);
> }
> 
> How should I go about this?
> 
> Thank you,
> --
> Kyle
> 
> 
> 
> -- 
> 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] exec(), passthru()

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 00:11, Mignon Hunter wrote:

> I am trying to use either of the functions above to execute a compiled c
> program on linux.  The command line works with ./a.out (a.out being the
> filename).  Both my test.php and the exe are in the same directory.
> I've tried combinations of all the following. Thx Mignon

What exactly do you want to do? exec() & passthru() have different uses. Do 
you want to capture the output of the program? The exit value? Or what?

When running external programs from PHP I find that it helps to specify the 
full path to the program. And you have made sure that you have the right 
permissions to execute said program?

-- 
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
--
/*
Valerie: Aww, Tom, you're going maudlin on me ...
Tom: I reserve the right to wax maudlin as I wane eloquent ...
-- Tom Chapin
*/


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



[PHP] Re: Processing Form Data /w $_POST

2003-06-19 Thread Bobby Patel
What kind of 'logical' order do you need for the Post array?

To clarify:
Do you need to write to a file the POST variables passed to the script?


"Kyle Babich" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
I have a form (setup.php) that passes values to processSetup.php when they
are written into setup.txt.  I'm trying to instead of writing every
idividual value into setup.txt from setup.php, write a loop that will take
as many values as there are in the $_POST array and write them all into a
single array in logical order in setup.txt.  I'm new to php and can't figure
out how to do this.  I'm thinking of something like...

for ($_POST) {
 fwrite($setup, /*something to add current $_POST value to the end of an
array within $setup*/);
}

How should I go about this?

Thank you,
--
Kyle



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



RE: [PHP] Processing Form Data /w $_POST

2003-06-19 Thread Henning Sittler
it's in the manual, read here:



Henning Sittler
www.inscriber.com



-Original Message-
From: Kyle Babich [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 12:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Processing Form Data /w $_POST


I have a form (setup.php) that passes values to processSetup.php when they
are written into setup.txt.  I'm trying to instead of writing every
idividual value into setup.txt from setup.php, write a loop that will take
as many values as there are in the $_POST array and write them all into a
single array in logical order in setup.txt.  I'm new to php and can't figure
out how to do this.  I'm thinking of something like...

for ($_POST) {
 fwrite($setup, /*something to add current $_POST value to the end of an
array within $setup*/);
}

How should I go about this?

Thank you,
--
Kyle

-- 
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: header(); Issue

2003-06-19 Thread Esteban Fernandez
Try

header("Location: ".$Relative."/outstanding.php?pdd=1&pddid=".$poid."");

EF.


"Spyproductions Support Team" <[EMAIL PROTECTED]> escribió en el
mensaje news:[EMAIL PROTECTED]
>
> I have this in a script:
>
> header("Location: $Relative/outstanding.php?pdd=1&pddid=$poid");
>
> It works fine elsewhere in the script without the variables.  Does anyone
> know if php 4.06 has issues with this?  Or am I making a boneheaded
mistake
> here?
>
> $Relative is from an include, and outputs fine.  :)
>
> Thanks!
>
> :)
>
> -Mike
>
>



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



[PHP] Processing Form Data /w $_POST

2003-06-19 Thread Kyle Babich
I have a form (setup.php) that passes values to processSetup.php when they are written 
into setup.txt.  I'm trying to instead of writing every idividual value into setup.txt 
from setup.php, write a loop that will take as many values as there are in the $_POST 
array and write them all into a single array in logical order in setup.txt.  I'm new 
to php and can't figure out how to do this.  I'm thinking of something like...

for ($_POST) {
 fwrite($setup, /*something to add current $_POST value to the end of an array 
within $setup*/);
}

How should I go about this?

Thank you,
--
Kyle

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



  1   2   >