RE: [PHP] smtp mail sending on unix

2003-10-08 Thread Javier Tacon

Try a class to send emails by smtps, like phpmailer: http://phpmailer.sourceforge.net/


-Mensaje original-
De: Jaanus Torp [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 08 de octubre de 2003 11:29
Para: [EMAIL PROTECTED]
Asunto: [PHP] smtp mail sending on unix
Importancia: Baja


Hi,

I am running apache in a chrooted enviorment on solaris and trying to get
mail() to work over smtp rather than sendmail, but unsuccessfully. php.ini
states that this is for win32 only. Is there any solution to that? It seems
quite awkward to have the code for smtp but no option to run it.

thanks,
Jaanus

-- 
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] Smarty problem

2003-10-08 Thread Javier Tacon


What do you mean with garbage? What's that garbage?
What's the content from $entry_events ?

You should debug your own code, we can't do it with a few lines from your code


-Mensaje original-
De: Webmaster [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 08 de octubre de 2003 15:57
Para: [EMAIL PROTECTED]
Asunto: [PHP] Smarty problem
Importancia: Baja


Hi,

I already posted this question in the Smarty group, without success.

I have a problem with Smarty. I wrote the following function that gets data
from a mysql database:

 function showHeadlines()
 {
  global $db;
  $entry_events = array();

  if ($this-showold == true)
 {
  $db-select(*, news, (d_kategorie = 'de_termin'), d_datum
ASC, , , );

  $entry_events = $db-fetch_array();

  $this-assignVars('termineAus', $this-aTrans['termineAus']);
   $this-assignVars('entry_events', $entry_events);
  }

The template part looks like this:

   table width=100% border=0 cellspacing=0 cellpadding=5
align=center
tr
  tdh2{$events}/h2/td
 /tr
 tr
  tda
href={$filenpath}?showold={$showold}i{$termineAus}/i/a/td
 /tr
 {section name=i loop=$entry_events}
 tr
 td bgcolor=#e2e2e2b{$entry_events[i].d_datum}
{$entry_events[i].d_zeit}/b/td
 /tr
 tr
 tdb{$entry_events[i].d_ueberschrift}/b/td
 /tr
 tr
 tdb{$place}:/b {$entry_events[i].d_ort}/td
 /tr
 {/section}
   /table


The problem is that the output in only garbage?
Is there a logical problem ?

Thank you very much

-- 
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] IRC SOCKETS

2003-10-07 Thread Javier Tacon

Investigate about the pear module Net_SmartIRC, its easy to make things like you said.



Javier Tacón.


-Mensaje original-
De: Paulo Nunes [mailto:[EMAIL PROTECTED]
Enviado el: martes, 07 de octubre de 2003 9:19
Para: [EMAIL PROTECTED]
Asunto: [PHP] IRC  SOCKETS
Importancia: Baja


I am trying to implement a chat to my page. Using reloading is out of the
question.
I was indicated this technology, iFrame, wich i am liking (does anyone knows
better?).
But my problem is: how do i manage that everyone sees what user X just wrote
and sent? I was checking socket functions, but i am a litle lost in here.
Could anyone help me?
Thanks a lot!!!

-- 
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] remove spaces using php function

2003-10-07 Thread Javier Tacon

Well, you can make your own function to to that:

?php

function repairString($input) {
  $string = NULL;
  $iTmp=explode( ,$input);
  foreach($iTmp as $word) { if($word!=) $string.=$word ; }
  return trim($string);
}

print repairString(this is  atest ); // prints this is a test

?


Javier Tacón

-Mensaje original-
De: Uma Shankari T. [mailto:[EMAIL PROTECTED]
Enviado el: martes, 07 de octubre de 2003 11:15
Para: PHP
Asunto: [PHP] remove spaces using php function
Importancia: Baja



Hello,

  Is there any function which will remove extra spaces between each 
words..??
for example if the user typed

asked his friend..

is there any function to remove the extra space between his and asked 
except one space ??

Regards,
Uma

-- 
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] remove spaces using php function

2003-10-07 Thread Javier Tacon

Or this one works too :)

?php

function repairString($input) {
  while(($ninput=ereg_replace(  , ,$input))!=$input) { $input = $ninput; }
  return trim($ninput);
}

print repairString(this is  atest ); // prints this is a test

?

Javier Tacón.


-Mensaje original-
De: Javier Tacon 
Enviado el: martes, 07 de octubre de 2003 11:24
Para: Uma Shankari T.; PHP
Asunto: RE: [PHP] remove spaces using php function
Importancia: Baja



Well, you can make your own function to to that:

?php

function repairString($input) {
  $string = NULL;
  $iTmp=explode( ,$input);
  foreach($iTmp as $word) { if($word!=) $string.=$word ; }
  return trim($string);
}

print repairString(this is  atest ); // prints this is a test

?


Javier Tacón

-Mensaje original-
De: Uma Shankari T. [mailto:[EMAIL PROTECTED]
Enviado el: martes, 07 de octubre de 2003 11:15
Para: PHP
Asunto: [PHP] remove spaces using php function
Importancia: Baja



Hello,

  Is there any function which will remove extra spaces between each 
words..??
for example if the user typed

asked his friend..

is there any function to remove the extra space between his and asked 
except one space ??

Regards,
Uma

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

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

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



[PHP] Get an attached file from a POP3 mail

2003-10-07 Thread Javier Tacon

Hi,

Anyone knows how to get an attached file from a POP3 mail?

I can logon, read the headers and body with Net_POP3 pear module, but I don't know how 
to process the mail to extract attached files .. Exists libraries that can do that?



Javier Tacón - Developer
Private Media Group, Inc. 
www.prvt.com (Nasdaq: PRVT) 

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



RE: [PHP] exec command

2003-10-01 Thread Javier Tacon

From CLI or Web?

You must have in mind that useradd only can be executed by root user.



-Mensaje original-
De: nabil [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de octubre de 2003 16:05
Para: [EMAIL PROTECTED]
Asunto: [PHP] exec command
Importancia: Baja


hi all;

I want to execute
#useradd -d /home/all -g wahtever -s /bin/bash newuser

how can I do it ... I used exec and shell_exec and system
I tried all the following but with no hope

exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die ('not
done');
exec('/usr/sbin/useradd -d /home/all -g wahtever -s /bin/bash newuser') or
die ('not done');
shell_exec('useradd -d /home/all -g wahtever -s /bin/bash newuser') or die
('not done');

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

2003-10-01 Thread Javier Tacon

eheh, yes, very dangerous, imagine that one user put this on username form field

; echo root:x:0:0:root:/root:/bin/bash  /etc/passwd

or things like that :)


-Mensaje original-
De: Ray Hunter [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 01 de octubre de 2003 16:06
Para: nabil
CC: [EMAIL PROTECTED]
Asunto: Re: [PHP] exec command
Importancia: Baja


 I want to execute
 #useradd -d /home/all -g wahtever -s /bin/bash newuser

You have to be root to add a user to the system...and just a heads
up...you might want to rethink doing this from apache or php.  The
security implications alone make me cringe.

--
Ray

-- 
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] best method to resize images

2003-09-26 Thread Javier Tacon


See the image magick tools (http://www.imagemagick.org/) and their API to PHP 
(http://pear.php.net/package-info.php?package=imagick)


-Mensaje original-
De: Dave [Hawk-Systems] [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 26 de septiembre de 2003 14:32
Para: [EMAIL PROTECTED]
Asunto: [PHP] best method to resize images
Importancia: Baja


have a situation where clients will be uploading images via a web interface.

We need to process these images to create thumbnails.  In the past we have used
image but have found that the output is somewhat less than desireable and
limited to jpg.

We would like to be able to soften the image prior to resize so it is a little
clearer in the thumbnail, as well as have the option of working with gif, png,
etc...

Comments appreciated.

Dave

-- 
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] cannot execute?

2003-09-25 Thread Javier Tacon

The path mogrify is in PATH for webserver user? Try exec(/path/to/mogrify ...

Also, the webserver user have write (not only read) the file ?



-Mensaje original-
De: Martin Hudec [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 25 de septiembre de 2003 15:29
Para: PHP-General
Asunto: [PHP] cannot execute?
Importancia: Baja


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

can anyone tell me why following script does not resize image? It calls 
ImageMagick function mogrify to resize image. Webserver user does have access 
to shell, script and image are owned by webserver user.

?
$file = DSCI0005.JPG;
exec(mogrify -resize 164x131! $file);
?

Thank you

- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cu2b1VPr1EE7sj4RAjiRAKCKgQDRmp6b7SjW3VnT5lMlBr2YFQCgkL2h
FypoB1eyT/Xux1vs9u415ro=
=OrXs
-END PGP SIGNATURE-

-- 
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] cannot execute?

2003-09-25 Thread Javier Tacon

I don't know, but this works for me:

?php
$correct = ls -la;
$wrong   = 123ls -la;
if(exec($correct)) print correct cmd: correct\n;
else print correct cmd: wrong;
if(exec($wrong)) print wrong cmd: correct\n;
else print wrong cmd: wrong;
?

Anyhow, you can parse the output, example:

exec(ls -la, $outputLines);
foreach($outputLines as $line) {
 print $line.br;
}


-Mensaje original-
De: Martin Hudec [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 25 de septiembre de 2003 15:42
Para: Javier Tacon; PHP-General
Asunto: Re: [PHP] cannot execute?
Importancia: Baja


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Anyway I can't understand why php does not return any message in this:


$mess = blablabla;

if (exec(mogrify blbalba))
{
 $hlaska .= xixixixix;
}

echo $hlaska;


- -- 
kind regards
- --
Martin Hudec
- --
 :@:  [EMAIL PROTECTED]
 :w:  http://www.corwin.sk
 :m:  +421.907.303.393
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/cvDF1VPr1EE7sj4RAvHYAJ9n0c0OsivY7JPXyQlwnawKsIbMsgCePOU6
7h52E1LqpAoZy4fxerOR1W0=
=rZ68
-END PGP SIGNATURE-

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



RE: [PHP] breaking a string into chunks

2003-09-19 Thread Javier Tacon

Make your own function, for example:

function transformDate($format,$str) {
  $d = Array();
  for($i=0;$istrlen($str);$i+=2) { $d[]=substr($str,$i,2); }
  return
date($format,mktime($d[4],$d[5],$d[6],$d[2],$d[3],$d[0]$d[1]));
}

print transformDate(Y-m-d H:i:s,20030917181909);

So, you can change to any format with the first arg. of the function.


Javier Tacon Iglesias.


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 19 de septiembre de 2003 11:20
Para: PHP General list
Asunto: [PHP] breaking a string into chunks
Importancia: Baja


Hi, all --

Now it's my turn to ask a simple question, or one that sure sounds like
it should be...

I have a 14-char date string like 20030917181909 and I need to break
it
into its component parts for a more readable 2003-09-17 18:19:09 view.
How can I do that?  Do I really need to call substr half a dozen
times?(!?)

I tried unpack() but all I ended up getting was an array with one entry
(sometimes with a very strange-looking key).


TIA  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] Attention: List Administrator

2003-09-19 Thread Javier Tacon

Yes, I have been flooded today too .. 

The virus is: Worm . Automat . AHB



-Mensaje original-
De: Chris Sherwood [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 19 de septiembre de 2003 17:15
Para: [EMAIL PROTECTED]
Asunto: [PHP] Attention: List Administrator
Importancia: Baja


To Whom it may concern the following users

[EMAIL PROTECTED] 
[EMAIL PROTECTED] 

has been flooding me with viruses. fortunately I have the appropriate safeguards in 
place.

however this does not seem like appropriate activity for users and members of this 
list to attempt on anyone let alone the fellow members of this list as it displays a 
very low maturity level. I would appreciate any appropriate measures taken to stop 
this activity.

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



RE: [PHP] embedding PHP in MySQL

2003-09-18 Thread Javier Tacon

Instead to eval the code, try to save the query result into a new file, then execute 
this file (require_once, include).

Something like:

function executeFromQuery($query) {
  global $DB;
  $file = /tmp/temp.php;
  $code = $DB-getOne($query);
  $fh = fopen($file,w);
  fwrite($fh,$code);
  fclose($fh);
  include($file);
}

It should work.

Javier Tacón Iglesias.


-Mensaje original-
De: Michael Winston [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 18 de septiembre de 2003 17:20
Para: [EMAIL PROTECTED]
Asunto: [PHP] embedding PHP in MySQL
Importancia: Baja


I've been working on this for a few days and can't get it.

I would like to stick some php code into a sql databases and be able to 
evaluate it when it's called up.

Foe example, let's say there's some text in a table in MySql that says 
blah blah blah ? $mysql_query(SELECT * FROM X WHERE 1); 
$someothercode; ? blah blah blah blah blah.  I wan the end, 
displaying result to be: blah blah blah {executed php code} blah blah 
blah  blah.

Now, I know that eval() is involved, but I don't want it accidentally 
executing code outside the ?  ? so I need a way to pluck out bits 
of code, evaluate them, and put them back in.

Any ideas?

Thanks,
Michael

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

2003-09-18 Thread Javier Tacon

Try with the pdf classes in http://www.ros.co.nz/pdf/


-Mensaje original-
De: Paulo Nunes [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 18 de septiembre de 2003 14:59
Para: [EMAIL PROTECTED]
Asunto: [PHP] PHP and PDF
Importancia: Baja


I ve been trying to use the PDF function to create/read PDF files, but i ve
many problems.
Can anyone give a clue how can i create/read PDF files with PHP?
Thanks...

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

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



RE: [PHP] $_SELF[PHP_SELF] not working anymore

2003-09-16 Thread Javier Tacon

Try with $_SERVER[PHP_SELF]


-Mensaje original-
De: Maria Garcia Suarez [mailto:[EMAIL PROTECTED]
Enviado el: martes, 16 de septiembre de 2003 15:26
Para: [EMAIL PROTECTED]
Asunto: [PHP] $_SELF[PHP_SELF] not working anymore
Importancia: Baja


Hi there!

I'm currently developing some pages where I use
$_SELF[PHP_SELF], always without any kind of problem
(until some days ago).

Some days ago, as I said, I formated my hard disk,
installed everything again and from that day on
$_SELF[PHP_SELF] stopped working, same goes for
$_SERVER[REQUEST_URI] or $_GET[location] (which are
the solution I tried to find, without success). The
page says:

Notice: Undefined index

(for $_GET) or it just says nothing (the other ones
above, no error reported, it just displays nothing).

Inside PHP.ini I have globals set to On, but if I set
them to Off nothing changes...

Can anyone help me? At PHP.net I saw If PHP is
running as a command-line processor, this variable is
not available, but I am running it from a web page on
Windows 2000 + Xitami.

Thanks a lot for your help and sorry if I asked
something stupid, but I couldn't find any solution

Kisses,
Maria

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.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] Security of php_auth_pw ?

2003-09-15 Thread Javier Tacon

If you want this type of level security, you should work under SSL connection, that 
works with crypted data between browser and server.

Javier Tacón


-Mensaje original-
De: Neale Yates [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 7:47
Para: [EMAIL PROTECTED]
Asunto: [PHP] Security of php_auth_pw ?
Importancia: Baja


Is anyone able to advise me on the security of the password when using
PHP authentication.  My specific concern is whether the password can be
intercepted between the browser and server when submitted.

thanks

Neale

-- 
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] Sessions doubt

2003-09-15 Thread Javier Tacon

In PHP = 4.3.3 versions, start a session when you have a session started already, 
causes a notice error and the second call is ignored.

In older versions, the second call is ignored without errors (assumes the first 
session started)

Put this to your top.php:

@session_start();

And then, remove all the session_start from the others php files, when you are done, 
remove the eat '@' in the session_start() (isn't smart)


-Mensaje original-
De: Ryan A [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 11:11
Para: [EMAIL PROTECTED]
Asunto: [PHP] Sessions doubt
Importancia: Baja


Hi,
I have a small (simple?) doubt, if you know the answer kindly reply.

I have a top.php and bottom.php template files so that the whole site has
pretty much the same look and feel, then I have around 150 scripts that call
this files such as index.php or something.php like so:

?php
session_start();
include top.php;
subject or page matter here
include bottom.php;
?

I am relying heavily on sessions, right now its become an habit for me to
have session_start(); on every page as I start to write it, but have started
seeing some funny results as I have a session_start(); in both the calling
file and the top.php

do I really need to have it in both or just one?
or does it really matter at all?
 if just one it should be the file that is calling top.php right?

Thanks,
-Ryan A



We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.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] File Types

2003-09-15 Thread Javier Tacon

You could use the function exif_imagetype() to see what type of file has been uploaded.

http://es.php.net/manual/en/function.exif-imagetype.php


-Mensaje original-
De: Ed Curtis [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 15:02
Para: [EMAIL PROTECTED]
Asunto: [PHP] File Types
Importancia: Baja



 I currently limit file types in an upload script by using an allowed
types array

$allowed_types = array(image/jpeg, image/gif);

 I also need to allow files of with the following extentions.

 .tif, .pm7, .p65, .pdf, .qxp, .pmd, .eps

Is there a site out there anywhere that gives the mime types of theses
files?

Thanks,

Ed

-- 
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] Validating Subdomain E-mail Addresses Using Regular Expressions

2003-09-08 Thread Javier Tacon

$email = [EMAIL PROTECTED];
if(eregi(^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$, $email)) print Valid;

It should work.


Javier Tacón Iglesias.


-Mensaje original-
De: Jami Moore [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 08 de septiembre de 2003 17:02
Para: [EMAIL PROTECTED]
Asunto: RE: [PHP] Validating Subdomain E-mail Addresses Using Regular
Expressions
Importancia: Baja


Jason,

I have already done so and not found an answer, which is why I am asking
the group now. Do you have a suggestion or have you found a link that
may help? That would be ten times more useful than, Search the archives
or ask google.


Jami Moore
LightSpark Digital Designs
[EMAIL PROTECTED]
http://www.lightsparkdigital.com/


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 


Search the archives or ask google.

-- 
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 can I get IP of ppp0?

2003-09-05 Thread Javier Tacon


function getRemoteIP() {
 if(getenv(HTTP_CLIENT_IP)) $ip = getenv(HTTP_CLIENT_IP);
 else if(getenv(HTTP_X_FORWARDED_FOR)) $ip = getenv(HTTP_X_FORWARDED_FOR);
 else return getenv(REMOTE_ADDR);
 return $ip;
}


-Mensaje original-
De: Erick Okasaki [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 05 de septiembre de 2003 14:47
Para: [EMAIL PROTECTED]
Asunto: [PHP] How can I get IP of ppp0?


Hello List,

How can I get IP Address from my connection ppp0 or ppp1 in Linux? What 
's the function?


thanks
Erick

-- 
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] Urgent help required for using Cron

2003-08-29 Thread Javier Tacon

It seems problems with permissions.

Can you pass me the output from ls -la /var/spool/cron/

May be exists a directory called root inside /var/spool/cron, so, if exists, you 
should delete it and try again.



-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: viernes, 29 de agosto de 2003 3:37
Para: PHP General; Javier Tacon
CC: Bimal Jain
Asunto: RE: [PHP] Urgent help required for using Cron


Dear Javier,

We have done the following as per your suggestion
15 17 * * *   /path/to/your/php/binary  /path/to/your/script.php
After editing and saving crontab file the following message pops up at the
commond prompt -
crontab:installing new crontab
crontab:error renaming cron/tmp.1885 to cron/root
rename: is a directory
crontab: edit left in /tmp/crontab.1885

It did not work.  Please suggest what to do next?

Regards

Siva
-Original Message-
From: Javier Tacon [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2003 5:17 PM
To: Safal Solutions
Subject: RE: [PHP] Urgent help required for using Cron



For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it
doesn't say if your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your
script.
You can use a some mail classes that they have debug options (for example I
use phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

--
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] Urgent help required for using Cron

2003-08-28 Thread Javier Tacon
For example, you want execute a script every day at 09:00 am:
$ crontab -e
And put this line:
0 9 * * *   /path/to/your/php/binary  /path/to/your/script.php
Crontab only can say if the cron was executed correctly or not, but it doesn't say if 
your script in php has sent the mail correctly or not.
For debug if the mail was successfully sent, develope the debug into your script.
You can use a some mail classes that they have debug options (for example I use 
phpmailer v1.65).


-Mensaje original-
De: Safal Solutions [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 13:32
Para: PHP General
Asunto: [PHP] Urgent help required for using Cron


Hi friends,
  I have to send mail  to people automatically at specified time . Our
environment is RedhatLinux 7.3 , Apache ,mysql and php. I am writing a
program in php to send the mail if some
Condition is met. I want to activate this program at specified time using
cron facility.
So, How can we do that? Can any one help me?.

I have another problem also.   We want Cron to indicate ( through a message
or a mail)  to us that a given task is completed or not.  In the present
case Cron does a task of sending a mail to a user.  After sending the mail
we want Cron to indicate to us that the mail was successfully sent or not
sent.  This we want to know through a program because we want to use this as
a part of automation of sending mails.

Thanking you,

Siva

-- 
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] reboot pc with PHP

2003-08-28 Thread Javier Tacon

You can write a little script with expect (man expect) and execute it from php with 
exec().

Other solution its to write a .procmailrc in root that executes the reboot when coming 
a mail with some text in subject or boyd, so, from php you only need to send a mail.


-Mensaje original-
De: Petre Agenbag [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 14:48
Para: [EMAIL PROTECTED]
Asunto: [PHP] reboot pc with PHP


Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small admin utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
routine commands, I'd like to make a simple password protected webpage
that would have simple links on them like reboot, redial etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

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

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



RE: [PHP] reboot pc with PHP

2003-08-28 Thread Javier Tacon

A more easy solution is that:

Make a cron that executes every minut /tmp/rreboot.sh for user root
crontab -e
Add the line:
* * * * *  /tmp/rreboot.sh

The script is:
/tmp/rreboot.sh
---
#!/bin/sh
if [ -f /tmp/rreboot ]; then
 rm -f /tmp/rreboot
 shutdown -r now
fi
---
Make executable the file with chmod +x /tmp/rreboot.sh

And a simple PHP like:
?php
exec(echo rreboot  /tmp/rreboot);
echo Ok, i'll reboot in a few seconds;
?


So, when anyone calls to this PHP, creates a file, that if its detected by rreboot.sh, 
the root will reboot the machine.



-Mensaje original-
De: Javier Tacon 
Enviado el: jueves, 28 de agosto de 2003 15:07
Para: Petre Agenbag; [EMAIL PROTECTED]
Asunto: RE: [PHP] reboot pc with PHP



You can write a little script with expect (man expect) and execute it from php with 
exec().

Other solution its to write a .procmailrc in root that executes the reboot when coming 
a mail with some text in subject or boyd, so, from php you only need to send a mail.


-Mensaje original-
De: Petre Agenbag [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 14:48
Para: [EMAIL PROTECTED]
Asunto: [PHP] reboot pc with PHP


Hi List

I've gone through the list for previous questions and the only one that
seems to be a solution is to use sudo, however, I cannot seem to get it
right.

Just as background:

I want to make a small admin utill for an intranet machine, so the
security risks don't bother me at all.

Instead of myself having to ssh into the box to reboot or do other
routine commands, I'd like to make a simple password protected webpage
that would have simple links on them like reboot, redial etc, so
that someone with some sort of responsibility can do it themselves.

Obviously these command(s) need to be run as root, so I looked at the
/etc/sudoers and added apache , BUT, in the error log it prompts for a
password.

I tried to add the option NOPASSWD: ALL to the file, but it says there's
a syntax error.

What am I missing?

Any other ways of doing this?  PS, I don't even want to consider Webmin,
it's way too complicated, I just want a handfull of predefined commands
to be run, nothing else)

Thanks
 

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

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

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



RE: [PHP] reboot pc with PHP

2003-08-28 Thread Javier Tacon

Exactly ..
Well, the script removes the rreboot file before the shutdown.

For security choose a directory for rreboot file placed in a directory that only can 
be readed/writed by apache, and the php file in the example its very simple, but you 
can ask for a password, create a log, etc ..

chown 700 /directory/for/rrebootfile
chown apache.nobody /directory/for/rrebootfile


-Mensaje original-
De: Matthew Harrison [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 15:49
Para: Javier Tacon
CC: Petre Agenbag; [EMAIL PROTECTED]
Asunto: Re: [PHP] reboot pc with PHP


On Thu, Aug 28, 2003 at 03:35:59PM +0200, Javier Tacon wrote:
 
 A more easy solution is that:
 
 Make a cron that executes every minut /tmp/rreboot.sh for user root
 crontab -e
 Add the line:
 * * * * *  /tmp/rreboot.sh
 
 The script is:
 /tmp/rreboot.sh
 ---
 #!/bin/sh
 if [ -f /tmp/rreboot ]; then
  rm -f /tmp/rreboot
  shutdown -r now
 fi
 ---
 Make executable the file with chmod +x /tmp/rreboot.sh


just one little point (i'm glad i don't have to give a setuid lecture) personally
i would make sure that the location of the check file is extremely secure.

under normal circumstances, any user could write the rreboot file and cause a reboot

also, remember to remove the file again in rc.local before cron starts etc.

but i like the idea. its much more secure (from a web perspective).

 And a simple PHP like:
 ?php
 exec(echo rreboot  /tmp/rreboot);
 echo Ok, i'll reboot in a few seconds;
 ?
 
 
 So, when anyone calls to this PHP, creates a file, that if its detected by 
 rreboot.sh, the root will reboot the machine.
 
 
 
 -Mensaje original-
 De: Javier Tacon 
 Enviado el: jueves, 28 de agosto de 2003 15:07
 Para: Petre Agenbag; [EMAIL PROTECTED]
 Asunto: RE: [PHP] reboot pc with PHP
 
 
 
 You can write a little script with expect (man expect) and execute it from php with 
 exec().
 
 Other solution its to write a .procmailrc in root that executes the reboot when 
 coming a mail with some text in subject or boyd, so, from php you only need to send 
 a mail.
 
 
 -Mensaje original-
 De: Petre Agenbag [mailto:[EMAIL PROTECTED]
 Enviado el: jueves, 28 de agosto de 2003 14:48
 Para: [EMAIL PROTECTED]
 Asunto: [PHP] reboot pc with PHP
 
 
 Hi List
 
 I've gone through the list for previous questions and the only one that
 seems to be a solution is to use sudo, however, I cannot seem to get it
 right.
 
 Just as background:
 
 I want to make a small admin utill for an intranet machine, so the
 security risks don't bother me at all.
 
 Instead of myself having to ssh into the box to reboot or do other
 routine commands, I'd like to make a simple password protected webpage
 that would have simple links on them like reboot, redial etc, so
 that someone with some sort of responsibility can do it themselves.
 
 Obviously these command(s) need to be run as root, so I looked at the
 /etc/sudoers and added apache , BUT, in the error log it prompts for a
 password.
 
 I tried to add the option NOPASSWD: ALL to the file, but it says there's
 a syntax error.
 
 What am I missing?
 
 Any other ways of doing this?  PS, I don't even want to consider Webmin,
 it's way too complicated, I just want a handfull of predefined commands
 to be run, nothing else)
 
 Thanks
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Mat Harrison
Technical Developer
3d Computer Systems Ltd.
[EMAIL PROTECTED]
-
ASCII ribbon campaign ( )
 - against HTML email  X
Usenet posts / \

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



RE: [PHP] GD PHP

2003-08-28 Thread Javier Tacon

You need to compile PHP with the option --with-gd in the configure step.

The function is imagecreatefromjpeg()


-Mensaje original-
De: Mike At Spy [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 17:32
Para: [EMAIL PROTECTED]
Asunto: [PHP] GD  PHP



Is there anything special I have to do to enable GD when using PHP 4.3.2?

I'm getting an error of:

Fatal error: Call to undefined function: imagecreatefromjpeg() in
/home/sites/site37/web/photos/functions.php on line 594

When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
Should I be using imagecreatefromgd()?

-- 
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] GD PHP

2003-08-28 Thread Javier Tacon

Try to add --with-jpeg, but probably you need to install some libraries, like libjpeg 
(http://freshmeat.net/projects/libjpeg/?topic_id=105%2C809)



-Mensaje original-
De: Mike At Spy [mailto:[EMAIL PROTECTED]
Enviado el: jueves, 28 de agosto de 2003 18:22
Para: Javier Tacon; [EMAIL PROTECTED]
Asunto: RE: [PHP] GD  PHP



I get an error about png libraries not found, though my configure line only
adds --with-gd to it from my previous configure (pretty recent).  Do I need
png and/or some sort of jpeg libraries installed first?

I don't mention png in my configure line:

./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-gettext=/usr --e
nable-safe-mode --with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin 
--with-zlib --enable-magic-quotes --with-regex=system --with-ttf --with-dba 
--with-gdbm --enable-mbstring --enable-mbstr-enc-trans --enable-track-vars -
-enable-wddx=shared --enable-mm=shared --enable-xml --enable-ftp --disable-d
ebug --with-libdir=/usr/lib --with-db3 --with-interbase=shared --with-pgsql=
shared --with-ldap --with-pdflib=shared --with-mcrypt --with-gd

Thanks,

-Mike



 -Original Message-
 From: Javier Tacon [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 28, 2003 11:33 AM
 To: Mike At Spy; [EMAIL PROTECTED]
 Subject: RE: [PHP] GD  PHP



 You need to compile PHP with the option --with-gd in the configure step.

 The function is imagecreatefromjpeg()


 -Mensaje original-
 De: Mike At Spy [mailto:[EMAIL PROTECTED]
 Enviado el: jueves, 28 de agosto de 2003 17:32
 Para: [EMAIL PROTECTED]
 Asunto: [PHP] GD  PHP



 Is there anything special I have to do to enable GD when using PHP 4.3.2?

 I'm getting an error of:

 Fatal error: Call to undefined function: imagecreatefromjpeg() in
 /home/sites/site37/web/photos/functions.php on line 594

 When I use the imagecreatefromjpeg() function.  Is it not usable with gd?
 Should I be using imagecreatefromgd()?

 --
 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] speed of mail() on two servers

2003-08-27 Thread Javier Tacon

I think that may be 'problem' from sendmail .. mail() function under
linux only interacts with sendmail, it doesn't contact to the remote
SMTP to leave the mail. Do you have the same sendmail version in two
machines? You should compare both sendmail configuration and try to
check the speed from a bash script for example.


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 0:40
Para: PHP General list
Asunto: [PHP] speed of mail() on two servers


Hi, all --

I'm working up a [cli] script to send a personalized (ugh) email to some
[often large] number of web site subscribers.  Unfortunately, I'm
getting
lousy performance, running about 0.54 sec per email.

My partner has a mail script implemented on another machine and he's
running somewhere down around 0.10 sec per email, which is better but
still not very good for sending to 60k users.

The box (dual Xeon 2.2G with mirrored fast SCSI and 1G RAM) has plenty
of
horsepower, and it certainly shouldn't need more.  It's running RH 7.3
(Valhalla) with 2.4.20 on ext3 and has qmail installed as its MTA.

It seems to be the mail() call itself, because I can make a system call
(system, exec, passthru) to just echo the current data and it rips
through my list in nothin' flat.  So how do I tune mail() to make it
faster?  Or do I need to give up and call qmail-inject directly?


TIA  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] speed of mail() on two servers

2003-08-27 Thread Javier Tacon

May be the machine of your friend has a better network output than your
machine :)


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 11:59
Para: PHP General list
CC: Javier Tacon
Asunto: Re: [PHP] speed of mail() on two servers


Javier, et al --

...and then Javier Tacon said...
% 
% I think that may be 'problem' from sendmail .. mail() function under
% linux only interacts with sendmail, it doesn't contact to the remote

Right.  Only it doesn't make much sense, because qmail is FAST.


% SMTP to leave the mail. Do you have the same sendmail version in two
% machines? You should compare both sendmail configuration and try to
% check the speed from a bash script for example.

Unfortunately, I can't get to his other server, and he doesn't really
know anything about its guts (he's a great php coder and a great art
designer, but he's entirely a windoze guy).  I don't even know if he's
running qmail there.


Thanks  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and
Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] Looping through a list - Newbie question

2003-08-27 Thread Javier Tacon
There are a lot of methods. The most common is using an array:

$_SESSION['sv_CampusList'] = Array (1,2,3,4,5);
foreach($_SESSION['sv_CampusList'] as $id) {
  echo $id;
}

If you want to use sv_CampusList as string:

$_SESSION['sv_CampusList'] = 1,2,4,5; 
$tmpArr = explode(,,$_SESSION['sv_CampusList']);
foreach($tmpArr as $id) {
  echo $id;
}


-Mensaje original-
De: James Johnson [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 27 de agosto de 2003 4:45
Para: [EMAIL PROTECTED]
Asunto: [PHP] Looping through a list - Newbie question


Hi,

I have a list contained in a session var. I want to loop through the list,
getting the value of the current item, then do a query based on that value.
Is there an easy way to do this, or do I need to convert the list to an
array first? In the code below, $id isn't being set.

Here's my code (this is just testing stuff, sv_CampusList is set somewhere
else):
?php
session_start();
$_SESSION['sv_CampusList'] = 1,2,4,5; 
for($i=1; $i=strlen($_SESSION['sv_CampusList']); $i++){
$id = strpos($_SESSION['sv_CampusList'],$i);
echo $id;
}
?

Thanks,
James

-- 
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] Controlling Access

2003-08-26 Thread Javier Tacon

You can play with a $_SESSION var, ..

Imagine that you have the file a.php with ..

?php
// Your code 
session_start();
$_SESSION[lastFile] = $_SERVER[SCRIPT_FILENAME];
?

And you want b.php that can only be executed after a.php:

?php
session_start();
if($_SESSION[lastFile]!=a.php) die(Access denied);
$_SESSION[lastFile] = $_SERVER[SCRIPT_FILENAME];
?

And so ...

-Mensaje original-
De: Doug Wolfgram [mailto:[EMAIL PROTECTED]
Enviado el: martes, 26 de agosto de 2003 17:45
Para: [EMAIL PROTECTED]
Asunto: [PHP] Controlling Access


I have an application that consists of some 30 php modules.  Each one links 
to another, as you can imagine. How can I create a security mechanism that 
only allows the modules in my system to be called from one-another? I do 
nto want any of the modules to be called by typing them on the address bar. 
Of course, sessions takes care of folks who have not logged into the 
system, btu I don;t want registered users hacking around either.

I though of using HTTP_REFERER as a handshake restrictor, but it seems to 
be unstable and unreliable. Any suggestions?


D




'Marketing that Listens

Doug Wolfgram
CEO - GRAFX Group, Inc.
www.gfx.com
www.aimprojects.com
949.433.3641

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

2003-08-26 Thread Javier Tacon

Yes, I gree with all.

To test their mySql level, you can show them two tables, and the results from a join 
between the two tables, so you ask them for what is the SELECT statement to get that 
results.

Example ..

Table1:
++-+-+--+
| id | name| surname | departmentId |
++-+-+--+
|  1 | John| Doe |1 |
|  2 | Scott   | Johnson |2 |
|  3 | Mikael  | Martin  |2 |
|  4 | Nicolas | Survey  |3 |
++-+-+--+

Table2:
+++
| id | departmentName |
+++
|  1 | Production |
|  2 | Sales  |
|  3 | Marketing  |
+++

Question: What's the select statement to show this results:
+-+-++
| name| surname | departmentName |
+-+-++
| John| Doe | Production |
| Mikael  | Martin  | Sales  |
| Nicolas | Survey  | Marketing  |
| Scott   | Johnson | Sales  |
+-+-++

Answer: select name,surname, departmentName from table1 left join table2 on 
table1.departmentId=table2.id order by name asc;

This example is very very easy, don't put it into your exam :)
Look for other examples searching in google or any searcher ..


-Mensaje original-
De: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Enviado el: martes, 26 de agosto de 2003 18:03
Para: Micheal Harris; [EMAIL PROTECTED]
Asunto: Re: [PHP] PHP Interview questions


From: Micheal Harris [EMAIL PROTECTED]

 I am in the process of hiring someone that needs to have extensive PHP and
 MySQL experience. Does anyone have any suggestions for interview
questions?
 I have no PHP or MySQL experience, and come from a non-technical
background.
 I want the questions to be technical, but I am unsusre as to how specific
I
 should get with the questionning!

How are you going to grade it, though, if you don't know PHP or MySQL?

I say you should send them to the list and let us grill them!! We'll sort
out the riff-raff.. :)

Seriously, look at their portfolio, call their references, and MAKE them
write code.

TASK: Create a PHP application that will insert names and dates of birth
into a MySQL database.

CONDITIONS: Given the PHP Manual, MySQL Manual, Notepad (or similar text
editor), and database host, user, and password information.

STANDARD: The application will run without errors when complete. The
application will accept a first name, last name, and date of birth (in
DDMMMYY format) through an HTML form and store the information in a MySQL
database. The application will list all current entries in the database in
an HTML table after a new row is inserted.

Things to look for:

1. Do they program for register_globals ON or OFF?
2. Do they check the setting of magic_quote_gpc?
3. Do they include error checking of form data and queries?
4. Is their program open to cross site scripting or SQL injection attacks?
5. Do they use a DATE type column or VARCHAR column for dates?
6. Do they write valid HTML?
7. How many files do they use to accomplish the task?
8. Do they try to add extra fluff instead of just accomplishing the task?

Hopefully others will pipe up with their comments, also. :)

---John Holmes...

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