Re: [PHP] php-not-executing-in-html-file-help

2005-03-20 Thread Ian Firla

You need to tell apache to run html files through the php interpreter:

ie. AddType application/x-httpd-php .php .php3 .html

then restart apache

Ian

On Sun, 2005-03-20 at 14:12 -0800, vijayaraj nagarajan wrote:
 hi friends
 i am struggling to solve this problem for the past one
 week...kindly help me..
 
 my apache runs perfectly...
 this code gives a perfect output in the browser...
 
 file name: hi.html
 
 htmlbody
 hihihi
 /body/html
 
 but this code doesnot give any output in the
 browser...
 
 file name: hi.html
 
 htmlbody
 ?php echo hihihi; ?
 /body/html
 
 but, the same file with the php code in it...could be
 executed in the command line, using php... where i am
 getting the expected output...
 
 i tested to c if my apache doesnt recognise php ...
 
 this code runs perfectly...in the browser...
 
 ?php echo hihihi; ?
 
 if saved as hi.php file...
 the same code saved as .html, is not giving any output
 in the browser...
 
 kindly help me to figure out this problem...
 
 thanks
 
 vijayaraj nagarajan
 graduate student
 the university of southern mississippi
 MS - USA
 
 
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 
-- 
Ian Firla Consulting
http://ianfirla.com

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



Re: [PHP] unexplainable - page generation time class

2005-03-06 Thread Ian Firla

I think the problem is how, when and where you're calling things.

Basically, your code is fine. I modified it slightly and get the correct
output. This could still be cleaned up and optimised significantly;
however, I think you can take it from here:

Your Class:

?php
class page_gen {
//
// PRIVATE - DO NOT MODIFY
//
var $cls_start_time;
var $cls_stop_time;
var $cls_gen_time;

//
// FIGURE OUT THE TIME AT THE BEGINNING OF THE PAGE
//

function start() {
$microstart = explode(' ',microtime());
$this-cls_start_time = $microstart[0] + $microstart[1];
return $this-cls_start_time;
}

//
// FIGURE OUT THE TIME AT THE END OF THE PAGE
//
function stop() {
$microstop = explode(' ',microtime());
$this-cls_stop_time = $microstop[0] + $microstop[1];
return $this-cls_stop_time;
}

//
// CALCULATE THE DIFFERENCE BETWEEN THE BEGINNNG AND THE END AND
COLOR CODE THE RESULT
//
function gen($start, $stop) {
$this-cls_gen_time = $stop - $start;
return $this-cls_gen_time;
}
}
?

index php that calls it:

?PHP

require_once(timer.php);

$page_gen = new page_gen;

$start=$page_gen-start();
sleep(2);
$stop=$page_gen-stop();

echo(start/stop: $start $stopbrbr);

$gentime=$page_gen-gen($start, $stop);

echo generation time: . $gentime;

?

Output:

start/stop: 1110096261.12 1110096263.13

generation time: 2.00168681145

All the best,

Ian

---
Ian Firla Consulting
http://ianfirla.com

On Sat, 2005-03-05 at 22:04 -0700, James Williams wrote:
 Howdy!  I've made a class which simply determines the page generation 
 time of a php script... After pretty much an hour of straight examining 
 the code and trying tons of different things, no good has come of it, 
 however I can't find an error... anywhere.
 
 ?php
 class page_gen {
 //
 // PRIVATE - DO NOT MODIFY
 //
 var $cls_start_time;
 var $cls_stop_time;
 var $cls_gen_time;
 
 //
 // FIGURE OUT THE TIME AT THE BEGINNING OF THE PAGE
 //
 function start() {
 $microstart = explode(' ',microtime());
 $this-cls_start_time = $microstart[0] + $microstart[1];
 }
 
 //
 // FIGURE OUT THE TIME AT THE END OF THE PAGE
 //
 function stop() {
 $microstop = explode(' ',microtime());
 $this-cls_stop_time = $microstop[0] + $microstop[1];
 }
 
 //
 // CALCULATE THE DIFFERENCE BETWEEN THE BEGINNNG AND THE END AND 
 COLOR CODE THE RESULT
 //
 function gen() {
 $this-cls_gen_time = $this-cls_stop_time - 
 $this-cls_start_time;
 return $this-cls_gen_time;
 }
 }
 ?
 
 What happens is it simply returns the $this-cls_start_time variable.  
 
 Both the start() and stop() functions work fine because to test them I 
 put print commands at the end and they both returned proper results, the 
 error appears to be in the line where I minus the start time from the 
 end time.  It simply returns a negative start time instead of minusing 
 the two.
 
 I tried changing the minus to a plus for testing sake and it just took 
 out the negative.  Does anybody have any idea what is going on here?  
 Thanks-you
 

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



Re: [PHP] Bypassing php.ini setting for file uploads?

2005-03-02 Thread Ian Firla

There're all kinds of threads on this if you google around for a bit but
one good on in my bookmarks is:

http://www.webdevforums.com/showthread.php?t=7231

Ian

On Wed, 2005-03-02 at 09:39 -0800, Matt Cassarino wrote:
Hi,

I am trying to modify the php.ini settings for post_max_size and 
upload_max_filesize to allow for a custom script to upload files larger than 
8MB, the default size limit set in php.ini.  This is on a shared server, and 
my hosting company won't modify the limitation, although they will charge me 
$50/hr to code a custom script.  Whatever!  I'll just do it myself... but I 
don't know how.

Also, http://docs.php.net/en/function.ini-set.html tells me that for 
post_max_size and upload_max_filesize: Entry can be set in php.ini, .htaccess 
or httpd.conf.

Any help would be greatly appreciated!!

Thanks,

Matt Cassarino
Cell: (206) 484-4626
Web: www.mattcass.com
Email: [EMAIL PROTECTED]

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



Re: [PHP] Writing new code vs. re-writing someone else's code

2004-12-21 Thread Ian Firla

Good question.

Personally, I think I tend to write more new code than reworking old
code. However, I have taken on numerous projects where I've been
required to port ASP to PHP and MSSQL dbs to Postgre or MySQL... but
these projects also require a fair bit of new code.

There are *so* many legacy COBOL applications though that, yeah, I think
a COBOL programmer will very rarely get to write anything new. The
people who I know who work with COBOL generally either patch problems
or, if there's new functionality required, will code in Java or C.

Ian

On Tue, 2004-12-21 at 11:41 +0100, Eakin, W wrote:
 Hello,
 This question could be seen as a general programming question, but 
 because PHP is what I know best, I'll ask it here.
 
 A good friend of mine is the person who got me more interested in 
 programming as a career. She's a professional COBOL programmer, and 
 works for a large bank. She once told me that 75% of her time was spent 
 going over and rewriting/repairing old code that she didn't write, and 
 only 25% writing new code. From what I know about COBOL, it seems that 
 it might need more rewriting than other languages, because of all the 
 built up old code. But as I look forward to the day when I can work as a 
 full-time PHP coder, I wonder. The question is, how much of your time 
 (you, the professional PHP coder reading this), is spent 
 rewriting/repairing old code vs. writing new code. Although this is a 
 PHP list, and my question is in regards to PHP, if you want to give me 
 your opinion on this same question in regards to other languages you've 
 programmed in, I wouldn't mind.
 
 thanks,
 William
 

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



Re: [PHP] Uncompressing files on server

2004-12-20 Thread Ian Firla

Which platform?

How are the files compressed?

Do you have access to the commandline on your server?

Ian

On Sun, 2004-12-19 at 23:00 -0500, Josh wrote:
 I have some PHP files from a content management system.  I uploaded the
 compressed files to the server, but how do I un-compress them now?  I am
 using Filezilla.  Can it be done, or do I have to uncompress the file on my
 computer and then upload?
 
 thanks
 

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



[PHP] mixed strings

2004-12-18 Thread Ian Firla

Hi All,

I'm wondering if anyone knows if there's a way of sending strings of
mixed type to a UDP socket.

I'm storing the data I need to send in an array. Parsing the array with
a foreach, I'm sending out the various pieces to the socket with fwrite.

Unfortunately, it seems that UDP terminates each message and the client
is expecting everything in one chunk with each byte of a specific type
(ie. ASCII, INTEGER, BCD)

Is there any way I can write a string of mixed types to an open UDP
socket as a single message?

Ian

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



Re: [PHP] File-handling

2004-12-17 Thread Ian Firla

fgets uses the resource created by fopen.

Read the manual:

http://it.php.net/fopen

http://it.php.net/fgets

look at the example:

?php
$handle = fopen(/tmp/inputfile.txt, r);
while (!feof($handle)) {
   $buffer = fgets($handle, 4096);
   echo $buffer;
}
fclose($handle);
?

Ian

On Fri, 2004-12-17 at 11:24 +0100, [EMAIL PROTECTED] wrote:
 Hi there!
 
 Can someone explain the major difference between fgets and fopen? Which is
 the best together with plain textfiles? and why?
 
 eof and feof. What's the difF? *don't get it*
 
 When using fget. Is it something special you should think when taking care
 of line-breaks? (/n, /r/n ...)
 
 /G
 

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



Re: [PHP] Using constructs like unset() in expressions like ()()

2004-12-16 Thread Ian Firla
Ciao Tomas,

I'm not sure if I followed your question completely but do you mean to
test a variable or an array element and unset it if it matches a certain
type?

If so, then maybe:

http://it.php.net/is_int

is_bool(), is_float(), is_numeric(), is_string(), is_array(), and
is_object()

will be of help?

Ian

On Wed, 2004-12-15 at 22:36 +0100, Tomas Tintera wrote:
 Hi all.
 
 Is there some construct, which evaluates any type of its parameter (like 
 t_echo, t_unset) and returns some value with normal type (like 0)? What?
 
 I would like to unset a variable in an operation like ()?unset():() and 
 I can not use if because if does not return normal type of value 
 (like 0 or 'a') and can not be used in operations like ()  ().
 
 Tomas Tintera
 

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



Re: [PHP] cURL FTP

2004-12-15 Thread Ian Firla
On Wed, 2004-12-15 at 08:27 -0500, Lowell Allen wrote:

snip 
 $fh = fopen(test.txt, r) or die($php_errormsg);
/snip

Try opening the file rw. At the moment, you're opening it read only.

Ian

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



Re: [PHP] Byte Array

2004-12-14 Thread Ian Firla
On Tue, 2004-12-14 at 08:40 -0800, Richard Lynch wrote:
 Ian Firla wrote:
 
  Just a follow-up to myself... I decided to try packet sniffing to see
  what was going on and ettercap confirms that I'm sending out strings
  rather than data of the type stored in my array:
 
  16:12:26  192.168.0.101:32779 -- 192.168.0.88:32896 | UDP |
 
   : 3331 31
 
  That 31 should be an integer of only one byte, not two.
 
 I suspect that PHP is converting your integers into strings at some point,
 as you build the array...
 
 *WHERE* it is doing that is difficult to say, without seeing more code.
 
  The function that's doing the sending looks like this:
 
  function send_back($sock, $msg, $ip, $port) {
  $fp = fsockopen(udp://$ip, $port, $errno, $errstr);
  foreach ($msg as $msg_to_send) {
 
 //To confirm my suspicion that you have a string here:
 error_log(The type of $msg_to_send is  . gettype($msg_to_send));
 //Now go check your PHP error log (default: Apache error_log)

Thanks Richard.

I thought of that too and have since expanded my debugging. The types
are correct when passed to fwrite. They come out the other end as
strings:

16:39:54 SENT 'K' of type string
16:39:54 SENT '0' of type integer
16:39:54 SENT '0' of type integer
16:39:54 SENT '65' of type integer
16:39:54 SENT '31' of type integer

15:46:10  192.168.0.101:32778 -- 192.168.0.84:32896 | UDP |

 : 4b   K


15:46:10  192.168.0.101:32778 -- 192.168.0.84:32896 | UDP |


 : 30   0


15:46:10  192.168.0.101:32778 -- 192.168.0.84:32896 | UDP |

 : 30   0


15:46:10  192.168.0.101:32778 -- 192.168.0.84:32896 | UDP |

 : 3635 65


15:46:10  192.168.0.101:32778 -- 192.168.0.84:32896 | UDP |

 : 3331 31

As you can see, the last two elements 65 and 31 have arrived as
strings of two bytes rather than integers of one.

Ian


  fwrite($fp, $msg_to_send);
  echo date(H:i:s). SENT '$msg_to_send'\n; //seen server 
  side
  }
  fclose($fp);
  }
 
  Can anyone see where I might be going wrong? Why am I not sending the
  integers as integers and the binary bits as binary bits?
 
 -- 
 Like Music?
 http://l-i-e.com/artists.htm
 

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


[PHP] Byte Array

2004-12-13 Thread Ian Firla

Hello All,

I've hit a bit of a show stopper in a project I'm working on.

I'm getting a 65 byte stream of data. 32 of those bytes are of the type
Byte Array. Is there a way that I can covert that data into something
useful?

For the record, the data stream that I'm getting is in the format:

|ascii|ascii|asciiX10|integerX4|byte arrayX32|

The byte array looks like this: 
g..UA9x|%r9.

Any ideas?

Ian

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



Re: [PHP] Byte Array

2004-12-13 Thread Ian Firla

You're right. I think it will. Thanks.

I've got another issue now though which may indeed be a show-stopper.

It seems that while socket_recvfrom is binary safe, there's no way to
send data in any way other than a string... Is that right? Can I not
send data of other types?

Ian

On Mon, 2004-12-13 at 07:57 -0800, Chris wrote:
 Try the unpack function, it should do quite nicely.
 
 Chris
 
 Ian Firla wrote:
 
 Hello All,
 
 I've hit a bit of a show stopper in a project I'm working on.
 
 I'm getting a 65 byte stream of data. 32 of those bytes are of the type
 Byte Array. Is there a way that I can covert that data into something
 useful?
 
 For the record, the data stream that I'm getting is in the format:
 
 |ascii|ascii|asciiX10|integerX4|byte arrayX32|
 
 The byte array looks like this: 
 g..UA9x|%r9.
 
 Any ideas?
 
 Ian
 
   
 
 

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



Re: [PHP] Byte Array

2004-12-13 Thread Ian Firla

Just a follow-up to myself... I decided to try packet sniffing to see
what was going on and ettercap confirms that I'm sending out strings
rather than data of the type stored in my array:

16:12:26  192.168.0.101:32779 -- 192.168.0.88:32896 | UDP |

 : 3331 31

That 31 should be an integer of only one byte, not two.

The function that's doing the sending looks like this:

function send_back($sock, $msg, $ip, $port) {
$fp = fsockopen(udp://$ip, $port, $errno, $errstr);
foreach ($msg as $msg_to_send) {
fwrite($fp, $msg_to_send);
echo date(H:i:s). SENT '$msg_to_send'\n; //seen server 
side
}
fclose($fp);
}

Can anyone see where I might be going wrong? Why am I not sending the
integers as integers and the binary bits as binary bits?

Ian

On Tue, 2004-12-14 at 12:12 +0100, Ian Firla wrote:
 You're right. I think it will. Thanks.
 
 I've got another issue now though which may indeed be a show-stopper.
 
 It seems that while socket_recvfrom is binary safe, there's no way to
 send data in any way other than a string... Is that right? Can I not
 send data of other types?
 
 Ian
 
 On Mon, 2004-12-13 at 07:57 -0800, Chris wrote:
  Try the unpack function, it should do quite nicely.
  
  Chris
  
  Ian Firla wrote:
  
  Hello All,
  
  I've hit a bit of a show stopper in a project I'm working on.
  
  I'm getting a 65 byte stream of data. 32 of those bytes are of the type
  Byte Array. Is there a way that I can covert that data into something
  useful?
  
  For the record, the data stream that I'm getting is in the format:
  
  |ascii|ascii|asciiX10|integerX4|byte arrayX32|
  
  The byte array looks like this: 
  g..UA9x|%r9.
  
  Any ideas?
  
  Ian
  

  
  
 

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



[PHP] passing resources from one script to another

2004-11-11 Thread Ian Firla

Hi All,

I'm developing a small server application that accepts connections on a
socket and then launches an interactive session with the client.

The server needs to be able to accept N connections. This part is
working famously thanks to code I've borrowed and modified from:

http://www.zend.com/lists/php-dev/200205/msg00286.html

The problem is the dialogue with the client. If I enter into a while
loop then the whole script remains occupied and cannot accept new
connections.

If I try to open a new background process with exec, then I need to pass
a resource from the listening script to the dialogue script. However, it
seems that I cannot pass a resource between scripts.

If I serialize the resource, passing it as a string to the dialogue
shell script, then unserialize it in the dialogue script, it's no longer
a resource but an integer...

Any ideas on how to get around this problem? Can it be done with PHP?

Ian

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



Re: [PHP] passing resources from one script to another

2004-11-11 Thread Ian Firla

I should have specified that this is a shell script, not a web
application.

I have a listening process running. The listening process calls another
script once a connection is established. This is done via exec.

It works; however, I can't pass a resource directly to the other script.
Therefore, I've passed the resource to serialize() and pass the
resulting string to the other script as an argument. My idea was to
unserialize the string in that script. I expected to get a resource
back; unfortunately, I get an integer.

My question is: is there any way to pass a Resource between scripts?

Ian

On Thu, 2004-11-11 at 15:36 +0100, Sebastiano Cascione wrote:
 I'm not shure to understand what you are looking for...
 
 You can build a message queue into a text file, every message in the queue 
 will contain the pid as identifier of every socket connetion (the client) and 
 the target pid. 
 This is not a fast solution, but it models a messages system that is 
 indipendent from the server. For example, this queue colud be readed from the 
 client every time it launchs an avent, ect..
 
 A question, why don't use session vars? (or an array of them?)
 
 Sebastiano
 
 
 Alle 15:15, giovedì 11 novembre 2004, Ian Firla ha scritto:
  Hi All,
 
  I'm developing a small server application that accepts connections on a
  socket and then launches an interactive session with the client.
 
  The server needs to be able to accept N connections. This part is
  working famously thanks to code I've borrowed and modified from:
 
  http://www.zend.com/lists/php-dev/200205/msg00286.html
 
  The problem is the dialogue with the client. If I enter into a while
  loop then the whole script remains occupied and cannot accept new
  connections.
 
  If I try to open a new background process with exec, then I need to pass
  a resource from the listening script to the dialogue script. However, it
  seems that I cannot pass a resource between scripts.
 
  If I serialize the resource, passing it as a string to the dialogue
  shell script, then unserialize it in the dialogue script, it's no longer
  a resource but an integer...
 
  Any ideas on how to get around this problem? Can it be done with PHP?
 
  Ian

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



Re: [PHP] passing resources from one script to another

2004-11-11 Thread Ian Firla

Thanks Greg.

That is what I'm doing.

The problem remains passing a resource to the script executed by exec.

Ian

On Thu, 2004-11-11 at 08:45 -0600, Greg Donald wrote:
 On Thu, 11 Nov 2004 15:15:56 +0100, Ian Firla [EMAIL PROTECTED] wrote:
  The problem is the dialogue with the client. If I enter into a while
  loop then the whole script remains occupied and cannot accept new
  connections.
 
 PHP doesn't have threads.. and that's what you would need to accept
 more than a single connection at once.  You can simulate thread
 functionality to a degree using the PHP execution functions here:
 
 http://www.php.net/manual/en/ref.exec.php
 
 
 -- 
 Greg Donald
 Zend Certified Engineer
 http://gdconsultants.com/
 http://destiney.com/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 F

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



Re: [PHP] How do I su to another account??

2004-11-11 Thread Ian Firla

Do you really need to switch users or do you need to run something as
another user?

Try looking into setting up and using sudo.

Ian

On Thu, 2004-11-11 at 09:20 -0500, Scott Fletcher wrote:
 How do I su (switch user) to another account from the nobody in php?  I
 haven't got it to work, so I get the impression that it is either I'm doing
 it all wrong in PHP script or that the nobody doesn't have the authority to
 do so.
 
 Have anyone who ever successfully do it please post a sample script?
 
 Thanks,
  Scott
 

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



Re: [PHP] Most efficient way of fetching 1,000 records from MySQL ?

2004-10-25 Thread Ian Firla

I think you'll find that your first approach is not only more correct,
it's the only manageable one.

Ian

On Mon, 2004-10-25 at 10:15 +0200, Steve McGill wrote:
 Hello,
 
 In my script I have generated an array of 1,000 userIDs for example. Now for
 I need to fetch each user's record and I am wondering what is the best way
 to go about it:
 
 1) 1000 sql queries
 
 // code is sort of pseudo for clarity
 
 foreach($users as $userID) {
   $user = sql(select * from users where userID = '$userID');
   // bla bla
 }
 
 2) 1 query
 
 $users = sql(select * from users where userID='1' or userID='2' or
 userID='5' or userID='10');
 
 I imagine the 2nd one would be a bit of a nightmare for MySQL to parse, if
 it gets too long?
 
 Or am I missing a more efficient 3rd / 4th option?
 
 Many thanks in advance for your help.
 
 Steve McGill
 

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



Re: [PHP] PHP App User Permissions Tecnique

2004-10-15 Thread Ian Firla

Definitely store them in a session. A db lookup will mean a much heavier
and process intensive procedure.

Ian

On Fri, 2004-10-15 at 09:41, Brendon wrote:
 I am building a web based community forum type software using PHP. I am 
 currently working on how different user privelages are handled. Each 
 user is part of a group and each group has varying degrees of privelages.
 
 I need to add in functionality which at the begginning of every script 
 check the permission level of the user accessing the page. There are 
 about 15 different permissions.
 
 I am debating whether i should store all the permission abilities into 
 session variables and they can quickly be checked throughout the script, 
 or whether i should query the database to check to see if the user has 
 adequate group permissions to perform a certain function.
 
 Could someone give me some advice as to which would be more advisable?

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



Re: [PHP] Re: crypt()

2004-08-26 Thread Ian Firla
On Thu, 2004-08-26 at 15:01, Aaron Todd wrote:
 Thanks for the tip, it worked great, however everything I have been reading 
 says that md5 is only one way.  The way I have setup my app is the database 
 contains the encrypted version of what the user entered as their password. 
 Then on my login page there is an if statement that encrypts what the user 
 is entering as their password and then checking that against what is in the 
 database for them.  This is working great!...Thanks again.
 
 My registration page is where the password gets encrypted and then sent to 
 the database.  After the user registers and I accept them as a user they 
 recieve an email containing their username and password.  But the password 
 is encrypted.  Is there a way to decrypt the encrypted password in the 
 database?  Or am I going about this wrong?

Send the password before it gets encrypted and put into the database.

You can't decrypt an md5 encrypted password.

Ian

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



[PHP] session cookie paths

2004-08-25 Thread Ian Firla

Dear All,

I've been trying to figure out a solution for this problem and have
googled the subject but cannot come up with anything meaningful.

I have several applications running on my server which use php and
sessions.

In each case, logging out from an application destroys the session.

The trouble is that all the applications (four of them) share the same
id: PHPSESSID and path: /

My first hunch is to try to use .htaccess in each application's root
directory to override these php.ini variables. Am I on the right track?

Regards,

Ian

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



Re: [PHP] session cookie paths

2004-08-25 Thread Ian Firla

Answered my own question.

Creating an .htaccess file containing:

php_value session.name uniqueSESSIONname

takes care of the problem.


On Wed, 2004-08-25 at 12:30, Ian Firla wrote:
 Dear All,
 
 I've been trying to figure out a solution for this problem and have
 googled the subject but cannot come up with anything meaningful.
 
 I have several applications running on my server which use php and
 sessions.
 
 In each case, logging out from an application destroys the session.
 
 The trouble is that all the applications (four of them) share the same
 id: PHPSESSID and path: /
 
 My first hunch is to try to use .htaccess in each application's root
 directory to override these php.ini variables. Am I on the right track?
 
 Regards,
 
 Ian

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



Re: [PHP] fatal error undefined call to mysql_connect

2004-08-25 Thread Ian Firla

On Wed, 2004-08-25 at 17:08, Angelo Zanetti wrote:
 I never installed it so... here is my next question. how would I find out how it was 
 installed?

Look at the output of phpinfo(). But before doing that, read the
documentation or you'll be back here in a flash with more really basic
questions.

A very good source for answers is also php.net. Try typing in some of
your problem terms like mysql into the search query.

Ian

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



[PHP] connecting to MySQL from shellscript

2004-03-11 Thread Ian Firla

Hello all,

I have a shellscript written in php that needs to connect to a mysql
database. Everything I've been reading suggests that this cannot be done
easily. Is this true?

The one workaround I've found is:

http://www.phpbuilder.com/annotate/message.php3?id=1012940

But it's very inelegant and likely to impact on performance with a
script that is being launched several hundred times an hour.

Ideas?

Ian

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



Re: [PHP] connecting to MySQL from shellscript

2004-03-11 Thread Ian Firla

Thanks everyone for your advice.

The problem appears to be with the debian package which I was using. I
tried compiling php from source as Adam suggested and the script now
runs flawlessly.

Ian

On Thu, 2004-03-11 at 16:47, Ian Firla wrote:
 Hello all,
 
 I have a shellscript written in php that needs to connect to a mysql
 database. Everything I've been reading suggests that this cannot be done
 easily. Is this true?
 
 The one workaround I've found is:
 
 http://www.phpbuilder.com/annotate/message.php3?id=1012940
 
 But it's very inelegant and likely to impact on performance with a
 script that is being launched several hundred times an hour.
 
 Ideas?
 
 Ian

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



Re: [PHP] MySQL Connection

2004-03-04 Thread Ian Firla

I think you've just answered your own question here:

I get a Can't Connect to MySQL Server error.  I am not sure if it is
localhost, since my webserver is on a different machine with a different
name.  The MySQL installation is on a different machine, separate from
the web server with its own machine name.

Your mysql_connect call should be to the ip address or hostname of the
machine running mysqld.

Make sure that mysql is configured to allow user test to connect from
the machine you're connecting from. Also, make sure that mysql is
configured to accept network connections. Finally, make sure that any
firewalls you have between the machines allow tcp/ip traffic on port
3306.

Ian

On Thu, 2004-03-04 at 22:38, [EMAIL PROTECTED] wrote:
 Hi There,
 
 I'm trying to establish a first time connection to MySQL running on Win
 2000.  I have loaded the application and have entered a user name and
 password.  The code that I am entering to establish a connection is:
 
 ?php
 $conn=mysql_connect(localhost, test, test);
 Echo $conn;
 ?
 
 I get a Can't Connect to MySQL Server error.  I am not sure if it is
 localhost, since my webserver is on a different machine with a different
 name.  The MySQL installation is on a different machine, separate from the
 web server with its own machine name.
 
 I looked at the my.ini file and the username and password paramaters match.
 Also, the MySQL admin is showing the host info as localhost via TCP/IP.  The
 version is 1.4
 
 The Start Check is showing a yes for an ini file, Ok for MySQL server path
 key, datadir, and basedir.
 
 Any assistance from you would be greatly appreciated.
 
 Thanks,
 
 Shawn
 
 
 
 

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



Re: [PHP] values from string query

2004-03-01 Thread Ian Firla

Try echoing your query and pasting it into mysql to make sure that the
problem isn't in the structure of your query.

Your connect statement selects a db, right?

Ian

On Thu, 2004-03-25 at 14:01, Angelo Zanetti wrote:
 HI all I have a Select that get a resultset, once I get this then I use the
 values of this resultset to enter them into another table using an INSERT
 statement. I get no errors from the statement but it just doesn't seem to
 see my variables from the recordset,
 
 below is my code:
 
 
 
 $q=select * from prospects where p_id = '$p_id';
   $result=mysql_query($q, $this-link) or die (.mysql_error());
 
   while($a_row=mysql_fetch_array($result))
   {
   $c_query=Insert into client (c_name, c_company, c_worktel, 
 c_directtel,
 c_hometel, c_fax, c_cell, c_email, c_address, c_city, c_pcode, c_country)
 VALUES ($a_row['p_name'], $a_row['p_company'], $a_row['p_worktel'],
 $a_row['p_directtel'], $a_row['p_hometel'], $a_row['p_fax'],
 $a_row['p_cell'], $a_row['c_email'], $a_row['c_address'], $a_row['c_city'],
 $a_row['c_pcode'], $a_row['c_country']);
   mysql_query($c_query,$this-link) or die (.mysql_error());
   }
 
 I echo'd out the values from the Select just to make sure it was getting the
 correct values.
 
 any help will be appreciated, thanx in advance
 
 Angelo
 
 
 Disclaimer 
 This e-mail transmission contains confidential information,
 which is the property of the sender.
 The information in this e-mail or attachments thereto is 
 intended for the attention and use only of the addressee. 
 Should you have received this e-mail in error, please delete 
 and destroy it and any attachments thereto immediately. 
 Under no circumstances will the Cape Technikon or the sender 
 of this e-mail be liable to any party for any direct, indirect, 
 special or other consequential damages for any use of this e-mail.
 For the detailed e-mail disclaimer please refer to 
 http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] redirecting

2004-02-17 Thread Ian Firla


Stick something like this in your html head/head:

meta HTTP-EQUIV=REFRESH CONTENT=5; URL=blah.php

Location won't work because you've already sent output to the browser.

Ian

On Wed, 2004-02-18 at 07:19, ajay wrote:
 hi!
 
 after having trawled through many google articles, i've been told that the best
 way to redirect a person is using header(Location:url);
 
 the problem is, i have form that is posted to another php script. This script then
 processes the form and then writes up a html page and includes in that page any
 warnings etc.
 i want the user to have say 5s to read that page and then be redirected to
 another page.
 so i have something like
 //process form
 //write page
 sleep(10);
 header(Location:blah.php);
 
 the problem is i get an error when the script gets to the header part, the error
 being
 Warning: Cannot modify header information - headers already sent by (output
 started at c:\program files\apache
 group\apache\htdocs\usydbasketball\subscribe_mailing_list.php:6) in c:\program
 files\apache group\apache\htdocs\usydbasketball\subscribe_mailing_list.php on
 line 67
 
 so how do i workaround that?
 
 thanks
 
 regards
 
 -- 
 ajay
 ---
 Who Dares Wins
 
 -
 This mail sent through IMP: www-mail.usyd.edu.au

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



Re: [PHP] mem

2004-02-17 Thread Ian Firla

Try this:

http://it2.php.net/manual/en/function.disk-free-space.php

(PHP 4 = 4.1.0)

disk_free_space -- Returns available space in directory

Ian

On Wed, 2004-02-18 at 07:25, John Taylor-Johnston wrote:
 I'm not even sure if this is a Unix thing, or if it can be done, but ...
 How can I read the amount of memory used in a directory /var/something/ (and maybe 
 sub-directories) and echo it?
 John

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



Re: [PHP] RE: Check to remove file that are older than 1 week

2004-02-17 Thread Ian Firla

On Fri, 2004-02-20 at 17:35, YC Nyon wrote:
 Hi,
 
 I want to delete files than are older than 1 week from a specific directory.
 Anyone mind to share their code? Can't anything on phpbuilder on this.
 
 Regards
 Nyon

I have a bash script that I use:

#! /bin/bash
# call as: ./delete_old.sh directory days
# days is the age limit for files you want to keep (ie. 3, 5, 7, etc)

find $2 -type f -mtime +$1 | xargs rm

Ian

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



Re: [PHP] A question about file creation

2003-11-02 Thread Ian Firla

http://it.php.net/manual/en/function.fwrite.php

On Sun, 2003-11-02 at 19:25, Yeung Koala wrote:
 Hi,
 
 Silly question of beginner:
 Is is possible to write a script to create and write a text file on server?
 How?
 
 
 P.S. Thanks Simon Stiefel for the chomp stuff
 
 _
 Hotmail Extra Storage10MB  
 http://join.msn.com/?pgmarket=zh-hk

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