[PHP] Database sessions and file sessions

2003-09-08 Thread CDitty
Can database sessions and file system sessions co-exist on the same 
server.   I have 2 applications that use sessions.  One uses the standard 
php sessions and the other uses sessions that are stored in the 
database.  Neither of these can be changed.

Can anyone offer any advice on this?

Chris

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


[PHP] How can I change ? to %3F

2003-08-14 Thread CDitty
Is it possible to change the ?, :,  and / characters to their respective 
hex(?) values automatically?  That is without having to use str_replace for 
each one?  Anyone know how?

Chris

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


Re: [PHP] How can I change ? to %3F

2003-08-14 Thread CDitty
DUH

Thanks all.  This is exactly what I was looking for.  Couldn't remember the 
exact term of the chars though.  Thanks again.

Chris

At 05:19 PM 8/5/2003, David Nicholson wrote:
Hello,

This is a reply to an e-mail that you wrote on Tue, 5 Aug 2003 at
23:16, lines prefixed by '' were originally written by you.
 Is it possible to change the ?, :,  and / characters to their
 respective
 hex(?) values automatically?  That is without having to use
 str_replace for
 each one?  Anyone know how?
 Chris
http://uk2.php.net/urlencode

If you want *only* the ?:/ characters changed then it can be done
with a regular rexpression, the e modifier, and the ord(), hex() and
strtoupper() functions, post back if you would like an example.
HTH

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/
Free PHP error handling script: www.phpmachine.com/error-handler/
  Professional Web Development by David Nicholson
http://www.djnicholson.com/
QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/


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


Re: [PHP] Reading a file from another server

2003-07-26 Thread CDitty
Have you tried downloading the file to your server and then read it from 
there?  I do this at least 15 times a day with several different sites and 
I rarely have any problems.

CDitty

At 11:28 AM 7/26/2003, Thomas wrote:
I know the url is good, cause I can go on to this domain and look at all my
files.
I guess I should explain a little further...

This server is a game server for Counter-Strike.   I'm trying to read a file
on there called mapcycle.txt.
This server is a secure server, so I would need to use a username and
password to get on.  I
I've tried a bunch of different things, and now I find that it has a problem
connecting to secure servers.
DO you know of a different way to connect to a secure server anhd get
information other than the way I have been trying?
This is what I'm usuing right now:

?php
$prefix = ftp://;;
$username = myUsername;
$password = **;
$url = server.username.gameserver.com/;
$filename = test.txt;
$result = readfile($prefix . $username . : . $password . @ . $url .
$filename);
print ($result);
?
// OUTPUT
0
if I use anythign other than the ftp:// for a prefix (like http. or https) I
get an error.
Cheers.

Chris Shiflett [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 --- Thomas [EMAIL PROTECTED] wrote:
  readfile(ftp://username:[EMAIL PROTECTED]/test.txt);
 
  It doesn't have any errors and comes up blank.
 
  If I put:
 
  $result =
  readfile(ftp://username:[EMAIL PROTECTED]/test.txt);
  print ($result);
 
  it ends up showing a '0'  by iteself.

 The readfile() functions outputs the contents of the file and returns the
size
 of the file in bytes. So, when you assigned $result to the return value,
you
 demonstrated that readfile() output 0 bytes (which explains why you didn't
see
 anything).

 I'm pretty sure your php.ini is set to allow this, otherwise you would
receive
 an error. I'm doubting whether that URL actually contains any content. How
have
 you tested to be sure it does?

 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP CGI mode and command line variables

2003-07-24 Thread CDitty
That worked like a charm.  Thanks Chris.  I've added this to my snippet 
collection.  :)

At 12:02 AM 7/24/2003, Chris Shiflett wrote:
--- CDitty [EMAIL PROTECTED] wrote:
 Thanks man.  That got rid of the error, however it is not using the
 variable in the script.
You have to read them in. I think you can just loop through $argv, so 
something
like this will show you what PHP is receiving:

?
echo A total of $argc parameters are available:\n\n;
foreach ($argv as $curr_parameter)
{
 echo $curr_parameter\n;
}
?
Hope that helps.

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] PHP CGI mode and command line variables

2003-07-23 Thread CDitty
I have written a script that runs fine when I run it via the command 
line.  However, when I tack on variables to the command line, I get an error.

This works.
php -q ./import.php
This doesn't
php -q ./import.php?feed=eastwood
This is the error that it returns - Could not open input file: 
./import.php?feed=eastwood

Can anyone offer any advice for making this work?

Chris

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


Re: [PHP] PHP CGI mode and command line variables

2003-07-23 Thread CDitty
Thanks man.  That got rid of the error, however it is not using the 
variable in the script.   I can't run this via wget or the browser since 
the importing files are rather large.

Any other ideas?

Chris

At 11:33 PM 7/23/2003, Chris Shiflett wrote:
--- CDitty [EMAIL PROTECTED] wrote:
 I have written a script that runs fine when I run it via the
 command line. However, when I tack on variables to the command
 line, I get an error.

 This works.
 php -q ./import.php

 This doesn't
 php -q ./import.php?feed=eastwood
I might be wrong, but I don't think it's possible to simulate GET or POST from
the command line like that. I always have a shell script perspective and 
pass
things in as arguments like this:

./import.php --feed=eastwood

Of course, if it's under document root, you can test from the command line
using wget.
Hope that helps.

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] php4_module is already loaded

2003-07-14 Thread CDitty
I just updated my 4.2.x to 4.3.2 and when I restart the apache, I get the 
error [warn] module php4_module is already loaded, skipping.

Can anyone offer any suggestions?  I searched the archives, but didn't see 
anything that would help.  Apache/PHP seem to be running ok, but I would 
like to get rid of the error.

Thanks

Chris

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


[PHP] Using TTF within an image

2003-07-04 Thread CDitty
Can someone please show me how to change the display font to a TTF in this 
code?  I looked at the online manual under imageloadfont(), but I did not 
understand it enough.  I have the MS TTFs installed on my server and they 
are working correctly.

Thanks

Chris

?php
header (Content-type: image/png);
$string = Text message goes here;
$font   = 2;
$width  = ImageFontWidth($font) * strlen($string);
$height = ImageFontHeight($font);
$im = @imagecreate ($width,$height);
$background_color = imagecolorallocate ($im, 255, 255, 255); //white background
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, 0, 0,  $string, $text_color);
imagepng ($im);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Foreach loop with empty values

2003-06-13 Thread CDitty
I have a foreach loop in a while loop that retrieves information from my 
database.  The foreach loop works fine if there is data in the database for 
that loop.  But if nothing is found in the database, I get a Invalid 
argument supplied error.

Can anyone suggest a fix for this?  The foreach loop is a standard foreach.

Code
foreach($pid as $netPid){
echo $netPidbr;
}
Chris

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


Re: [PHP] Foreach loop with empty values

2003-06-13 Thread CDitty
Got it fixed.  Never mind.

Thanks

At 10:49 PM 6/13/2003, CDitty wrote:
I have a foreach loop in a while loop that retrieves information from my 
database.  The foreach loop works fine if there is data in the database 
for that loop.  But if nothing is found in the database, I get a Invalid 
argument supplied error.

Can anyone suggest a fix for this?  The foreach loop is a standard foreach.

Code
foreach($pid as $netPid){
echo $netPidbr;
}
Chris

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


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


[PHP] PHP and base32 encryption

2003-06-04 Thread CDitty
Someone has sent me a line of text that is base32 encrypted that I need to 
decrypt.  Does anyone know of a php module or snippet that can decrypt 
this?  I have searched on google and the php.net site, but was unable to 
find anything that can help.

Thanks

CDitty

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


[PHP] Can't connect to mysql

2003-03-28 Thread CDitty
I just setup my home development server and I am having problems connecting 
to the mysql server.  Mysql is isntalled and is configured correctly.  It 
is running.  Mysql is compiled into php,   When I try to connect using 
existing code, I get the following error.

Fatal error: Call to undefined function: mysql_connect()

I am using MySQL 4.0.12.  I installed MySQL from rpms and installed the 
following ones.
client, devel, server, shared, embedded

Anyone have any ideas?

CDitty

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


Re: [PHP] A cool PHP tool - Pusher

2003-03-28 Thread CDitty
At 11:24 PM 3/28/2003, Pete James wrote:
BTW. After some re-factoring I may release the code to the community.


I for one would really like this.



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


[PHP] PHP Session Management

2003-03-23 Thread CDitty
Hello all.  I am trying to figure out some session management that is in 
the O'reilly book - Web Database Applications.  I am getting the following 
error - Error 1045 : Access denied for user: '[EMAIL PROTECTED]' (Using 
password: YES)

Normally, I would think that this is because the userid and/or password for 
the database is incorrect.  However, they are not.  I have verified that 
the userid and password are correct and the database server is active.

Anyone have any ideas?

Here is the code
sessions.php
-
?
// Database connection information
$hostName = localhost;
$databaseName = development;
$username = userid;
$password = password;
// Error handling
function showerror()
{
die(Error  . mysql_errno() .  :  . mysql_error());
}
// Returns current time as a number
// Used for recording the last session access
function getMicroTime()
{
// microtime() returns the number of seconds
// since 0:00:00 January 1, 1970 GMT as a
// microsecond part and a second part.
// eg: 0.08344800 1000952237
// Convert the two parts into an array
$mtime = explode( , microtime());
// Return the addition of the two parts
return($mtime[1] + $mtime[0]);
}
// The database connection
$connection;
// The global variable that holds the table name
$session_table;
function sessionOpen($database_name, $table_name)
{
// Save the database name in a global variable
global $connection;
global $hostName;
global $username;
global $password;
if(!($connection = @mysql_connect($hostName, $username, $password))){
showerror();
}
if(!mysql_select_db($database_name, $connection)){
showerror();
}
// Save the table name in a global variable
global $session_table;
$session_table = $table_name;
return true;
}
// This function is called whenever a session_start()
// call is made and reads the session variables
// Returns  when a session is not found
//  (serialized)string - session exists
function sessionRead($sess_id)
{
// Access the DB connection
global $connection;
// Access the global variable that holds the name
// of the table that holds the session variables
global $session_table;
// Formulate a query to find the session
// identified by $sess_id
$search_query = select * from $session_table where session_id = 
'$sess_id';

// Execute the query
if(!($result = @mysql_query($search_query, $connection))){
showerror();
}
if(mydql_num_rows($result) == 0){
return ;
}else{
// Found a session - retun the seialized string
$row = mysql_fetch_array($result);
return $row[session_variable];
}
}
// This function is called when a session is initialized
// with a session_start() call, when variables are
// registered or unregistered, and when session variables
// are modified. Returns true on success.
function sessionWrite($sess_id, $val)
{
global $connection;
global $session_table;
$time_stamp = getMicroTime();

$search_query = select session_id from $session_table where 
session_id = '$sess_id';

// Execute query
if(!($result = @mysql_query($search_query, $connection))){
showerror();
}
if(mysql_num_rows($result) == 0){
// No session found, insert a new one
$insert_query = insert into $session_table (session_id, 
session_variable, last_accessed) values ('$sess_id, '$val', $time_stamp);

if(!mysql_query($insert_query, $connection)){
showerror();
}
}else{
// Existing session found - Update it
$update_query = update $session_table set 
session_variable = '$val', last_accessed = $time_stamp where session_id = 
'$sess_id';

if(!mysql_query($update_query, $connection)){
showerror();
}
}
return true;
}
// This funstion is executed on shutdown of the session
// Always returns true
function sessionClose($sess_id)
{
return true;
}
// This is called whenever the session_destroy()
// funstion call is made. Returns true is the session
// has successfully been deleted.
function sessionDestroy($sess_id)
{
global $connection;
global $session_table;
$delete_query = delete from session_table where session_id = 
'$sess_id';

if(!($result = @mysql_query($delete_query, $connection))){
showerror();
}
return true;
}
// This function is called on a session's start up with
// the probability specified in session.gc_probability.
// Performs garbage collection by removing all sessions
// that haven't been updated in the last 

[PHP] fopen and PHP 4.3.x

2003-03-10 Thread CDitty
I seem to be having a problem with fopen on apache 1.3.27/php 4.3 
servers.  Scripts that worked before and on other servers do not work on 
this one.  The web host recently upgraded both php and apache.   Below is 
the error.

Warning: fopen(XX) [function.fopen]: failed to create 
stream: Invalid argument in /path/to/script/import.php on line 30

This is the code around line 30.
$local_file = $feed;
$fp = fopen($local_file, r);
Anyone have any ideas?  I have looked over the manual and the only thing I 
could find similar to this is in the comments.  Apache was restarted.

CDitty



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


Re: [PHP] fopen and PHP 4.3.x

2003-03-10 Thread CDitty
At 09:42 PM 3/10/2003, Liam Gibbs wrote:
 This is the code around line 30.
 $local_file = $feed;
 $fp = fopen($local_file, r);

 Anyone have any ideas?  I have looked over the manual and the only thing I
 could find similar to this is in the comments.  Apache was restarted.
I get the same thing so I'm working through it. But here are some ideas that
may work for you: What are the permissions of the file in question? And do
you know the exact path of the file? Also, is the first line above (line
29?) needed? Why not just use $feed as the filename?
Forgot to mention this. Pulling via http. Works in the browser, but not in 
the script. The line above is needed, but it has nothing to do with fopen. 
Using url instead of $file produces same error.

Chris

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


[PHP] fgetcsv quit working......

2003-03-09 Thread CDitty
I have a customer who's webhost upgraded their server recently and a script 
that was working fine quit working.  The error they are getting is this 
fgetcsv(): supplied argument is not a valid stream resource.  I don't 
know what they did with Apache, but as far as I know, nothing else changed.

Can anyone offer any advice on troubleshooting this one?

Chris

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


Re: [PHP] fgetcsv quit working......

2003-03-09 Thread CDitty
I thought about this possibility, but it turns out 4 different scripts on 
the same server accessing different files from different locations and 
using different methods are all failing.

Chris

At 07:53 PM 3/9/2003, Jason Sheets wrote:
Check to make sure the file exists, you should probably through some
debug code around the area that is failing.
Jason
On Sun, 2003-03-09 at 18:50, CDitty wrote:
 I have a customer who's webhost upgraded their server recently and a 
script
 that was working fine quit working.  The error they are getting is this
 fgetcsv(): supplied argument is not a valid stream resource.  I don't
 know what they did with Apache, but as far as I know, nothing else changed.

 Can anyone offer any advice on troubleshooting this one?

 Chris
--
Jason Sheets [EMAIL PROTECTED]


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


[PHP] Fusebox PHP 4.3.1 on AIX

2003-03-01 Thread CDitty
Has anyone successfully gotten fusebox for php to work on AIX w/ 
4.3.1?  The server I am using has globals turned off, but I have this in 
the index file,

extract($_SERVER);
extract($_GET);
extract($_POST);
extract($_COOKIE);
but all I get is a blank screen.  The code is fine because when it is run 
on a regular linux box, it works fine.

Anyone offer any tips?

Chris

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


[PHP] MySQL/PHP Associative Array Insert

2003-02-01 Thread CDitty
A co-worker is teaching me to move to the next level in php. I have
started using associative arrays for my scripts, but I am having a problem
using them to do an insert into MySQL. Can someone give me an example of
how to do an insert to the database using these arrays? My array is
this...$item['itemID']

Thanks
Chris



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




[PHP] Problem importing LARGE text file.....

2002-11-30 Thread CDitty
Hello all,

I am trying to import a 400 meg pipe delimited text file, but I am having 
problems.  For some reason, it will only read in 320 lines and then it will 
cause a core dump.  I have used this same script to import a 350 meg file 
with no problems.  I have talked with my support and they believe it could 
be some type of problem or limitation with php.

Can anyone offer any advice on how to track this down?  When I look at the 
core file, this is what it says...core: ELF 32-bit LSB core file of 'php' 
(signal 11), Intel 80386, version 1

CDitty


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



Re: [PHP] Mail Headers problem.......

2002-05-24 Thread CDitty

Per your request..

Chris

// To email address
if(substr($lines[$i], 0, 2) == To){
 $To = substr($lines[$i], 4, strlen($lines[$i]));
 eregi(([A-Z0-9\.\-]+@[A-Z0-9\.\-]+\.[A-Z\.]+), $To, $To);
}elseif(substr($lines[$i], 0, 4) == From){// From email address
 $From = substr($lines[$i], 6, strlen($lines[$i]));
 eregi(([A-Z0-9\.\-]+@[A-Z0-9\.\-]+\.[A-Z\.]+), $From, $From);
}elseif(substr($lines[$i], 0, 7) == Subject){// Email subject
 $Subject = substr($lines[$i], 9, strlen($lines[$i]));
}elseif(substr($lines[$i], 0, 12) == MIME-Version){// Email subject
 $Mime_Version = substr($lines[$i], 14, strlen($lines[$i]));
}elseif(substr($lines[$i], 0, 12) == Content-Type){// Email subject
 $Content_Type = substr($lines[$i], 14, strlen($lines[$i]));
}

if(IsSet($Mime_Version)){
 $Mime_Version = MIME-Version: $Mime_Version\r\n;
}
if(IsSet($Content_Type)){
 $Content_Type = Content-type: $Content_Type\r\n;
}



At 11:55 PM 5/23/2002, you wrote:
On Thu, May 23, 2002 at 10:19:51PM -0500, CDitty wrote:

  $to = $user_email[0];
  $subj = $Subject;
  $msg = $Message;
 
  $headers = From: $From[1]\n;
  $headers .= $Mime_Version;
  $headers .= $Content_Type;

You're not showing us how you come up with the $From[1], $Mime_Version
and $Content_Type variables.  I'm guessing the $Mime_Version is only
getting Status:\n stuck into it.  Then, your $headers string adds the
extra \n which results in the following output you're showing...

  Subject: test
  From: [EMAIL PROTECTED]
  Status:
 
  Content-type: text/plain; charset=us-ascii; format=flowed
 
  test 1234

Later,

--Dan

--
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

--
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] Mail Headers problem.......

2002-05-24 Thread CDitty

I have looked at it and from what I understand, it should be working but 
it's not.

At 12:18 PM 5/24/2002, you wrote:
Hi:

  Per your request..

[... code snipped ...]
My request was really for you to examine your code, not to send the code
to me:


  ... I'm guessing the $Mime_Version is only
  getting Status:\n stuck into it.  Then, your $headers string adds the
  extra \n which results in the following output you're showing...

So, go take a look at the parts of your script where you set
$Mime_Version and everything in that is used in the creation of that
variable.

Enjoy,

--Dan

--
PHP classes that make web design easier
 SQL Solution  |   Layout Solution   |  Form Solution
 sqlsolution.info  | layoutsolution.info |  formsolution.info
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

--
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] Mail Headers problem.......

2002-05-23 Thread CDitty

I am writing a small email logging / forwarding script and am having 
problems with the headers.  I am successfully getting the MIME-Version and 
Content-type, but when I insert them into the forwarded email message, the 
headers show within the email itself. Below is the code I am using.

$to = $user_email[0];
$subj = $Subject;
$msg = $Message;

$headers = From: $From[1]\n;
$headers .= $Mime_Version\n;
$headers .= $Content_Type\n;
mail($to, $subj, $msg, $headers);

This is what the email looks like.

Return-Path: mail
Received: (from mail@localhost)
by redhotsweeps.com (8.9.3/8.9.3) id VAA27003;
Thu, 23 May 2002 21:23:51 -0500
Date: Thu, 23 May 2002 21:23:51 -0500
Message-Id: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: test
From: [EMAIL PROTECTED]
Status:

Content-type: text/plain; charset=us-ascii; format=flowed

test 1234


Can anyone give me any tips?

Thanks

CDitty




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




RE: [PHP] Mail Headers problem.......

2002-05-23 Thread CDitty

Actually tried that earlier.  No difference in the result.

Chris

At 10:48 PM 5/23/2002, you wrote:
dunno if this helps, but try using \r\n instead of just \n when you
create $headers

-Original Message-
From: CDitty [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mail Headers problem...


I am writing a small email logging / forwarding script and am having
problems with the headers.  I am successfully getting the MIME-Version and
Content-type, but when I insert them into the forwarded email message, the
headers show within the email itself. Below is the code I am using.

$to = $user_email[0];
$subj = $Subject;
$msg = $Message;

$headers = From: $From[1]\n;
$headers .= $Mime_Version\n;
$headers .= $Content_Type\n;
mail($to, $subj, $msg, $headers);

This is what the email looks like.

Return-Path: mail
Received: (from mail@localhost)
by redhotsweeps.com (8.9.3/8.9.3) id VAA27003;
Thu, 23 May 2002 21:23:51 -0500
Date: Thu, 23 May 2002 21:23:51 -0500
Message-Id: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: test
From: [EMAIL PROTECTED]
Status:

Content-type: text/plain; charset=us-ascii; format=flowed

test 1234


Can anyone give me any tips?

Thanks

CDitty




--
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] Running php program when mail received

2002-05-19 Thread CDitty

Hello all.  I am trying to write a small program that will run everytime an 
email is received at a certain mailbox on my sever.  I had this running at 
one time, but for some reason, it will not run.  I am not getting any 
errors and I can't figure out what is going on.  Below is the code that I 
am trying to run.

#!/usr/bin/php -q
### CHANGE VALUES OF THE FOLLOWING VARIABLES ###

$to = [EMAIL PROTECTED];
$subj = message;
$hdrs = From: [EMAIL PROTECTED]\n;
$msg = This is going out;

mail($to, $subj, $msg, $hdrs);

This is what is returned in the maillog file.
May 19 22:29:07 server1 sendmail[3502]: WAA03501: 
to=|/path/to/file/imap.php, delay=00:00:00, xdelay=00:00:00, mailer=prog, 
stat=Sent

Can anyone point me in the right direction?  The script has been chmod 755.


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




Re: [PHP] Re: Running php program when mail received

2002-05-19 Thread CDitty

I get this error and the program code outputted to the screen.

Failed loading 
/usr/local/Zend/lib/ZendOptimiser.so: 
/usr/local/Zend/lib/ZendOptimiser.so: cannot open shared object file: No 
such file or directory

I just looked in that directory and there is a ZendOptimizer.so file.  I 
copied it to ZendOptimiser.so and ran it again.  No error, but still 
getting the code output.

Chris

At 11:17 PM 5/19/2002, you wrote:
On 05/20/2002 12:38 AM, Cditty wrote:
Hello all.  I am trying to write a small program that will run everytime 
an email is received at a certain mailbox on my sever.  I had this 
running at one time, but for some reason, it will not run.  I am not 
getting any errors and I can't figure out what is going on.  Below is the 
code that I am trying to run.
#!/usr/bin/php -q
### CHANGE VALUES OF THE FOLLOWING VARIABLES ###
$to = [EMAIL PROTECTED];
$subj = message;
$hdrs = From: [EMAIL PROTECTED]\n;
$msg = This is going out;
mail($to, $subj, $msg, $hdrs);
This is what is returned in the maillog file.
May 19 22:29:07 server1 sendmail[3502]: WAA03501: 
to=|/path/to/file/imap.php, delay=00:00:00, xdelay=00:00:00, 
mailer=prog, stat=Sent
Can anyone point me in the right direction?  The script has been chmod 755.

What happens when you do /usr/bin/php -q /path/to/file/imap.php ?

--

Regards,
Manuel Lemos


--
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] Array loop help

2002-05-09 Thread CDitty

Can someone offer any help with the code below? I have a cookie that is
set and is separated by pipes (|). For each segment, I have to look up
the id in a text file. I can loop through the cookie and get each segment,
but when I open the text file and loop through it, it only matches the
first segment.

Any help is appreciated.

?
if(!IsSet($HTTP_COOKIE_VARS[test])){
 setcookie(test, 43|50|77|84|, time()+31536000); /* expire in 1 
year */
}

$myCookie = explode(|,$HTTP_COOKIE_VARS[test]);
foreach ($myCookie as $v){
 echo $v .  ;

 $links_database = c:\\program

 files\\web_dev\\apache\\htdocs\\link.db;
 $fd = fopen($links_database, r);
 $contents = fread($fd, filesize($links_database));

 $cookieInfo = explode(|, $contents);

 //foreach ($cookieInfo as $a){
 while(list($key, $value) = each($cookieInfo)){
 if($v == $cookieInfo[0]){
 print Link Info: $cookieInfo[1]\nbr;
 }
 }
 fclose($fd);
}
?

Thanks

Chris



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




[PHP] Stripping characters.....

2002-04-28 Thread CDitty

Hello all,

Does anyone have any snippets of code that will strip several characters 
from a string?  I am trying to figure out how to do this without using 3 
different if statement blocks.  This is what I am looking for.

ieUser email address is Chris Ditty 
[EMAIL PROTECTED]  or  Chris Ditty [EMAIL PROTECTED]

I need to be able to strip the quotes and everything between them and the 
  signs from the first one and then the name and the   signs from the 
second.

Does anyone know how to do this quickly and easily?

Thanks

CDitty


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




Re: [PHP] Mass Mail {?!}

2002-04-21 Thread CDitty

How about something like this.

?

$Total_emails = 100;
$i = 1;

if($Total_emails != $i){
// send email code

$i++;
}

?

This should be all you need.  I used something similar to crash my work's 
email system by accident.  :)  Whoops.

CDitty

At 12:40 PM 4/22/2002 +1000, Liam MacKenzie wrote:
Hey all,
I was just wondering if someone's written a script that will let me send 
lots of emails to an address, but with a small pause inbetween emails.

And no I'm not using this for spam, I need to test a SMTP server that I'm 
developing.

Thanks for your help!


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




[PHP] Search replace text

2001-02-11 Thread CDitty

Hello all.  I am trying to search through a text file on my server to 
replace the user email.  I can open the file and read it, but cannot get it 
to "find" the actual string and replace it.  Can someone look over my code 
and see what the problem is?  I am afraid that ereg is not my strongest 
point.

Also, at what point should I start writing the file out?  Wouldn't there be 
a permissions error if I was reading and writing at the same time?

Thanks
CDitty


$oldemail = "[EMAIL PROTECTED]";
$newemail = "[EMAIL PROTECTED]";
$user = "cditty";
$file = fopen("/path/to/the/user/file/$user.dat", "r");
if(!$file){
 echo "pUnable to open remote file.\n";
 exit;
}else{
 echo "Successbr";
}
while (!feof($file)) {
 $line = fgets($file, 255);
 if(eregi($oldemail, $line, $out)) {
 str_replace($oldemail, $newemail, $line);
 }

echo $line . "BR";
}
fclose($file)


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




[PHP] Unexpected character in input: '\'

2001-02-09 Thread CDitty

I am trying to write a text file on my server, but I am getting the 
following error.
Unexpected character in input: '\' (ASCII=92) state=1

Here is my code for the text file.
$file = "/path/to/my/server/$userid.win";
$text = "\n";
$fp = fopen($file, "w");
fwrite($fp, $text);
fclose($fp);

I am getting this error BEFORE it tries to write the file.

Can anyone offer any ideas or solutions?

Thanks

CDitty


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




Re: [PHP] Unexpected character in input: '\' (ASCII=92) state=1

2001-02-09 Thread CDitty

My apologies.  I should have said what line the error was on.  The problem 
lines was $text = "\n";.  I tried an experiment and put a space before the 
\ and that got rid of the error.  Go figure.

Chris

At 06:53 PM 2/9/01, Gobins, Debbie wrote:
You might try this, putting the escape character around the userid.

$file = "/path/to/my/server/\"$userid.win\"";


  Unexpected character in input: '\' (ASCII=92) state=1
 
  Here is my code for the text file.
  $file = "/path/to/my/server/$userid.win";
  $text = "\n";
  $fp = fopen($file, "w");
  fwrite($fp, $text);
  fclose($fp);
 
  I am getting this error BEFORE it tries to write the file.

What's in $userid?


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


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




[PHP] Date/Time from Unix timestamp

2001-01-24 Thread CDitty

Ok, I have looked at all my sources, including the manual and I cannot find 
any method of converting the Unix timestamp to a displayable date/time.   I 
have probably just overlooked it each time, but all I can find are methods 
to convert the current date/time to a Unix timestamp.

Can anyone give me an example?  iewhat date/time does 977676902 come 
out to?

Thanks

CDitty


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




Re: SV: [PHP] Array help needed

2001-01-18 Thread CDitty

Thanks.  Getting this error.  Cannot increment/decrement overloaded objects 
nor string offsets.  Any idea?

Chris

At 05:54 AM 1/18/01, Knut Stre wrote:
Try this:

$array = array(1,2,3,4,5,3,3,1);
foreach(array_values($array) as $s)
{
$count[$s]++;
}
foreach(array_keys($count) as $s)
{
echo "Number: " .  $s. " count: " .  $count[$s] . "Br";
}




  -Opprinnelig melding-
  Fra: CDitty [mailto:[EMAIL PROTECTED]]
  Sendt: 18. januar 2001 12:40
  Til: [EMAIL PROTECTED]
  Emne: [PHP] Array help needed
 
 
  Hello all,
 
  I have 6 numbers that are in an array.  I need to know how
  many times each
  number shows up in that array.
 
  ex
  Numbers: 1,3,5,1,4,1
 
  Output needed:  (Not necessarily like this)
  1 3
  3 1
  5 1
  4 1
 
  Can anyone help me with this?  I looked in the manual, but
  couldn't find
  anything that was quite what I needed.  I have tried sorting then
  array_count_values, but ended up with a result like this.
  Some results
  have counts, some don't.
 
  1
  2 1
  4 1
  4
  4 3
  5 1
 
  Thanks
 
  Chris
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
  [EMAIL PROTECTED]
 


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




Re: [PHP] Array help needed

2001-01-18 Thread CDitty

Thanks.  Didn't see that myself.

Thanks for the help

Chris

At 10:28 AM 1/18/01, [EMAIL PROTECTED] wrote:
Addressed to: CDitty [EMAIL PROTECTED]
   [EMAIL PROTECTED]

** Reply to note from CDitty [EMAIL PROTECTED] Thu, 18 Jan 2001 
06:58:22 -0600

I see someone else has another suggestion that might be better, using
array_count().  You learn something new every day, which is why I watch
this list...


anyway, the thing I see in your code:

 
  while(list($index, $value) = each($dice)){ // Changed from $Input to
   ^

 $Output[$Value]++; }
   ^

$Value != $value



I know my use of caps or not in this example sucks.  I usually always
use Caps On Each Word for my var names, but I am trying to switch to
what appears to be the php standard, lower case everywhere.  Sorry
about that...




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com


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