[PHP] Making random string function function more random?

2002-12-06 Thread Leif K-Brooks
I'm using the following function to generate a random string:

function randstring($minasc = 32,$maxasc = 255,$minlength = 0,$maxlength 
= 0){
   //If maximum length is lower than minimum length, return string 
representation of false
   if($maxlength != 0 and $minlength != 0 and $minlength  $maxlength){
   return '';
   }
   //Initialize $return
   $return = '';
   //Start infinite while loop, which will be exited with break;
   while(true){
   //Add another random character to $return
   $return = $return.chr(mt_rand($minasc,$maxasc));
   //Break out of loop when it's time to
   if((strlen($return) == $maxlength) or (mt_rand(1,2) == 2 and 
(strlen($return) = $minlength or $minlength == 0) and (strlen($return) 
= $maxlength or $maxlength == 0))){
   break;
   }
   }
   //Return the value of $return
   return $return;
}
But when I run it with:
randstring(65,90,4,4);
and I check how many strings it generates before reaching a certain 
string, some strings take much longer than others.  Is this just a 
problem with using pseudo-random numbers, or is there a better way to 
randomize this function?

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



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



[PHP] $DOCUMENT_ROOT

2002-12-06 Thread christopher calicott

 ?
 echo $_SERVER[DOCUMENT_ROOT];
 ?


c:/wwwroot

is what I get.  I am convinced the problem I am having is due to some issues
with configuration.  Here is why:


I found the script that is the 'original' one that I had working just as an
image displayer - not as part of a larger html document and it works at the
root of the web server.   I've attached that code.  Here's the thing - the
script is identical, with two exceptions.. a) it is executing from the
server root and b) the is just a regular path without the $DOCUMENT_ROOT in
there.  It looks (and it works) like this:

$strRealPath = images/random_gen/;
//$DOCUMENT_ROOT.dirname($SCRIPT_NAME)./;


I cloned this script and renamed it, then changed images/random_gen/ to:
$DOCUMENT_ROOT/images/random_gen/

and guess what?   I guess the EXACT same errors.  It has to be something to
do with where apache or php thinks the root of the server is located...
since the script that is integrated into the site is down a level in the
/includes/ subfolder and it points to images in the
DOCUMENT_ROOT/images/random_gen/ subfolder, I really needed the script to
just say 'okay go to the root of the server then go to this subfolder and
look there.'  It ain't working.

SOo basically I have some sort of configuration issue here. I've
tried modifying httpd.conf - it supposedly wants the documentRoot to be set
to c:/wwwroot instead of the normal c:\wwwroot... I've tried it both ways.
the doc_root= setting in php.ini is set to c:\wwwroot and I've tried it both
ways.

Please help.  I will dance at your wedding. Anybody Buehler?  Buehler?

-=- christopher

-=- christopher


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


Re: [PHP] md5 question

2002-12-06 Thread Jason Wong
On Friday 06 December 2002 15:41, conbud wrote:
 Hey. Is there a way to get the actual word/phrase from the long string that
 the md5 hash creates. Lets say, is there a way find out what
 b9f6f788d4a1f33a53b2de5d20c338ac
 stands for in actuall words ?

Consider this, md5() takes (practically) any size of string as input and 
returns a 32 char string. 

So you give it a 1MB string and in return you get a 32 byte string -- how on 
earth are you going to reverse this process and get your original 1MB string 
from your measly 32 byte string?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Ubi non accusator, ibi non judex.

(Where there is no police, there is no speed limit.)
-- Roman Law, trans. Petr Beckmann (1971)
*/


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




[PHP] HOW GET ALL HTML CONTENT

2002-12-06 Thread nice_boy
hi,

who knows how to get all contents when i use javascript to get bookmark of
IE
ex:

window.external.ImportExportFavoritesfalse,http://localhost/test.php;);

because  i use $_POST to get that data,but it can't get all data.

if it has 27593 bytes ,then only get 7XXX bytes. that means so many data was
not geted.

i got some informations when use $HTTP_SERVER_VARS, then data is

[key=COMSPEC]=value[C:\\WINDOWS\\COMMAND.COM]
[key=CONTENT_LENGTH]=value[27593]
[key=CONTENT_TYPE]=value[application/x-www-form-urlencoded]
[key=DOCUMENT_ROOT]=value[c:/windows/desktop/web]
[key=HTTP_CACHE_CONTROL]=value[no-cache]
[key=HTTP_CONNECTION]=value[Keep-Alive]
[key=HTTP_HOST]=value[localhost]
[key=HTTP_USER_AGENT]=value[PostFavorites]
[key=PATH]=value[C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\PROGRA~1\\SSHCOM~1\\SS
HSEC~1;C:\\PROGRA~1\\MICROS~4\\80\\TOOLS\\BINN;C:\\PROGRA~1\\ULTRAE~1;C:\\PR
OGRA~1\\BORLAND\\DELPHI5\\BIN;C:\\PROGRA~1\\BORLAND\\VBROKER\\BIN;C:\\PROGRA
~1\\BORLAND\\VBROKER\\JRE\\BIN;C:\\PROGRA~1\\BORLAND\\DELPHI5\\PROJECTS\\BPL
;C:\\PROGRA~1\\ULTRAE~1]
[key=REMOTE_ADDR]=value[127.0.0.1]
[key=REMOTE_PORT]=value[1755]
[key=SCRIPT_FILENAME]=value[c:/windows/desktop/web/test.php]
[key=SERVER_ADDR]=value[127.0.0.1]
[key=SERVER_ADMIN]=value[[EMAIL PROTECTED]]
[key=SERVER_NAME]=value[211.22.80.5]
[key=SERVER_PORT]=value[80]
[key=SERVER_SIGNATURE]=value[ADDRESSApache/1.3.24 Server at 211.22.80.5
Port 80/ADDRESS
]
[key=SERVER_SOFTWARE]=value[Apache/1.3.24 (Win32) PHP/4.2.2]
[key=WINDIR]=value[C:\\WINDOWS]
[key=GATEWAY_INTERFACE]=value[CGI/1.1]
[key=SERVER_PROTOCOL]=value[HTTP/1.1]
[key=REQUEST_METHOD]=value[POST]
[key=QUERY_STRING]=value[]
[key=REQUEST_URI]=value[/test.php]
[key=SCRIPT_NAME]=value[/test.php]
[key=PATH_TRANSLATED]=value[c:/windows/desktop/web/test.php]
[key=PHP_SELF]=value[/test.php]
[key=argv]=value[Array]
[key=argc]=value[0]

so i know the content length is 27593

who can tell me how to get all data but not use $_POST variables.

thanks a lot..^^



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




[PHP] ezmlm

2002-12-06 Thread Randum Ian
Sorry to be off-topic but has anyone got any good resources on setting up 
exmlm?


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




Re: [PHP] ezmlm

2002-12-06 Thread Jason Wong
On Friday 06 December 2002 18:18, Randum Ian wrote:
 Sorry to be off-topic but has anyone got any good resources on setting up
 exmlm?

google has

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
I used to work in a fire hydrant factory.  You couldn't park anywhere near
the place.
-- Steven Wright
*/


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




Re: [PHP] How to create user in mySQL ?

2002-12-06 Thread Krzysztof Dziekiewicz
 Why do people insist on asking MySQL questions on a PHP list?
 search for flush privileges on the MySQL website.

Mayby it is the most inteligent newsgroup. ;-)


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




Re: [PHP] empty string parameters to backslashes?

2002-12-06 Thread DL Neil
Hey Andy,

 I'm trying to track down a problem with someone else's
 code. Our hosting service changed PHP versions on us
 (up to 4.0.6), and everything broke. I think I have
 tracked down at least part of the problem. We have a
...

Ascertain differences by printing out a phpinfo() report for the new config
and comparing with previous (obvious logic flaw noted!). It is as important
for developers (as for installers) to read the ChangeLog
(http://www.php.net/ChangeLog-4.php) to see what's new/different between
versions.


 But the output of the print statement looks like this:
 funA START: file: productBrief, name: \, alt: \, size: 177\
 So where did the darned backslashes come from? Any ideas?

Magic_quotes will do this. Check out manual: LXXIX. PHP
OptionsInformation - the hosting service may have changed the setting on
you. Follow links to learn how to SET and GET from within scripts.

Regards,
=dn


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




Re: [PHP] Repeating Decimals

2002-12-06 Thread Marek Kilimajer
0.font style=text-decoration : overline;3/font

Stephen wrote:


Hello again,

This is another PHP mathematical question. How can I display a bar over a
number (overline) if it's a repeating decimal? When the user types in 1 by
3, they get 0.. I want it to display as 0.3 with the 3
overlined. How can I do this keeping in mind that not all numbers will be
repeating decimals?

Thanks,
Stephen Craton
http://www.melchior.us

What is a dreamer that cannot persevere? -- http://www.melchior.us

 



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




[PHP] PHP query to javascript array

2002-12-06 Thread Christian Ista
Hello,


Could you tell me how to transform a PHP query result to a javascript 
array ?

Same question, if you want to store several field from the query to the 
javascript.

Christian,


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




Re: [PHP] Checking for Overlapping Dates

2002-12-06 Thread DL Neil
Hi Thomas,

 SELECT * from $DB_TBLName WHERE
 (Trim(WorkerEmail)='$userReplacementEmail')
 AND AND  OR  OR  OR  OR  OR

This is all a bit complicated, and a simple boy like me gets lost too
easily. KISS principle: Keep it simple...

You have two employees:
A, so named because he Already has Annual leave Approved, and
B, so named because he is Begging to Be allowed to Break out.

Let's imagine we're playing with a wall-chart/wall-planner to assess
requests prior to granting approval. So we mark off which days A will be
away and then view which days B would like to go against existing requests.

Month A Month BMonth C   Month etc
A  ---
B  

Assuming the email/fonts haven't mucked-up my sketch, you can see that B's
request should be denied, because A has already booked the time-out.

Now let's use the diagram to build an algorithm. How many ways are there
that A and B could overlap? (hint: four) Not overlap? (hint: two) Which is
the easiest to implement in code?

Now you can ask, which language should I code in? Answer: stay as close to
the source as possible, ie use SQL (or in this case pseudo-SQL(!)).

SELECT a AS Colleague, CONCAT( astart - afinish ) AS PermissionDenied
   FROM tbl
   WHERE bstart  afinish
  OR bfinish  astart;

Before this will work, you will need to add another WHERE clause to
establish who is the employee's replacement. The above lists a reason for
rejection - you can reverse the logic, at your peril.

Trust this assists,
=dn

PS The complicating question I wanted to ask from the word go is: what if
one person can have more than one other employee act as his/her
replacement?




 Background:
 

 I've created a vacation-request application for our company's intranet.
 When an employee requests a vacation, he has to list the name of another
 employee who will 'fill in' for him while he is gone.

 Before a vacation request can be saved in MySQL, I need to check to make
 sure that the person listed as the employee's replacement during this time
 has not already requested a vacation during the same time period...to
 check to be sure that the two vacation periods do not overlap.

 Date Ranges:
 

 I have fields saved in MySQL called unixStartDate  unixEndDate that are
 unix timestamps for the first day of the employee's vacation and the last
 day of the emplosyee's vacation.

 I have tried to do a check using purely SQL, but this doesn't account for
 all possibilities of overlapping dates:

 (unixStartDate is the unix timestamp for the replacement, whereas the PHP
 var $unixStartDate is the unix timestamp for the employee who wants to
 post a new vacation request)

 $checkSQL = SELECT * from $DB_TBLName WHERE
 (Trim(WorkerEmail)='$userReplacementEmail')
 AND (Status  40)
 AND
 (
 (
 ($unixStartDate = unixStartDate)
 )
 OR
 (
 ($unixEndDate = unixEndDate)
 )
 OR
 (
 ($unixStartDate = unixEndDate)
 )
 OR
 (
 ($unixEndDate = unixStartDate)
 )
 OR
 (
 (unixStartDate  $unixStartDate)  (unixEndDate  $unixEndDate)
 )
 OR
 (
 (unixStartDate  $unixStartDate)  (unixEndDate  $unixEndDate)
 )
 )
 ;

 So I think what I instead need to do is use PHP code instead of SQL to
 check for overlapping dates in the 2 date ranges I have.
 My two ranges would be like this:

 Replacement's Date Range:
 
 $unixStartDateReplacementVacation
 ...to...
 $unixEndDateReplacementVacation

 Employee's Date Range:
 
 $unixStartDateEmployeeVacation
 ...to..
 $unixEndDateEmployeeVacation


 

 ...so i need to check that none of the dates occuring in the first date
 range listed above appear in the second date range.
 unfortunately, i have no basic idea of how i should go about doing
 this...should i use arrays of dates, for-loops, or what?
 thanks a whole lot in advance,

 Tom


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




[PHP] GD support in PHP 4.1.2

2002-12-06 Thread GoodnGo.de \(R\) Zentrale
Hello list,

I am running a redhat7.3 box and a customer want to get installed php with GD-library 
support

I want to configure php like this:

./configure  --with-gd= where is this directory?

How can I find the directory where are the correspondent gd-lib/headers-files so that 
I can 
configure php with the correct gd (--with-gd=this I want to knowsupport?

Oliver Etzel

eu-Domains are coming
www.t-host.com






Re: [PHP] PHP query to javascript array

2002-12-06 Thread Marek Kilimajer
for numbers:
jsarray= new Array(?=  implode(',',$phparray) ?);

for strings:
jsarray= new Array(?=  implode(',',$phparray) ?);

Christian Ista wrote:


Hello,


Could you tell me how to transform a PHP query result to a javascript 
array ?

Same question, if you want to store several field from the query to the 
javascript.

Christian,


 



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




[PHP] Cookies help please

2002-12-06 Thread Steve Vernon
Hiya,
Ive got a few websites that use sessions and I thought id upgrade them
now to use cookies. In the main file it calls the session start function,
and then this function is called, but it does not seem to work. I open a new
window and the cookie does not seem to auto log me on.

Sorry if I have not explained it right, I want a feature like amazon
where you go back to a site and you are still logged in.

The test member has rememberpassword as y.

The code below keeps my sessions but the cookie bit dosent work.

Thanks,

Steve
XX

 /* Check a session is valid
  */
 function session_check($db_link)
 {
  //Ok so either want to log on, or have a session or cookie allready
  if(isset($_SESSION['ssun']) || isset($_COKKIE[ssun]) ||
isset($_POST['ssname']))
  {
   //Attempt to logon. Set the logon form variables to the session
variables.
   if(isset($_POST['sspass'])isset($_POST['ssname']))
   {
$_SESSION['sspw'] =$_POST['sspass'];
$_SESSION['ssun'] =$_POST['ssname'];

if(isset($_COOKIE[ssun]))
   {
$_COOKIE['ssun']=;
$_COOKIE[ssun]=;
}
   }

   if(isset($_COOKIE[ssun]))
   {
$result = mysql_query(SELECT rememberpassword, memberid, title,
lastname, lastnamenow, md5(memberpassword), email FROM members WHERE
md5(memberpassword)='.$_COOKIE['sspw'].' AND
email='.$_COOKIE['ssun'].', $db_link);
   }
   else
   {
//Check if the session username and password are correct
$result = mysql_query(SELECT rememberpassword, memberid, title,
lastname, lastnamenow, md5(memberpassword), email FROM members WHERE
memberpassword='.$_SESSION['sspw'].' AND email='.$_SESSION['ssun'].',
$db_link);
   }

   if(mysql_num_rows($result)==1)
   {
$loggedin=yes;
$userdata = mysql_fetch_row($result);

if($userdata[0]==y)
{ //Set up the cookies, store the md5 version of the password
 setcookie (ssun, $userdata[6],time()+604800);
 setcookie (sspw, $userdata[5],time()+604800);
}

if($userdata[4]==) //If no last name now
{
 $_SESSION['title']=$userdata[2];
 $_SESSION['lastname']=$userdata[3];
}
else //Use the last name now
{
 $_SESSION['title']=$userdata[2];
 $_SESSION['lastname']=$userdata[4];
}
   }
   else
   {
$loggedin=no;
   }

   if(isset($_GET['logoff']))
   {
if($_GET['logoff']==true)
{
 //Remove the session and cookies
 $loggedin=no;
 $_SESSION['ssun']=;
 $_SESSION['sspw']=;
 $_SESSION['title']=;
 $_SESSION['lastname']=;
 setcookie (ssun, ,time()-3600);
 setcookie (sspw, ,time()-3600);
}
   }
   return $loggedin;
  }
  else
  {
   return no;
  }
 }


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




[PHP] --with-gd=DIR

2002-12-06 Thread GoodnGo.de \(R\) Zentrale
Hello list,

I am running a redhat7.3 box and a customer want to get installed php with GD-library 
support

I want to configure php like this:

./configure  --with-gd= where is this directory?

How can I find the directory where are the correspondent gd-lib/headers-files so that 
I can 
configure php with the correct gd (--with-gd=this I want to knowsupport?

Oliver Etzel

eu-Domains are coming
www.t-host.com




[PHP] --with-gd=DIR

2002-12-06 Thread info
Hello list,

I am running a redhat7.3 box and a customer want to get installed php with GD-library 
support

I want to configure php like this:

./configure  --with-gd= where is this directory?

How can I find the directory where are the correspondent gd-lib/headers-files so that 
I can 
configure php with the correct gd (--with-gd=this I want to knowsupport?

Oliver Etzel

eu-Domains are coming
www.t-host.com




Fw: [PHP] Checking for Overlapping Dates

2002-12-06 Thread DL Neil
Thomas (and list),

The solution, as previously posted, is flawed/incomplete - mea culpa.
Excuse: I was interrupted three times from typing the word SELECT until
pressing Send, and then rushing to get on to the next call on my time...

WHERE bstart  afinish
   OR bfinish  astart;

Check back with the diagram and you will see that a bstart clause needs to
also check that bstart = astart to trigger rejection - if the leave starts
AND finishes before the 'replacement's' leave, then all is well - similarly
for second clause.

Now, if you prefer to inform a positive response, eg leave may be granted,
then when you turn things around, pay special attention to the relationship
and changing ORs and ANDs.

Better if we change the whole logic around and say when can we grant annual
leave? because then the answer becomes: if bfinish  astart or fstart 
afinish. This has the additional advantage of 'scaling', if the employee has
more than one potential 'replacement'!

In all approaches beware the special case: that the 'replacement' has no
outstanding request for leave!

Again apologies,
=dn



  SELECT * from $DB_TBLName WHERE
  (Trim(WorkerEmail)='$userReplacementEmail')
  AND AND  OR  OR  OR  OR  OR

 This is all a bit complicated, and a simple boy like me gets lost too
 easily. KISS principle: Keep it simple...

 You have two employees:
 A, so named because he Already has Annual leave Approved, and
 B, so named because he is Begging to Be allowed to Break out.

 Let's imagine we're playing with a wall-chart/wall-planner to assess
 requests prior to granting approval. So we mark off which days A will be
 away and then view which days B would like to go against existing
requests.

 Month A Month BMonth C   Month etc
 A  ---
 B  

 Assuming the email/fonts haven't mucked-up my sketch, you can see that B's
 request should be denied, because A has already booked the time-out.

 Now let's use the diagram to build an algorithm. How many ways are there
 that A and B could overlap? (hint: four) Not overlap? (hint: two) Which is
 the easiest to implement in code?

 Now you can ask, which language should I code in? Answer: stay as close to
 the source as possible, ie use SQL (or in this case pseudo-SQL(!)).

 SELECT a AS Colleague, CONCAT( astart - afinish ) AS PermissionDenied
FROM tbl
WHERE bstart  afinish
   OR bfinish  astart;

 Before this will work, you will need to add another WHERE clause to
 establish who is the employee's replacement. The above lists a reason
for
 rejection - you can reverse the logic, at your peril.

 Trust this assists,
 =dn

 PS The complicating question I wanted to ask from the word go is: what
if
 one person can have more than one other employee act as his/her
 replacement?




  Background:
  
 
  I've created a vacation-request application for our company's intranet.
  When an employee requests a vacation, he has to list the name of another
  employee who will 'fill in' for him while he is gone.
 
  Before a vacation request can be saved in MySQL, I need to check to make
  sure that the person listed as the employee's replacement during this
time
  has not already requested a vacation during the same time period...to
  check to be sure that the two vacation periods do not overlap.
 
  Date Ranges:
  
 
  I have fields saved in MySQL called unixStartDate  unixEndDate that are
  unix timestamps for the first day of the employee's vacation and the
last
  day of the emplosyee's vacation.
 
  I have tried to do a check using purely SQL, but this doesn't account
for
  all possibilities of overlapping dates:
 
  (unixStartDate is the unix timestamp for the replacement, whereas the
PHP
  var $unixStartDate is the unix timestamp for the employee who wants to
  post a new vacation request)
 
  $checkSQL = SELECT * from $DB_TBLName WHERE
  (Trim(WorkerEmail)='$userReplacementEmail')
  AND (Status  40)
  AND
  (
  (
  ($unixStartDate = unixStartDate)
  )
  OR
  (
  ($unixEndDate = unixEndDate)
  )
  OR
  (
  ($unixStartDate = unixEndDate)
  )
  OR
  (
  ($unixEndDate = unixStartDate)
  )
  OR
  (
  (unixStartDate  $unixStartDate)  (unixEndDate  $unixEndDate)
  )
  OR
  (
  (unixStartDate  $unixStartDate)  (unixEndDate  $unixEndDate)
  )
  )
  ;
 
  So I think what I instead need to do is use PHP code instead of SQL to
  check for overlapping dates in the 2 date ranges I have.
  My two ranges would be like this:
 
  Replacement's Date Range:
  
  $unixStartDateReplacementVacation
  ...to...
  $unixEndDateReplacementVacation
 
  Employee's Date Range:
  
  $unixStartDateEmployeeVacation
  ...to..
  $unixEndDateEmployeeVacation
 
 
  
 
  ...so i need to check that none of the dates occuring in the first date
  range listed above appear in the second date range.
  unfortunately, i have no basic idea of how i should go 

[PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread ed

I've got a routine that queries a MySQL database and outputs the sorted
results to a web page (script snippet below.) How can I output the exact
same thing to a txt file using this script?

?

$count = 0;

$result = mysql_query (SELECT * FROM listings ORDER by a
DESC);

if ($row = mysql_fetch_array($result)) { 

do { ?


? echo $row['company_name']; ?
nbsp;nbsp;
? echo $row['agent_name']; ?
nbsp;nbsp;
? echo $row['county']; ?
nbsp;nbsp;
? echo $row['city']; ?
br
? echo $row['mls']; ?
nbsp;nbsp;
$? echo number_format($row['price'], ,); ?
nbsp;nbsp;
? echo $row['area']; ?
br
? echo $row['copy']; ?
br
? echo $row['agent_name']; ?
p

?
$count++;

if ($count == 8) {

echo hrbPage Break/bhrp;
$count = 0;
}

}

while($row = mysql_fetch_array($result));

mysql_close(); } ?

Thanks in advance for any ideas

Ed



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




[PHP] How to loop diplays of 4 column of items, every row?

2002-12-06 Thread Wee Keat [Amorphosium]



Hi all... 

I've tried to figure this one out but I'm really 
having a headache now. So, I really need your help.

Situation:

I have a database of images and its own thumbnails 
created using GD. It worked wonderfully.

Problem:

I want to display ONLY thumbnails in table form, 
incrementing in rows of 4 columns. By this I mean that I want to write a script 
which loops in a way that it displays 4 pictures withdrawn from the database 
into a row, and then for the next 4 images, displays them into the next 
row.

If you don't understand see the gif below... a 
script that displays 4 pictures across first ( arrow 1) , then goes to the next 
row and displays the next 4 ( arrow 2).

I can't work out how can i structure my loop to do 
this.

Question:

Can all the gurus out there please give me a 
pointer? I really can't work out the logic or systematic flow of scripting this 
one.


Thank you so much in advance!


Yours,

Wee Keat Chin

--"Two 
things are infinite: the universe and human stupidity; and I'm not sure about 
the the universe." - Albert Einstein 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Repeating Decimals

2002-12-06 Thread Tom Rogers
Hi,

Friday, December 6, 2002, 5:00:07 AM, you wrote:
S Hello again,

S This is another PHP mathematical question. How can I display a bar over a
S number (overline) if it's a repeating decimal? When the user types in 1 by
S 3, they get 0.. I want it to display as 0.3 with the 3
S overlined. How can I do this keeping in mind that not all numbers will be
S repeating decimals?

Did this as an exercise :)

function check_to_end($str,$pat){
$lp = strlen($pat);
$ls = strlen($str);
$x = 0;
while(true){
$ls = strlen($str);
if($ls  $lp){//string bigger than pattern
$t = substr($str,0,$lp);
if($t != $pat){
return false;
}
$str = substr($str,$lp);
}else{//pattern too big .. checks tail end
$pat = substr($pat,0,strlen($str));
if( $pat != $str) return false; //no repeat
if($x  2) return false; //didn't repeat enough
return true; //found a pattern
}
$x++;
}
}
function repeat($num){
$s = substr(number_format($num,16),0,-1); //make a string
echo $s;
list($a,$b) = split('\.',$s); //split decimal bit out
$l = strlen($b);
for($i=0;$i$l;$i++){ //loop through string
$o = 0;
$k = $b[$i];//number to find
for($y = $i+1;$y$l;$y++){ //loop look for same number
$c = ord($b[$y]);
if(ord($k) == ord($b[$y])){ //got a match
$pat = substr($b,$i,$y-$i); //cut out pattern
$str = substr($b,$i); //string to check
if(check_to_end($str,$pat)){ //see if pattern runs 
till the end
$o = 1; //yep
if(ord($pat) == ord('0')) $o = 2; //were they 
just '0's
break;
}
}
}
if($o)break; // all done
}
if($o == 1){ // a pattern
$r = $a.'.'.substr($b,0,$i).'span 
style=text-decoration:overline'.$pat.'/span';
}elseif($o == 2){ // whole bunch of ending 0s
$r = (substr($b,0,$i) != '')? $a.'.'.substr($b,0,$i):$a;
}else{ //no repeat
$r = $s;
}
return $r;
}
//usage
for($x = 1;$x  100;$x++){
$a = 11/$x;
$res = repeat($a);
echo 'nbsp;nbsp;nbsp;returned: '.$res.'br';
}

The  check_to_end() function could probably be replaced with a regex but those
go in the same basket as vi with my old brain :)

 Regards Tom


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




[PHP] mail function() with MS

2002-12-06 Thread Anthony Ritter
Hi,
I'm using MS Win 98 and my ISP has PHP installed on a MS server.

I'd like to display a HTML form box on my site for users to type in a
message utilizing the PHP mail() function.

I've tested this using Apache on my drive with a html form and a php script
to receive the data and it works fine - but when the site goes live it will
be hosted with an ISP with a MS server - not Apache.

Is it possible to utilize the PHP mail function under these conditions?

I was led to believe that I could change the configurations in my php.ini
file from:

SMTP: localhost

to

SMTP: mail.yourisp.com

Greatly appreciate your advice.

Thanking all in advance.
Tony Ritter





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




Re: [PHP] How to loop diplays of 4 column of items, every row?

2002-12-06 Thread Chris Boget
 I want to display ONLY thumbnails in table form, incrementing in rows of
 4 columns. By this I mean that I want to write a script which loops in a
 way that it displays 4 pictures withdrawn from the database into a row,
 and then for the next 4 images, displays them into the next row.

Inside your loop, keep a counter.  When the counter % 4 = 0, echo out a
/tr.  If you want to put more images on a row, just change the 4 to
whatever number you want.

Chris


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




Re: [PHP] How to loop diplays of 4 column of items, every row?

2002-12-06 Thread Marek Kilimajer
asuming $res holds your query result:

$col=0;
echo 'table';
while($img=mysql_fetch_array($res)) {
   if($col==0) echo 'tr';
   echo td img src=$img[thumb] /td;
   $col++;
   if($col==4) {
   echo '/tr';
   $col=0;
   }
}
if($col!=0) str_repeat('td/td', 4 - $col);
echo '/table';

Not tested

Wee Keat [Amorphosium] wrote:


Hi all... 

I've tried to figure this one out but I'm really having a headache now. So, I really need your help.

Situation:

I have a database of images and its own thumbnails created using GD. It worked wonderfully.

Problem:

I want to display ONLY thumbnails in table form, incrementing in rows of 4 columns. By this I mean that I want to write a script which loops in a way that it displays 4 pictures withdrawn from the database into a row, and then for the next 4 images, displays them into the next row.

If you don't understand see the gif below... a script that displays 4 pictures across first ( arrow 1) , then goes to the next row and displays the next 4 ( arrow 2).

I can't work out how can i structure my loop to do this.

Question:

Can all the gurus out there please give me a pointer? I really can't work out the logic or systematic flow of scripting this one.


Thank you so much in advance!


Yours,

Wee Keat Chin

--
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein 

 



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




Re: [PHP] --with-gd=DIR

2002-12-06 Thread Tom Rogers
Hi,

Friday, December 6, 2002, 10:33:43 PM, you wrote:
GdRZ Hello list,

GdRZ I am running a redhat7.3 box and a customer want to get installed php with 
GD-library support

GdRZ I want to configure php like this:

GdRZ ./configure  --with-gd= where is this directory?

GdRZ How can I find the directory where are the correspondent gd-lib/headers-files so 
that I can 
GdRZ configure php with the correct gd (--with-gd=this I want to knowsupport?

GdRZ Oliver Etzel

GdRZ eu-Domains are coming
GdRZ www.t-host.com


Try:
locate libgd
locate gd.h
that should tell you where they are hiding

-- 
regards,
Tom


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




[PHP] Check wheter GD function is working

2002-12-06 Thread info
Hello list,

how can I check wheter GD-function is working and running?

Oliver Etzel


Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread Tim Ward
everything you need is here

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

in particular fopen(), fputs(), fwrite(), etc.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 1:25 PM
Subject: [PHP] Output of MySQl sorted query to text or Word file.


 
 I've got a routine that queries a MySQL database and outputs the sorted
 results to a web page (script snippet below.) How can I output the exact
 same thing to a txt file using this script?
 
 ?
 
 $count = 0;
 
 $result = mysql_query (SELECT * FROM listings ORDER by a
 DESC);
 
 if ($row = mysql_fetch_array($result)) { 
 
 do { ?
 
 
 ? echo $row['company_name']; ?
 nbsp;nbsp;
 ? echo $row['agent_name']; ?
 nbsp;nbsp;
 ? echo $row['county']; ?
 nbsp;nbsp;
 ? echo $row['city']; ?
 br
 ? echo $row['mls']; ?
 nbsp;nbsp;
 $? echo number_format($row['price'], ,); ?
 nbsp;nbsp;
 ? echo $row['area']; ?
 br
 ? echo $row['copy']; ?
 br
 ? echo $row['agent_name']; ?
 p
 
 ?
 $count++;
 
 if ($count == 8) {
 
 echo hrbPage Break/bhrp;
 $count = 0;
 }
 
 }
 
 while($row = mysql_fetch_array($result));
 
 mysql_close(); } ?
 
 Thanks in advance for any ideas
 
 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




php-general Digest 6 Dec 2002 14:18:32 -0000 Issue 1747

2002-12-06 Thread php-general-digest-help

php-general Digest 6 Dec 2002 14:18:32 - Issue 1747

Topics (messages 127216 through 127255):

Re: Sending no content-type header?
127216 by: Chris Wesley
127217 by: Leif K-Brooks

Need Redirection Trick...
127218 by: . Nilaab
127223 by: Jason Wong
127224 by: Roger Lewis
127226 by: . Nilaab

Re: PHP includes without access to the default directory
127219 by: Morgan Hughes
127225 by: Tom Rogers

Re:
127220 by: Karl James

empty string parameters to backslashes?
127221 by: andyw.scroom.com
127237 by: DL Neil

Re: MySQL ?
127222 by: Justin French
127227 by: Tom Rogers

md5 question
127228 by: conbud
127229 by: Chris Wesley
127232 by: Jason Wong

Making random string function function more random?
127230 by: Leif K-Brooks

$DOCUMENT_ROOT
127231 by: christopher calicott

HOW GET ALL HTML CONTENT
127233 by: nice_boy

ezmlm
127234 by: Randum Ian
127235 by: Jason Wong

Re: How to create user in mySQL ?
127236 by: Krzysztof Dziekiewicz

Re: Repeating Decimals
127238 by: Marek Kilimajer
127249 by: Tom Rogers

PHP query to javascript array
127239 by: Christian Ista
127242 by: Marek Kilimajer

Re: Checking for Overlapping Dates
127240 by: DL Neil
127246 by: DL Neil

GD support in PHP 4.1.2
127241 by: GoodnGo.de \(R\) Zentrale

Cookies help please
127243 by: Steve Vernon

--with-gd=DIR
127244 by: GoodnGo.de \(R\) Zentrale
127245 by: info.t-host.com
127253 by: Tom Rogers

Output of MySQl sorted query to text or Word file.
127247 by: ed.home.homes2see.com
127255 by: Tim Ward

How to loop diplays of 4 column of items, every row?
127248 by: Wee Keat [Amorphosium]
127251 by: Chris Boget
127252 by: Marek Kilimajer

mail function() with MS
127250 by: Anthony Ritter

Check wheter GD function is working
127254 by: info.t-host.com

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---
On Thu, 5 Dec 2002, Leif K-Brooks wrote:
 I'm running a few simple php scripts from the (windows) command line.
  Since I'm not using a web browser to view it, the HTTP headers are
 annoying and pointless.  I've turned expose_php off in php.ini, but
 commenting out default_mimetype changes nothing, and setting it to an
 empty string sends a blank content-type header.  Is there any way to do
 this?

php.exe -q

~Chris


---End Message---
---BeginMessage---
 Ok, thanks a lot.  For what it's worth, here's my simple .bat file for 
executing php files:
@ECHO OFF
IF NOT EXIST %1.php goto usage
php.exe -q %1.php
goto end
:usage
echo ÚÄÄÄ¿
echo ³   USAGE   ³
echo ³Type php.bat (without quotes)³
echo ³ followed by the  name of a³
echo ³valid php file without the .php³
echo ³extension. ³
echo ÀÄÄÄÙ
:end

Chris Wesley wrote:

On Thu, 5 Dec 2002, Leif K-Brooks wrote:
 

I'm running a few simple php scripts from the (windows) command line.
Since I'm not using a web browser to view it, the HTTP headers are
annoying and pointless.  I've turned expose_php off in php.ini, but
commenting out default_mimetype changes nothing, and setting it to an
empty string sends a blank content-type header.  Is there any way to do
this?
   


php.exe -q

   ~Chris


 


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



---End Message---
---BeginMessage---
Hello Everyone,

I have a simple problem that, I think, might require a little trick to be
used. I have a list of products in a database that is organized by
categories and subcategories. Categories can have as many subcategories as
it wants, but some categories don't need to have a subcategory at all.

In the following code cat refers to category and subcat refers to
subcategory.

cat_data and subcat_data refers to a multi-dimentional array, pulled from
the DB, with values of an id and a name.
example: cat_data[row_number][name_of_category] and
cat_data[row_number][id].

Ok, before I ask the question, here's the code:

[-- snip --]
?php
include (nay_general.php);
include ($include_path/base_db.class); // db

$db = new base_db();
$cat_data = $db-get_cat_data();
for ($i=0; $i  count($cat_data); $i++) {
   echo 'a href=' . $PHP_SELF . ?cat_id= . $cat_data[$i][id] . '' .
$cat_data[$i][name] . /abr /\n;
   if ($cat_id) {
  $subcat_data = $db-get_subcat_data($cat_id);
  if ($subcat_data != 0  ($cat_id == $cat_data[$i][id])) {
 

Re: [PHP] mail function() with MS

2002-12-06 Thread Marek Kilimajer
Your ISP should set it up, if  not, I believe there is a class that can 
comunicate with SMTP server
directly, check www.phpclasses.org

Anthony Ritter wrote:

Hi,
I'm using MS Win 98 and my ISP has PHP installed on a MS server.

I'd like to display a HTML form box on my site for users to type in a
message utilizing the PHP mail() function.

I've tested this using Apache on my drive with a html form and a php script
to receive the data and it works fine - but when the site goes live it will
be hosted with an ISP with a MS server - not Apache.

Is it possible to utilize the PHP mail function under these conditions?

I was led to believe that I could change the configurations in my php.ini
file from:

SMTP: localhost

to

SMTP: mail.yourisp.com

Greatly appreciate your advice.

Thanking all in advance.
Tony Ritter





 



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




Re: [PHP] mail function() with MS

2002-12-06 Thread DL Neil
Hi Anthony,

 I'm using MS Win 98 and my ISP has PHP installed on a MS server.
 I'd like to display a HTML form box on my site for users to type in a
 message utilizing the PHP mail() function.

 I've tested this using Apache on my drive with a html form and a php
script
 to receive the data and it works fine - but when the site goes live it
will
 be hosted with an ISP with a MS server - not Apache.
 Is it possible to utilize the PHP mail function under these conditions?

 I was led to believe that I could change the configurations in my php.ini
 file from:
 SMTP: localhost
 to
 SMTP: mail.yourisp.com


I use Win2000Prof with Apache, and have Win2000Svr with IIS. In each case I
use a separate and external SMTP server.

This is the relevant section of PHP.INI:
[mail function]
; For Win32 only.
SMTP=smtp.ISPs.domain
; For Win32 only.
sendmail_from=MyAddress@MyDomain

When you use PHP provided by a service, you will need to establish what they
have set up as SMTP server, and if it is not acceptable to you (for whatever
reason that might be) work out how to override it.

I use a script/class from PHPguru.org, and I can't say for sure that it even
looks at the PHP.INI settings because I set them directly/again within the
mail function's code. Highly recommended!

Regards,
=dn


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




Re: [PHP] mail function() with MS

2002-12-06 Thread Anthony Ritter
- Original Message -
From: DL Neil [EMAIL PROTECTED]
To: Anthony Ritter [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, December 06, 2002 8:47 AM
Subject: Re: [PHP] mail function() with MS


 Hi Anthony...{snipped]
.


Thank you DL.

Qusetion: 1:

What would happen if I changed the php.ini settings to:

SMTP=mail.yourisp.com

sendmail_from=MyAddress@MyDomain

as opposed to:

SMTP=smtp.ISPs.domain
..

 When you use PHP provided by a service, you will need to establish what
they
 have set up as SMTP server, and if it is not acceptable to you (for
whatever
 reason that might be) work out how to override it.
..

I'm not sure why I would not think it is not acceptable. Please advise.

Also...let's say I'm developing another site with a mail form box using
Win98 and Apache

Do I then have to reconfigure the php.ini files back to localhost from:

SMTP=mail.yourisp.com

Thank you.
TR


 I use a script/class from PHPguru.org, and I can't say for sure that it
even
 looks at the PHP.INI settings because I set them directly/again within the
 mail function's code. Highly recommended!





---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




[PHP] Installation of PHP with gd support

2002-12-06 Thread info
Hi list,

anybody here who knows a HowTo of installing PHP with gd support?

Oliver Etzel


[PHP] HELP with ODBC Connection

2002-12-06 Thread Daniel
Please help. I have a basic scipt:

$connection_id=odbc_connect($DSN,$user,$pass);
$sql=select * from whatever;
$stmt=odbc_prepare($connection_id,$sql);
$result=odbc_execute($connection_id,$stmt);

this script used to work on RH-7.3 with php-4.1.2
the script will not work anymore when i installed RH-8 using php-4.2.2
the connection IS successful, but when i try anything after that i get this
error:

Warning: SQL error: [unixODBC][IBM][iSeries Access ODBC Driver]Error in host
server data stream., SQL state S1000 in SQLPrepare

i can connect,prepare and execute statements from c++ so it must be php
specific?
please help!!



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




[PHP] PHP adding slash to MySql results

2002-12-06 Thread Kevin Lowe
Hi,

I have just noticed a problem reading MySql data with PHP running as an
apache module.

Basically, any data retrieved from MySql that contains a single quote (and
no doubt other characters too) is displayed with a slash in it when printed
by PHP.

For example:

$surname = O'Brien;
print $surname;

displays -  O'Brien - while

$surname=mysql_result($result,0,surname);
print $surname;

displays -  O\'Brien - even thought doing a select from the shell shows that
is  stored in mysql without the slash


My ISP reciently upgraded from 4.12 to 4.2.2 and i wonder if this has
anything to do with this, as these scripts did not ass slashes in print
outputs before and have not been changed.

I'm sure this is some PHP configuration thing, but magic quotes are off, and
in any case I assumed this applied to incoming data only?

What do I need to change and can I do this within a .htaccess file so it can
easily be applied to all my scripts without changing them?

Many thanks,

Kevin






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




[PHP] Error GD

2002-12-06 Thread info
Hi Paul,

compiled PHP like that
./configure --with-config-file-path=/etc --enable-force-cgi-redirect --with-mysql 
-with-gd=/usr/local/gd2 --no-create --no-recursion

Error Message:
In file included from gd.c:83:
gd_ctx.c: In function `_php_image_output_ctx':
gd_ctx.c:70: structure has no member named `free'
gd_ctx.c:98: structure has no member named `free'
gd.c: In function `_php_image_create_from':
gd.c:1176: structure has no member named `free'
make[3]: *** [gd.lo] Fehler 1


[PHP] Re: PHP adding slash to MySql results

2002-12-06 Thread Kevin Lowe


Forgot to say this is running in FreeBSD



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




Re: [PHP] Check wheter GD function is working

2002-12-06 Thread @ Edwin
Hello,

[EMAIL PROTECTED] wrote:

 Hello list,
 
 how can I check wheter GD-function is working and running?

First check phpinfo() and see under gd then read more info here:

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

- E

PS: Pls. don't flood the list with same messages...

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




Re: [PHP] PHP adding slash to MySql results

2002-12-06 Thread Marek Kilimajer
You ISP turned magic_quotes_runtime on, use set_magic_quotes_runtime() 
to override it.

Kevin Lowe wrote:

Hi,

I have just noticed a problem reading MySql data with PHP running as an
apache module.

Basically, any data retrieved from MySql that contains a single quote (and
no doubt other characters too) is displayed with a slash in it when printed
by PHP.

For example:

$surname = O'Brien;
print $surname;

displays -  O'Brien - while

$surname=mysql_result($result,0,surname);
print $surname;

displays -  O\'Brien - even thought doing a select from the shell shows that
is  stored in mysql without the slash


My ISP reciently upgraded from 4.12 to 4.2.2 and i wonder if this has
anything to do with this, as these scripts did not ass slashes in print
outputs before and have not been changed.

I'm sure this is some PHP configuration thing, but magic quotes are off, and
in any case I assumed this applied to incoming data only?

What do I need to change and can I do this within a .htaccess file so it can
easily be applied to all my scripts without changing them?

Many thanks,

Kevin






 



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




Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread ed


On Fri, 6 Dec 2002, Tim Ward wrote:

 everything you need is here
 
 http://www.php.net/manual/en/ref.filesystem.php
 
 in particular fopen(), fputs(), fwrite(), etc.
 
 Tim Ward
 http://www.chessish.com
 mailto:[EMAIL PROTECTED]


 I found all this and have worked on getting the file output and formated
to my (actually my boss') liking. The text file gets formatted just fine
when read in Linux but the newlines appear as blocks when viewing in
Windows. I've included the scipt that reads and formats the output below.
What do I need to use to create real linefeeds or new lines when viewing
under windows?

TIA,

Ed

?

include (../global.php);

mysql_connect ($host, $user, $pass);

mysql_select_db ($database);

$count = 0;

$fp = fopen($ad_path/example.txt, w);
$newline = \n;
$space =  ;
$dollar = \$;
$ln = ---;
$br = Page Break;

$result = mysql_query (SELECT * FROM listings ORDER by area, price
DESC);

if ($row = mysql_fetch_array($result)) {

do {

fputs($fp, $row['mls']);
fputs($fp, $space);
fputs($fp, $dollar);
fputs($fp, number_format($row['price'], ,));
fputs($fp, $space);
fputs($fp, $row['area']);
fputs($fp, $newline);
fputs($fp, $row['copy']);
fputs($fp, $newline);
fputs($fp, $newline);

$count++;

if ($count == 8) {

fputs($fp, $ln);
fputs($fp, $br);
fputs($fp, $ln);
fputs($fp, $nl);
fputs($fp, $nl);

$count = 0;

}

}

while($row = mysql_fetch_array($result));

mysql_close();

fclose($fp);

}

?


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




Re: [PHP] mail function() with MS

2002-12-06 Thread DL Neil
Hi Anthony

 Qusetion: 1:
 What would happen if I changed the php.ini settings to:
 SMTP=mail.yourisp.com
 sendmail_from=MyAddress@MyDomain
 as opposed to:
 SMTP=smtp.ISPs.domain

=as long as the SMTP server is accessible and you have access rights, then
it can be anyone's/anywhere...


  When you use PHP provided by a service, you will need to establish what
 they
  have set up as SMTP server, and if it is not acceptable to you (for
 whatever
  reason that might be) work out how to override it.
 I'm not sure why I would not think it is not acceptable. Please advise.

=Some web-hosts only have the one PHP.INI. That means you would have to use
what they define as SMTP server. I don't know (a) what the host may define,
(b) what you will find acceptable... ie it may or may not result in an
issue/be relevant to you.


 Also...let's say I'm developing another site with a mail form box using
 Win98 and Apache
 Do I then have to reconfigure the php.ini files back to localhost from:
 SMTP=mail.yourisp.com

=each PHP/web server has its own PHP.INI file. Thus each defines its own
(default) SMTP server.

=it may not be necessary to move SMTP servers: remember that your FROM:
address can be [EMAIL PROTECTED] even though the PHP-defined SMTP server is
smtp.isp.domain.

=if you use a good script/class, each application you build can define its
own SMTP parameters and have its own domain/From address, etc.


 Thank you.

=a pleasure.

=did I understand the intent of the question correctly?
=dn




 TR


  I use a script/class from PHPguru.org, and I can't say for sure that it
 even
  looks at the PHP.INI settings because I set them directly/again within
the
  mail function's code. Highly recommended!





 ---
 [This E-mail scanned for viruses by gonefishingguideservice.com]




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




Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread @ Edwin
Hello,

[EMAIL PROTECTED] wrote:

...[snip]...

 What do I need to use to create real linefeeds or new lines when viewing
 under windows?

Try the manual again and check specifically the User Contributed
Notes--I'm sure you'll find something :)

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

- E

...[snip]...

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




[PHP] where is a new HowTo of compiling php with gd support???

2002-12-06 Thread GoodnGo.de \(R\) Zentrale
Hi folks,

a single and simple question :

Where can I find a  new HowTo of compiling php with gd support???

Inkl Bugtraps?

Oliver Etzel


[PHP] Where can I find a new HowTo of compiling php with gd support???

2002-12-06 Thread info
Hi folks,

a single and simple question :

Where can I find a  new HowTo of compiling php with gd support???

Incl Bugtraps?

Oliver Etzel


Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread 1LT John W. Holmes
 What do I need to use to create real linefeeds or new lines when viewing
 under windows?
[snip]
 $newline = \n;

Use \r\n for Windows. 

---John Holmes...

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




Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread ed

success. And I have read through the user contributed notes and havent'
found it there.

Ed


On Fri, 6 Dec 2002, 1LT John W. Holmes wrote:

  What do I need to use to create real linefeeds or new lines when viewing
  under windows?
 [snip]
  $newline = \n;
 
 Use \r\n for Windows. 
 
 ---John Holmes...
 


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




Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread Marek Kilimajer
newline in windows is \r\n - $newline=\r\n;

[EMAIL PROTECTED] wrote:




I found all this and have worked on getting the file output and formated
to my (actually my boss') liking. The text file gets formatted just fine
when read in Linux but the newlines appear as blocks when viewing in
Windows. I've included the scipt that reads and formats the output below.
What do I need to use to create real linefeeds or new lines when viewing
under windows?

 



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




Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread Chris Hewitt
[EMAIL PROTECTED] wrote:



What do I need to use to create real linefeeds or new lines when viewing
under windows?


Unices use only the newline character (interpreted as line feed in 
dos/win), whereas dos/win uses carriage return and line feed. So to 
get it to show right in e.g. NotePad change:


$newline = \n;


to
$newline = \r\n;

but this won't display correctly under unix. Preferably when in dos/win 
view the file with a text editor that understands both e.g. PFE 
(Programmers File Editor).

However, I'd use the end of line sequence for the system (if any) that 
needs to have the file human readable. There are the dos2unix and 
unix2dos programs in linux to convert between the two, if this helps.

HTH
Chris


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



[PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
I'm using MS Win98 and Apache and getting the following after submitting the
mail form:
..
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14


The html and php scripts follow along with my php.ini settings.

Any help would be appreciated.

Thank you.
Tony Ritter

The following e-mail has been sent:
Your Name:
Linda

Your E-Mail Address:
[EMAIL PROTECTED]

Message:
Test
.


//this is the html form

HTML
HEAD
TITLESimple Feedback Form/TITLE
/HEAD
BODY

FORM METHOD=post ACTION=send_simpleform.php


PstrongYour Name:/strongbr
INPUT type=text NAME=sender_name SIZE=30/p

PstrongYour E-Mail Address:/strongbr
INPUT type=text NAME=sender_email SIZE=30/p

PstrongMessage:/strongbr
TEXTAREA NAME=message COLS=30 ROWS=5 WRAP=virtual/TEXTAREA/p

PINPUT TYPE=submit NAME=submit VALUE=Send This Form/p

/FORM

/BODY
/HTML
..
//this is the php script
?
if (($sender_name == )  ($sender_email == )  ($message == )) {
 header(Location: http://localhost/simple_form.html;);
 exit;
}
$msg = E-MAIL SENT FROM WWW SITE\n;
$msg .= Sender's Name:$sender_name\n;
$msg .= Sender's E-Mail:  $sender_email\n;
$msg .= Message:  $message\n\n;
$to = [EMAIL PROTECTED];
$subject = Web Site Feedback;
$mailheaders = From: My Web Site  \n;
$mailheaders .= Reply-To: $sender_email\n\n;
mail($to, $subject, $msg, $mailheaders);
?
HTML
HEAD
TITLESimple Feedback Form Sent/TITLE
/HEAD
BODY
H1The following e-mail has been sent:/H1
PstrongYour Name:/strongbr
? echo $sender_name; ?
PstrongYour E-Mail Address:/strongbr
? echo $sender_email; ?
PstrongMessage:/strongbr
? echo $message; ?
/BODY
/HTML

My php.ini settings are:

[mail function]
SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path =  ;for unix only,
may supply arguments as well (default is sendmail -t)





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




Re: [PHP] PHP adding slash to MySql results

2002-12-06 Thread Kevin Lowe
Hi Marek,

That is switched off. However, I was just having another look at the
problem, and, it actually appears to be fixed! I didnt shange anything, so
the ISP must have done something?

Thanks,
Kevin


Marek Kilimajer [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You ISP turned magic_quotes_runtime on, use set_magic_quotes_runtime()
 to override it.




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




[PHP] Unsubscribing

2002-12-06 Thread Van Andel, Robert
Anyone know how to unsubscribe from this list.  I have tried several different things 
including the unscribe field on the mailing list page and an unsubscribe command via 
email.

Robbert van Andel 





Re: [PHP] Error GD

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 1:41:22 AM, you wrote:
ithc Hi Paul,

ithc compiled PHP like that
ithc ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion

ithc Error Message:
ithc In file included from gd.c:83:
ithc gd_ctx.c: In function `_php_image_output_ctx':
ithc gd_ctx.c:70: structure has no member named `free'
ithc gd_ctx.c:98: structure has no member named `free'
ithc gd.c: In function `_php_image_create_from':
ithc gd.c:1176: structure has no member named `free'
ithc make[3]: *** [gd.lo] Fehler 1

I think the function name got changed to gdFree(), I'll try to find more info if
I can

-- 
regards,
Tom


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




Re[2]: [PHP] Error GD

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 2:31:09 AM, you wrote:
TR Hi,

TR Saturday, December 7, 2002, 1:41:22 AM, you wrote:
ithc Hi Paul,

ithc compiled PHP like that
ithc ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion

ithc Error Message:
ithc In file included from gd.c:83:
ithc gd_ctx.c: In function `_php_image_output_ctx':
ithc gd_ctx.c:70: structure has no member named `free'
ithc gd_ctx.c:98: structure has no member named `free'
ithc gd.c: In function `_php_image_create_from':
ithc gd.c:1176: structure has no member named `free'
ithc make[3]: *** [gd.lo] Fehler 1

TR I think the function name got changed to gdFree(), I'll try to find more info if
TR I can

TR -- 
TR regards,
TR Tom


I was close :) change the lines in the offending files to this:

ctx-gd_free(ctx);

That should fix it

-- 
regards,
Tom


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




Re: [PHP] mail() problems...

2002-12-06 Thread DL Neil
Anthony,

Do you have an SMTP server on your Win98 localhost?
Recommend you change the PHP.INI SMTP= to say the same as your email
package's server definitions.

=dn



 I'm using MS Win98 and Apache and getting the following after submitting
the
 mail form:
 ..
 Warning: Failed to Connect in c:\program files\apache
 group\apache\htdocs\send_simpleform.php on line 14
 

 The html and php scripts follow along with my php.ini settings.

 Any help would be appreciated.

 Thank you.
 Tony Ritter

 The following e-mail has been sent:
 Your Name:
 Linda

 Your E-Mail Address:
 [EMAIL PROTECTED]

 Message:
 Test
 .


 //this is the html form

 HTML
 HEAD
 TITLESimple Feedback Form/TITLE
 /HEAD
 BODY

 FORM METHOD=post ACTION=send_simpleform.php


 PstrongYour Name:/strongbr
 INPUT type=text NAME=sender_name SIZE=30/p

 PstrongYour E-Mail Address:/strongbr
 INPUT type=text NAME=sender_email SIZE=30/p

 PstrongMessage:/strongbr
 TEXTAREA NAME=message COLS=30 ROWS=5 WRAP=virtual/TEXTAREA/p

 PINPUT TYPE=submit NAME=submit VALUE=Send This Form/p

 /FORM

 /BODY
 /HTML
 ..
 //this is the php script
 ?
 if (($sender_name == )  ($sender_email == )  ($message == )) {
  header(Location: http://localhost/simple_form.html;);
  exit;
 }
 $msg = E-MAIL SENT FROM WWW SITE\n;
 $msg .= Sender's Name:$sender_name\n;
 $msg .= Sender's E-Mail:  $sender_email\n;
 $msg .= Message:  $message\n\n;
 $to = [EMAIL PROTECTED];
 $subject = Web Site Feedback;
 $mailheaders = From: My Web Site  \n;
 $mailheaders .= Reply-To: $sender_email\n\n;
 mail($to, $subject, $msg, $mailheaders);
 ?
 HTML
 HEAD
 TITLESimple Feedback Form Sent/TITLE
 /HEAD
 BODY
 H1The following e-mail has been sent:/H1
 PstrongYour Name:/strongbr
 ? echo $sender_name; ?
 PstrongYour E-Mail Address:/strongbr
 ? echo $sender_email; ?
 PstrongMessage:/strongbr
 ? echo $message; ?
 /BODY
 /HTML
 
 My php.ini settings are:

 [mail function]
 SMTP   = localhost   ;for win32 only
 sendmail_from = [EMAIL PROTECTED] ;for win32 only
 ;sendmail_path =  ;for unix only,
 may supply arguments as well (default is sendmail -t)





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

2002-12-06 Thread Chris Shiflett
--- Van Andel, Robert [EMAIL PROTECTED] wrote:
 Anyone know how to unsubscribe from this list. I have
 tried several different things including the unscribe
 field on the mailing list page and an unsubscribe command
 via email.

The unsubscribe page (http://www.php.net/unsub.php) should
work. Are you sure you are trying to unsubscribe the
correct email address?

Chris

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




[PHP] Updating int4 field with multiple values

2002-12-06 Thread Andre Dubuc
I would like to update an int4 column with new values appended to the end 
(preferably with a delimiter such as @ or a comma). 

With PostgreSQl 7.2, I can't seem to add the number with a delimiter (it 
gives me a parser error at the delimiter). For example, If I update the field 
'radd' that already has  number 36 in it, it does append the new number, but 
without any space. So, if I updated with a new number, 6, the 'radd' result 
would now be '366' instead of '36 6'

Without the delimiter, it might be difficult to do selects on this field when 
I need to find a specific number within the field. (Btw, I'm using 
$_SESSION['rid'] . . . etc instead of $rid in the actual code.) Any ideas 
what I'm doing wrong?

Any suggestions will be greatly appreciated.

**

Simplified code:


/php
. . .
/* for simplicity set $new= 6   $new is int4 */

$new = 6; 

include(dbc.php);
$query = UPDATE rap SET radd = radd||', $new' WHERE rid = '12';
$result = pg_exec($db, $query);
if (!$result) {print What? Can't do what you're asking me!;}
if ($result) {print Record updated;}
pg_close($db);
. . .
?

Tia,
Andre

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




[PHP] $_FILES associative array

2002-12-06 Thread Mako Shark
I'm trying to find some documentation on the $_FILES
array, but on PHP, it's a little confusing. I read the
documentation and the comment from rep_spam@..., but
that wasn't too clear to me either.

I'm aware that when uploading a file named
$uploadedfile, the size, name, etc. get stored in
variables called $uploadedfile_size, _name,  But
when using the $_FILES array, does everything then get
stored in $_FILES[uploadedfile],
$_FILES[uploadedfile_size], etc...?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] More $_ array question...

2002-12-06 Thread Mako Shark
If I want to access an array of something from a form,
is it true that I just have to use
$_POST[array[$counter]? So I can legitimately do a
count() of this array, like count($_POST[array])?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] $_FILES associative array

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 2:56:53 AM, you wrote:
MS I'm trying to find some documentation on the $_FILES
MS array, but on PHP, it's a little confusing. I read the
MS documentation and the comment from rep_spam@..., but
MS that wasn't too clear to me either.

MS I'm aware that when uploading a file named
MS $uploadedfile, the size, name, etc. get stored in
MS variables called $uploadedfile_size, _name,  But
MS when using the $_FILES array, does everything then get
MS stored in $_FILES[uploadedfile],
MS $_FILES[uploadedfile_size], etc...?

If your input is like this:

input type=file name=userfile size=52 /

The array you get would look like this:

$_FILES['userfile']['name'] The original name of the file on the client machine. 

$_FILES['userfile']['type'] The mime type of the file, if the browser provided this 
information. An example would be image/gif. 

$_FILES['userfile']['size'] The size, in bytes, of the uploaded file. 

$_FILES['userfile']['tmp_name'] The temporary filename of the file in which the 
uploaded file was stored on the server


-- 
regards,
Tom


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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
DL,
I'm not sure I understand.

I had this working a few months ago by changing the php.ini settings to:

SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only

and I was able to run that script on my box and get an e-mail returned to
me.

Now, I getting a failed to connect.

Please advise.

I'm using MS OE5.

Thank you.
TR
..


- Original Message -
From: DL Neil [EMAIL PROTECTED]
To: Anthony Ritter [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, December 06, 2002 10:37 AM
Subject: Re: [PHP] mail() problems...


 Anthony,

 Do you have an SMTP server on your Win98 localhost?
 Recommend you change the PHP.INI SMTP= to say the same as your email
 package's server definitions.

 =dn



  I'm using MS Win98 and Apache and getting the following after submitting
 the
  mail form:
  ..
  Warning: Failed to Connect in c:\program files\apache
  group\apache\htdocs\send_simpleform.php on line 14
  
 
  The html and php scripts follow along with my php.ini settings.
 
  Any help would be appreciated.
 
  Thank you.
  Tony Ritter
 
  The following e-mail has been sent:
  Your Name:
  Linda
 
  Your E-Mail Address:
  [EMAIL PROTECTED]
 
  Message:
  Test
  .
 
 
  //this is the html form
 
  HTML
  HEAD
  TITLESimple Feedback Form/TITLE
  /HEAD
  BODY
 
  FORM METHOD=post ACTION=send_simpleform.php
 
 
  PstrongYour Name:/strongbr
  INPUT type=text NAME=sender_name SIZE=30/p
 
  PstrongYour E-Mail Address:/strongbr
  INPUT type=text NAME=sender_email SIZE=30/p
 
  PstrongMessage:/strongbr
  TEXTAREA NAME=message COLS=30 ROWS=5 WRAP=virtual/TEXTAREA/p
 
  PINPUT TYPE=submit NAME=submit VALUE=Send This Form/p
 
  /FORM
 
  /BODY
  /HTML
  ..
  //this is the php script
  ?
  if (($sender_name == )  ($sender_email == )  ($message == )) {
   header(Location: http://localhost/simple_form.html;);
   exit;
  }
  $msg = E-MAIL SENT FROM WWW SITE\n;
  $msg .= Sender's Name:$sender_name\n;
  $msg .= Sender's E-Mail:  $sender_email\n;
  $msg .= Message:  $message\n\n;
  $to = [EMAIL PROTECTED];
  $subject = Web Site Feedback;
  $mailheaders = From: My Web Site  \n;
  $mailheaders .= Reply-To: $sender_email\n\n;
  mail($to, $subject, $msg, $mailheaders);
  ?
  HTML
  HEAD
  TITLESimple Feedback Form Sent/TITLE
  /HEAD
  BODY
  H1The following e-mail has been sent:/H1
  PstrongYour Name:/strongbr
  ? echo $sender_name; ?
  PstrongYour E-Mail Address:/strongbr
  ? echo $sender_email; ?
  PstrongMessage:/strongbr
  ? echo $message; ?
  /BODY
  /HTML
  
  My php.ini settings are:
 
  [mail function]
  SMTP   = localhost   ;for win32 only
  sendmail_from = [EMAIL PROTECTED] ;for win32 only
  ;sendmail_path =  ;for unix only,
  may supply arguments as well (default is sendmail -t)
 
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 ---
 [This E-mail scanned for viruses by gonefishingguideservice.com]



---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




Re: [PHP] More $_ array question...

2002-12-06 Thread Tim Ward
not quite ... 
if the form elements are (e.g) input name='array[0]' ..., etc.
then you need $_POST[array][0] to refer to the element
(just like any other array of arrays in PHP).

but you're right about count($_POST[array]) ...
and foreach ($_POST[array] as $key=$value), etc.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: Mako Shark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 5:03 PM
Subject: [PHP] More $_ array question...


 If I want to access an array of something from a form,
 is it true that I just have to use
 $_POST[array[$counter]? So I can legitimately do a
 count() of this array, like count($_POST[array])?
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.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] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread @ Edwin
Oops...

[EMAIL PROTECTED] wrote:
 success. And I have read through the user contributed notes and havent'
 found it there.

Sorry 'bout the link earlier. (You could find some hints under file()
though...)

- E

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




Re: [PHP] mail() problems...

2002-12-06 Thread @ Edwin
Hello,

Anthony Ritter [EMAIL PROTECTED] wrote:

 DL,
 I'm not sure I understand.

Let me try :)

 I had this working a few months ago by changing the php.ini settings to:

 SMTP   = localhost   ;for win32 only
 sendmail_from = [EMAIL PROTECTED] ;for win32 only

 and I was able to run that script on my box and get an e-mail returned to
 me.

 Now, I getting a failed to connect.

Strange... (I mean it's strange that it worked before. I don't think that
setting would work unless you have your own mail server in your pc.)

 Please advise.

I think what DL meant was to change localhost to

  (Ex.)  smtp.yourdomain.com

 I'm using MS OE5.

In that case you'll find that info by clicking Tools - Account - Mail -
Property then click Server and check under SMTP.

HTH,

- E

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




Re: [PHP] mail() problems...

2002-12-06 Thread DL Neil
Anthony,

 I'm not sure I understand.

=that makes one more! This feature is a bit of a minefield - but once you
get a handle on it, its too useful to be without...


 I had this working a few months ago by changing the php.ini settings to:
 SMTP   = localhost   ;for win32 only
 sendmail_from = [EMAIL PROTECTED] ;for win32 only
 and I was able to run that script on my box and get an e-mail returned to
 me.
 Now, I getting a failed to connect.
 I'm using MS OE5.

=this can only work if:
a) there is an SMTP server on the localhost (and the DNS finds it), or
b) the code wrapped around mail() specifies a valid and reachable SMTP
server, or
c) the code sidesteps the PHP mail facility completely by doing something
else, or
d) its not a Win box (and needs a completely different approach)

=if it was working, it was working; I'm not sure what has been
updated/replaced since - but let's not even go down that track.

=I assume that the Win98 machine has outbound email working from some MTA,
eg Outlook [Express]. Check its definition for an SMTP server. Cut-and-paste
from there into PHP.INI.

=also (because I'm a simple boy), forget all the optional headers etc, just
use a stripped down/simple email stub-script for testing/proving.

=If PHP's mail() can be persuaded to work, thereafter it (and any scripts)
can be 'tweaked'/made better - or we can look back and compare...

=dn


 - Original Message -
 From: DL Neil [EMAIL PROTECTED]
 To: Anthony Ritter [EMAIL PROTECTED];
 [EMAIL PROTECTED]
 Sent: Friday, December 06, 2002 10:37 AM
 Subject: Re: [PHP] mail() problems...


  Anthony,
 
  Do you have an SMTP server on your Win98 localhost?
  Recommend you change the PHP.INI SMTP= to say the same as your email
  package's server definitions.
 
  =dn
 
 
 
   I'm using MS Win98 and Apache and getting the following after
submitting
  the
   mail form:
   ..
   Warning: Failed to Connect in c:\program files\apache
   group\apache\htdocs\send_simpleform.php on line 14
   
  
   The html and php scripts follow along with my php.ini settings.
  
   Any help would be appreciated.
  
   Thank you.
   Tony Ritter
  
   The following e-mail has been sent:
   Your Name:
   Linda
  
   Your E-Mail Address:
   [EMAIL PROTECTED]
  
   Message:
   Test
   .
  
  
   //this is the html form
  
   HTML
   HEAD
   TITLESimple Feedback Form/TITLE
   /HEAD
   BODY
  
   FORM METHOD=post ACTION=send_simpleform.php
  
  
   PstrongYour Name:/strongbr
   INPUT type=text NAME=sender_name SIZE=30/p
  
   PstrongYour E-Mail Address:/strongbr
   INPUT type=text NAME=sender_email SIZE=30/p
  
   PstrongMessage:/strongbr
   TEXTAREA NAME=message COLS=30 ROWS=5 WRAP=virtual/TEXTAREA/p
  
   PINPUT TYPE=submit NAME=submit VALUE=Send This Form/p
  
   /FORM
  
   /BODY
   /HTML
   ..
   //this is the php script
   ?
   if (($sender_name == )  ($sender_email == )  ($message == ))
{
header(Location: http://localhost/simple_form.html;);
exit;
   }
   $msg = E-MAIL SENT FROM WWW SITE\n;
   $msg .= Sender's Name:$sender_name\n;
   $msg .= Sender's E-Mail:  $sender_email\n;
   $msg .= Message:  $message\n\n;
   $to = [EMAIL PROTECTED];
   $subject = Web Site Feedback;
   $mailheaders = From: My Web Site  \n;
   $mailheaders .= Reply-To: $sender_email\n\n;
   mail($to, $subject, $msg, $mailheaders);
   ?
   HTML
   HEAD
   TITLESimple Feedback Form Sent/TITLE
   /HEAD
   BODY
   H1The following e-mail has been sent:/H1
   PstrongYour Name:/strongbr
   ? echo $sender_name; ?
   PstrongYour E-Mail Address:/strongbr
   ? echo $sender_email; ?
   PstrongMessage:/strongbr
   ? echo $message; ?
   /BODY
   /HTML
   
   My php.ini settings are:
  
   [mail function]
   SMTP   = localhost   ;for win32 only
   sendmail_from = [EMAIL PROTECTED] ;for win32 only
   ;sendmail_path =  ;for unix only,
   may supply arguments as well (default is sendmail -t)
  
  
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
  ---
  [This E-mail scanned for viruses by gonefishingguideservice.com]
 
 

 ---
 [This E-mail scanned for viruses by gonefishingguideservice.com]




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




Re: [PHP] Where can I find a new HowTo of compiling php with gd support???

2002-12-06 Thread @ Edwin
Did you try Google?

  Keyword: compiling php with gd support

[EMAIL PROTECTED] wrote:
 Hi folks,
 
 a single and simple question :
 
 Where can I find a  new HowTo of compiling php with gd support???
 
 Incl Bugtraps?
 
 Oliver Etzel

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




[PHP] String to an Array

2002-12-06 Thread Rodrigo de Oliveira Costa
Hi guys, I got a string that I need to be transformed into na array of
characters, something like:
 
 
$str  =im the one trying to do this;
 
//this is the string
 
I'd like to get an array that I can access something like $array[0] and
get the value  i . And this foward. Anyone have any clues on this?
 
Thanks,
Rodrigo
 



[PHP] Question about displaying directories and files

2002-12-06 Thread
 Hi. I have studied the manual, and have scripts that indivudually display a directory 
(or list of them) and a script that displays scripts in a folder However, I am curious 
as to how to take all folders in /members directory (It will grow over time, now I 
have 3) and no matter how many folders are there (each with a zip and gzip file)I want 
it to display all folders and files inside it on one page Such as, a dynamic way to do 
this:Directory Azip | gzip Directory Bzip | gzip ... So if there are 10 directories, 
you see 10 listings like that. If 4, 4 listings and so on. I go to the manual, but 
can't figure out how to do this *dynamically* what would I physically have to do to 
make sure a list of directories in my 'list director' script includes the spitout of 
files and then link to them?

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



Re: [PHP] String to an Array

2002-12-06 Thread Matt Vos
A string is an array of characters.
In your example, $str[4] == h.

Matt
- Original Message - 
From: Rodrigo de Oliveira Costa [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 1:50 PM
Subject: [PHP] String to an Array


 Hi guys, I got a string that I need to be transformed into na array of
 characters, something like:
  
  
 $str  =im the one trying to do this;
  
 //this is the string
  
 I'd like to get an array that I can access something like $array[0] and
 get the value  i . And this foward. Anyone have any clues on this?
  
 Thanks,
 Rodrigo
  
 


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




Re: [PHP] String to an Array

2002-12-06 Thread @ Edwin
Hello,

Rodrigo de Oliveira Costa [EMAIL PROTECTED] wrote:

 Hi guys, I got a string that I need to be transformed into na array of
 characters, something like:
  
  
 $str  =im the one trying to do this;
  
 //this is the string
  
 I'd like to get an array that I can access something like $array[0] and
 get the value  i . And this foward. Anyone have any clues on this?

You can actually treat $str like an array so

  $str[0]

would be i.

If you're after something else, check the archives for more info:

  http://marc.theaimsgroup.com/?t=100526380400016r=1w=2

- E

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




Re: [PHP] Installation of PHP with gd support

2002-12-06 Thread info
Hello Paul M,
yes I succeded with the following stable Version 4.3. Here is the link:
http://snaps.php.net/php4-STABLE-200212061430.tar.gz

Works fine!

Thank u
Oliver

  - Original Message - 
  From: Paul Marinas 
  To: [EMAIL PROTECTED] 
  Sent: Friday, December 06, 2002 5:57 PM
  Subject: Re: [PHP] Installation of PHP with gd support


  have u succeded ?

  Paul Marinas
  Technical Support
  RDS Craiova


  Phone:  +402-51-410-194
  Mobile: +407-22-451-439
  Fax:+402-51-416-579
  www.rdsnet.ro
  .

  Privileged/Confidential Information may be contained in this message. If you
  are not the addressee indicated in this
  message (or responsible for delivery of the message to such person), you may
  not copy or deliver this message to
  anyone. In such a case, you should destroy this message and kindly notify
  the sender by reply e-mail.

  On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:

   Hi Paul,
  
   where can I get it?
  
 - Original Message -
 From: Paul Marinas
 To: [EMAIL PROTECTED]
 Sent: Friday, December 06, 2002 5:23 PM
 Subject: Re: [PHP] Installation of PHP with gd support
  
  
 try php4-STABLE-200212061430.tar.gz, with gd 2.0.8 should work
  
 Paul Marinas
 Technical Support
 RDS Craiova
  
  
 Phone:  +402-51-410-194
 Mobile: +407-22-451-439
 Fax:+402-51-416-579
 www.rdsnet.ro
 .
  
 Privileged/Confidential Information may be contained in this message. If you
 are not the addressee indicated in this
 message (or responsible for delivery of the message to such person), you may
 not copy or deliver this message to
 anyone. In such a case, you should destroy this message and kindly notify
 the sender by reply e-mail.
  
 On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:
  
  Hi Paul,
 
  compiled PHP like that
  ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion
 
  Error Message:
  In file included from gd.c:83:
  gd_ctx.c: In function `_php_image_output_ctx':
  gd_ctx.c:70: structure has no member named `free'
  gd_ctx.c:98: structure has no member named `free'
  gd.c: In function `_php_image_create_from':
  gd.c:1176: structure has no member named `free'
  make[3]: *** [gd.lo] Fehler 1
- Original Message -
From: Paul Marinas
To: [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 4:33 PM
Subject: Re: [PHP] Installation of PHP with gd support
 
 
what error do you get ?
 
Paul Marinas
Technical Support
RDS Craiova
 
 
Phone:  +402-51-410-194
Mobile: +407-22-451-439
Fax:+402-51-416-579
www.rdsnet.ro
.
 
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this
message (or responsible for delivery of the message to such person), you may
not copy or deliver this message to
anyone. In such a case, you should destroy this message and kindly notify
the sender by reply e-mail.
 
On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:
 
 Oh mann
   - Original Message -
   From: Paul Marinas
   To: [EMAIL PROTECTED]
   Sent: Friday, December 06, 2002 4:29 PM
   Subject: Re: [PHP] Installation of PHP with gd support


   on my computer, why ?


   Paul Marinas
   Technical Support
   RDS Craiova


   Phone:  +402-51-410-194
   Mobile: +407-22-451-439
   Fax:+402-51-416-579
   www.rdsnet.ro
   .

   Privileged/Confidential Information may be contained in this message. If 
you
   are not the addressee indicated in this
   message (or responsible for delivery of the message to such person), you 
may
   not copy or deliver this message to
   anyone. In such a case, you should destroy this message and kindly notify
   the sender by reply e-mail.

   On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:

where?
  - Original Message -
  From: Paul Marinas
  To: [EMAIL PROTECTED]
  Sent: Friday, December 06, 2002 4:24 PM
  Subject: Re: [PHP] Installation of PHP with gd support
   
   
  yep ..
   
  Paul Marinas
  Technical Support
  RDS Craiova
   
   
  Phone:  +402-51-410-194
  

Re: Re[2]: [PHP] Error GD

2002-12-06 Thread info
Thank u Tom

Oliver
  - Original Message - 
  From: Tom Rogers 
  To: Tom Rogers 
  Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Friday, December 06, 2002 5:35 PM
  Subject: Re[2]: [PHP] Error GD


  Hi,

  Saturday, December 7, 2002, 2:31:09 AM, you wrote:
  TR Hi,

  TR Saturday, December 7, 2002, 1:41:22 AM, you wrote:
  ithc Hi Paul,

  ithc compiled PHP like that
  ithc ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion

  ithc Error Message:
  ithc In file included from gd.c:83:
  ithc gd_ctx.c: In function `_php_image_output_ctx':
  ithc gd_ctx.c:70: structure has no member named `free'
  ithc gd_ctx.c:98: structure has no member named `free'
  ithc gd.c: In function `_php_image_create_from':
  ithc gd.c:1176: structure has no member named `free'
  ithc make[3]: *** [gd.lo] Fehler 1

  TR I think the function name got changed to gdFree(), I'll try to find more info if
  TR I can

  TR -- 
  TR regards,
  TR Tom


  I was close :) change the lines in the offending files to this:

  ctx-gd_free(ctx);

  That should fix it

  -- 
  regards,
  Tom


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




Re: [PHP] $_FILES associative array

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 01:10, Tom Rogers wrote:

 If your input is like this:

 input type=file name=userfile size=52 /

 The array you get would look like this:

 $_FILES['userfile']['name'] The original name of the file on the client
 machine.

 $_FILES['userfile']['type'] The mime type of the file, if the browser
 provided this information. An example would be image/gif.

 $_FILES['userfile']['size'] The size, in bytes, of the uploaded file.

 $_FILES['userfile']['tmp_name'] The temporary filename of the file in which
 the uploaded file was stored on the server

Hmm, just print_r() the damn thing and see what it contains ;-)

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
In Nature there are neither rewards nor punishments, there are consequences.
-- R.G. Ingersoll
*/


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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 00:56, Andre Dubuc wrote:
 I would like to update an int4 column with new values appended to the end
 (preferably with a delimiter such as @ or a comma).

 With PostgreSQl 7.2, I can't seem to add the number with a delimiter (it
 gives me a parser error at the delimiter). For example, If I update the
 field 'radd' that already has  number 36 in it, it does append the new
 number, but without any space. So, if I updated with a new number, 6, the
 'radd' result would now be '366' instead of '36 6'

 Without the delimiter, it might be difficult to do selects on this field
 when I need to find a specific number within the field. (Btw, I'm using
 $_SESSION['rid'] . . . etc instead of $rid in the actual code.) Any ideas
 what I'm doing wrong?

 Any suggestions will be greatly appreciated.

Am I missing something or are you really trying to insert non-digits into an 
INTEGER field?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
A compliment is something like a kiss through a veil.
-- Victor Hugo
*/


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




Re: [PHP] Installation of PHP with gd support

2002-12-06 Thread Jason Wong
On Friday 06 December 2002 23:18, [EMAIL PROTECTED] wrote:
 Hi list,

 anybody here who knows a HowTo of installing PHP with gd support?

If gd libraries was installed in /usr/lib then use --with-gd=/usr.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
QOTD:
I haven't come far enough, and don't call me baby.
*/


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




Re: [PHP] String to an Array

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 02:12, [EMAIL PROTECTED] wrote:
 Hello,

 Rodrigo de Oliveira Costa [EMAIL PROTECTED] wrote:
  Hi guys, I got a string that I need to be transformed into na array of
  characters, something like:
 
 
  $str  =im the one trying to do this;
 
  //this is the string
 
  I'd like to get an array that I can access something like $array[0] and
  get the value  i . And this foward. Anyone have any clues on this?

 You can actually treat $str like an array so

   $str[0]

 would be i.

This isn't officially endorsed anymore. You should use $str{0} instead.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
The new Congressmen say they're going to turn the government around.  I
hope I don't get run over again.
*/


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




RE: [PHP] Sigh :)

2002-12-06 Thread Ford, Mike [LSS]
OK, I think I've solved this, and you'll probably kick yourself when I explain it!  
But first, a teaser:  what looks like a double-quote in HTML, but isn't?

-Original Message-
From: John Taylor-Johnston

 If I run the SQL in PHPMyAdmin, (a MySQL web interface), it works.
 
 jdaxell.ccl = 2 records found.
 
 SELECT id,AU,ST,BT,AT FROM ccl_main WHERE MATCH
 (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
 AGAINST ('ready maria' IN BOOLEAN MODE)
 ORDER BY id asc
 
 But try to pass it through PHP - zippo. MySQL thinks it is a boolean
 search for
 +ready +maria
 not an exact search for the two words together
 
 ready maria
 
 MySQL does not see the double quotes. It should. Somehow, PHP is
 thwarting them?

Not PHP, your browser, I suspect.  In fact there are no quotes there!  No, donm't yell 
at me, there really aren't!!

Close inspection of the source of your non-working result reveals that what it has 
actually searched for is quot;ready mariaquot; -- which, of course, displays on the 
screen as ready maria, with the HTML quot; entities converted to double quotes!  Of 
course, as the $search variable actually contains the version with the quot; 
entities, this is what MySQL sees, and duly regards it as a non-quoted string 
contining the words quot, ready and maria, and a few non-significant punctuation marks!

What I think is happening is that your browser is encoding certain characters in the 
form field into HTML entities before submitting them -- so to get PHP to see them 
correctly, you're going to need to unencode any HTML-entities in the string in your 
$search variable.  I suggest a quick visit to the manual page for html_entity_decode 
(http://www.php.net/html-entity-decode) may be in order (this function is not 
available until PHP 4.3.0, but the manual page does give a pre-4.3.0 alternative).

(Of course, don't forget to keep the HTML-entities version for echoing back to your 
HTML results page!)

This was a neat one -- hope this analysis helps!

Cheers!

Mike

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




RE: [PHP] Looping Addition

2002-12-06 Thread Ford, Mike [LSS]
- Original Message -
From: Chris Wesley [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]

 On Wed, 4 Dec 2002, Stephen wrote:
  This is only a snippet, there is more to it but for simplicities
sake...
  Then I calculate it. My question is, how would I loop the adding? I
hope
you
  understand this now...

 Ah!, I think I understand better now.  You want to add num1, num2,
num3,
 ... numN, which are inputs from the second form in your sequence.
Gotcha.

 If you name /all/ the form elements as nums[] instead of
individually as
 num${current}, the numbers put into the form will all be accessible
in
 one array to the PHP script that does the adding.  Then you can just
loop
 over the array of numbers.

 In your second form, change this:
 input name=num?php echo $current; ? type=text id=vars
value=0
  size=25

 To this:
 input name=nums[] type=text id=vars value=0 size=25

 Then in the script that adds the numbers:
 $total = 0;
 foreach( $_POST['nums'] as $number ){
 $total += $number;
 }

Or even $total = array_sum($_POST['nums'])

Cheers!

Mike

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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
Gentlemen,
Thank you for your assistance.

The PHP mail scripts were taken from Julie Meloni's book on PHP called Fast
and East on pp. 116-117. (PrimaTech).

In fact, she writes:

If you're using PHP4 on Windows, look for the following lines in your
php.ini file:

[mail function]
SMTP =; for Win32 only
sendmail_from = ;for Win32 only

You'll need to modify the last two lines so that the mail function works
properly.

1. For the SMTP entry, use 'localhost or the name of the outgoing
mailserver you use in your e-mail client.

2. For the sendmail_from entry, enter your e-mail address.

For example in my php.ini file on Windows contains this:

[mail function]
SMTP =localhost
sendmail_from = [EMAIL PROTECTED]

END QUOTE

So that's what I did -using localhost - and I get:

failed to connect.

I'm at a loss.
Please help.
Thanks.
TR





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




Re: [PHP] Cookies help please

2002-12-06 Thread Jason Wong
On Friday 06 December 2002 20:22, Steve Vernon wrote:

 The code below keeps my sessions but the cookie bit dosent work.

 Thanks,

 Steve
 XX

  /* Check a session is valid
   */
  function session_check($db_link)
  {
   //Ok so either want to log on, or have a session or cookie allready
   if(isset($_SESSION['ssun']) || isset($_COKKIE[ssun]) ||
-^

Shouldn't that be $_COOKIE??

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
A closed mouth gathers no foot.
*/


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




Re: [PHP] mail() problems...

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 04:35, Anthony Ritter wrote:

 Gentlemen,
 Thank you for your assistance.

 The PHP mail scripts were taken from Julie Meloni's book on PHP called
 Fast and East on pp. 116-117. (PrimaTech).

Let's not blame it on her.

 In fact, she writes:

[snip]

Right, but didn't heed her advice?

 For example in my php.ini file on Windows contains this:

 [mail function]
 SMTP =localhost
 sendmail_from = [EMAIL PROTECTED]

Those are _her_ settings, doesn't necessarily work for you as well.

 So that's what I did -using localhost - and I get:

I think Julie is sure glad you didn't use her email address as well ;-)

 failed to connect.

 I'm at a loss.

Others have already pointed out, only use localhost IF AND ONLY IF you have an 
SMTP server running on the same machine as your webserver.

Otherwise try using whatever SMTP server you're using to send mail from your 
mail client.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
You can tell how far we have to go, when FORTRAN is the language of
supercomputers.
-- Steven Feiner
*/


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




Re: [PHP] mail() problems...

2002-12-06 Thread Chris Shiflett
--- Anthony Ritter [EMAIL PROTECTED]
wrote:
 If you're using PHP4 on Windows, look for the following
 lines in your php.ini file:
 
 [mail function]
 SMTP =; for Win32 only
 sendmail_from = ;for Win32 only
 
 You'll need to modify the last two lines so that the mail
 function works properly.
 
 1. For the SMTP entry, use 'localhost or the name of the
 outgoing mailserver you use in your e-mail client.
 
 2. For the sendmail_from entry, enter your e-mail
 address.
 
 For example in my php.ini file on Windows contains this:
 
 [mail function]
 SMTP =localhost
 sendmail_from = [EMAIL PROTECTED]
 
 So that's what I did -using localhost - and I get:
 
 failed to connect.

Right. Unlike Linux, I doubt Windows has a mail server
running locally without you having to buy and/or install
some extra software. I have very little experience with
Windows, but this is most likely your problem.

Take the author's advice and use whatever mail server your
mail client is using. It is probably a remote server of
some sort.

Chris

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




Re: [PHP] Cookies help please

2002-12-06 Thread Steve Vernon
Thanks a million, must of had something else on my mind ;-)

Love,

Steve
XX



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




[PHP] Output page cut off after 7000 characters

2002-12-06 Thread Fritz.Wittwer
Hi All,
i have to migrate a website from WNT/IIS to Solaris/Apache.

Some stuff seems to work, but now I am stuck with a page which gets cut 
off in the middle of the out put. It is a template system with a chain 
of includes and requires (4 files involved, no fancy stuff, just some 
variable assignements and selection of templates based on the HTTP_HOST 
header). The last file contains the HTML code for the browser, the 
server starts to send the output to the client, but stops in the middle 
of this file. The cut appears after a certain constant number of 
characters (7728 characters, cr's not counted).

CR/LFs are not an issue, I verified all invioved files, they are just 
plain text, even in vi ;-)

I have Apache/1.3.14 (Unix) PHP/4.0.6 tomcat/1.0 (tomcat is not used for 
this pages)

Has anybodey an idea whre to look for the cause?

Thanks
	Fritz


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



[PHP] Confused about $_SESSION and $_COOKIE scope..

2002-12-06 Thread Chad Day
I'm not sure why this isn't working, been banging my head at it for a couple
hours now.

I have a file (index.php), which calls a function that draws the header to
my page.

Inside that function (site_header), is an include to a file (menu.php) which
draws dynamic javascript menus based on
cookie or session values.

I can't seem to access ANY variables, be them $_SESSION, $_COOKIE, or
anything else, inside this menu.php file.  I've tried even passing simple
variables, globalizing them, etc, all the way down to see if I can access
them in that menu.php file.  I still can't.. the closest I get is being able
to access them in the site_header function, but when the include(menu.php)
is called, everything seems to vanish.

And yes, I have session_start(); at the top of my menu.php file as well..

Can anyone help me out on this?  I was under the impression that the
superglobals would be available from basically anything.. apparently I was
wrong.

Thanks,
Chad


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




[PHP] redirect URL

2002-12-06 Thread Carlos Alberto Pinto Hurtado
I don't can redirect my page to new url 

please help me

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



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




Re: [PHP] redirect URL

2002-12-06 Thread Chris Shiflett
--- Carlos Alberto Pinto Hurtado [EMAIL PROTECTED]
wrote:
 I don't can redirect my page to new url

Try this:

?
header(Location: http://www.google.com/;);
exit;
?

Chris

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




Re: [PHP] redirect URL

2002-12-06 Thread 1LT John W. Holmes
I don't can redirect my page to new url 
please help me

Carlos Alberto Pinto Hurtado

I posted the answer on my web page. 

---John Holmes...

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




[PHP] Bug with + sign when using CLI?

2002-12-06 Thread Charles Bronson
I'm using the CLI script shown below to parse and show all argv
variables passed to it.

##
-rwxr-xr-x1 nobody  nobody  plusbug.php
##
#!/usr/bin/php -q 
?PHP
print_r($_SERVER['argv']);
?
### END ##

Command being entered:
./plusbug.php 'something+something'

Output:
Array
(
[0] = ./plusbug.php
[1] = something
[2] = something
)

I found nothing about a + splitting argument variables anywhere in the
CLI documentation though I know this is a CGI characteristic. I've tried
escaping the + character to no avail.

I need to pass a string with a + character in it, anyone know anything I
can do other than repopulating the character back into the string within
the php script which would make what I'm trying to accomplish very
difficult.


In the php.ini I have:
register_globals = On
register_argc_argv = On

Note:
If I have either of these turned off, I am not even able to pick-up the
arguments passed to the script whether I use $argv or $_SERVER['argv'].

PHP Version: 4.2.3

Regards,
Bronson_AT_udatasystems.com



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




Re: [PHP] Sigh :)

2002-12-06 Thread 1LT John W. Holmes
 OK, I think I've solved this, and you'll probably kick yourself when I
explain it!  But first, a teaser:  what looks like a double-quote in HTML,
but isn't?

Hey, if that's it, I get a free kick, too. I suggested that a while ago but
there was no response.

---John Holmes...


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




Re: [PHP] redirect URL

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 04:26, 1LT John W. Holmes wrote:
 I don't can redirect my page to new url
 please help me
 
 Carlos Alberto Pinto Hurtado

 I posted the answer on my web page.

Can you redirect the answer to the list so we can all see? 

Only joking ;-)

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
It is the business of little minds to shrink.
-- Carl Sandburg
*/


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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread 1LT John W. Holmes
 I would like to update an int4 column with new values appended to the end
 (preferably with a delimiter such as @ or a comma).

  in·te·ger( P )  Pronunciation Key  (nt-jr)
  n. Mathematics
1.. A member of the set of positive whole numbers 1, 2, 3,... ,
negative whole numbers -1, -2, -3,... , and zero {0}.
2.. A complete unit or entity.


---John Holmes...



[PHP] Problems with header

2002-12-06 Thread Carlos Alberto Pinto Hurtado
I'm use 

header(Location: http://www.ica.gov.co/contratacion/RObs_borradores?control=1;);

but the answer is

Warning Cannont add header information - headers already send by (output started at 
G:\Intranet\common\mail.php:36) in G:\Intranet\common\mail.php on line 37

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



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




Re: [PHP] Problems with header

2002-12-06 Thread Stephen
Plainly put, you've already sent headers. Wheather it be an html tag, a
plain character, or just a space. Check line 37 and see what it is...


- Original Message -
From: Carlos Alberto Pinto Hurtado [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 3:31 PM
Subject: [PHP] Problems with header


I'm use

header(Location:
http://www.ica.gov.co/contratacion/RObs_borradores?control=1;);

but the answer is

Warning Cannont add header information - headers already send by (output
started at G:\Intranet\common\mail.php:36) in G:\Intranet\common\mail.php on
line 37

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181
(57 1) 2324698
Movil.(57 3) 310 6184251



--
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] Repeating Decimals

2002-12-06 Thread Stephen
How would I run the functions though and then print the repeating decimal to
the screen?


- Original Message -
From: Tom Rogers [EMAIL PROTECTED]
To: Stephen [EMAIL PROTECTED]
Cc: PHP List [EMAIL PROTECTED]
Sent: Friday, December 06, 2002 8:38 AM
Subject: Re: [PHP] Repeating Decimals


 Hi,

 Friday, December 6, 2002, 5:00:07 AM, you wrote:
 S Hello again,

 S This is another PHP mathematical question. How can I display a bar over
a
 S number (overline) if it's a repeating decimal? When the user types in 1
by
 S 3, they get 0.. I want it to display as 0.3 with the 3
 S overlined. How can I do this keeping in mind that not all numbers will
be
 S repeating decimals?

 Did this as an exercise :)

 function check_to_end($str,$pat){
 $lp = strlen($pat);
 $ls = strlen($str);
 $x = 0;
 while(true){
 $ls = strlen($str);
 if($ls  $lp){//string bigger than pattern
 $t = substr($str,0,$lp);
 if($t != $pat){
 return false;
 }
 $str = substr($str,$lp);
 }else{//pattern too big .. checks tail end
 $pat = substr($pat,0,strlen($str));
 if( $pat != $str) return false; //no repeat
 if($x  2) return false; //didn't repeat enough
 return true; //found a pattern
 }
 $x++;
 }
 }
 function repeat($num){
 $s = substr(number_format($num,16),0,-1); //make a string
 echo $s;
 list($a,$b) = split('\.',$s); //split decimal bit out
 $l = strlen($b);
 for($i=0;$i$l;$i++){ //loop through string
 $o = 0;
 $k = $b[$i];//number to find
 for($y = $i+1;$y$l;$y++){ //loop look for same number
 $c = ord($b[$y]);
 if(ord($k) == ord($b[$y])){ //got a match
 $pat = substr($b,$i,$y-$i); //cut out
pattern
 $str = substr($b,$i); //string to check
 if(check_to_end($str,$pat)){ //see if
pattern runs till the end
 $o = 1; //yep
 if(ord($pat) == ord('0')) $o = 2;
//were they just '0's
 break;
 }
 }
 }
 if($o)break; // all done
 }
 if($o == 1){ // a pattern
 $r = $a.'.'.substr($b,0,$i).'span
style=text-decoration:overline'.$pat.'/span';
 }elseif($o == 2){ // whole bunch of ending 0s
 $r = (substr($b,0,$i) != '')? $a.'.'.substr($b,0,$i):$a;
 }else{ //no repeat
 $r = $s;
 }
 return $r;
 }
 //usage
 for($x = 1;$x  100;$x++){
 $a = 11/$x;
 $res = repeat($a);
 echo 'nbsp;nbsp;nbsp;returned: '.$res.'br';
 }

 The  check_to_end() function could probably be replaced with a regex but
those
 go in the same basket as vi with my old brain :)

  Regards Tom


 --
 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] html output from system() command

2002-12-06 Thread Clay Stuckey
When I execute:
system('who');

I get the output to the screen but it is all concatenated together like
this:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net) sneakytrick pts/1 Dec
6 10:22 (34-218-228-130.arpa.kmail.net)

How can I make it look like:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net)
sneakytrick pts/1 Dec 6 10:22 (34-218-228-130.arpa.kmail.net)



--
Clay Stuckey - RHCE, CCNA, MCSE
Charleston Housing Authority - MIS Manager
[EMAIL PROTECTED]
--



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




RE: [PHP] Problems with header

2002-12-06 Thread Charles Bronson
It looks like your trying to do something before redirecting the user.
Try the below near the end of your script so everything completes before
redirecting them.

Echo meta http-equiv='Refresh'
Content='0;URL=http://www.ica.gov.co/contratacion/RObs_borradores?contro
l=1';

Bronson_AT_udatasystems.com

-Original Message-
From: Carlos Alberto Pinto Hurtado [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 06, 2002 3:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problems with header


I'm use 

header(Location:
http://www.ica.gov.co/contratacion/RObs_borradores?control=1;);

but the answer is

Warning Cannont add header information - headers already send by (output
started at G:\Intranet\common\mail.php:36) in
G:\Intranet\common\mail.php on line 37

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



-- 
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] html output from system() command

2002-12-06 Thread Chris Shiflett
--- Clay Stuckey [EMAIL PROTECTED] wrote:
 When I execute:
 system('who');
 
 I get the output to the screen but it is all concatenated
 together like this:
 root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net)
 sneakytrick pts/1 Dec 6 10:22
 (34-218-228-130.arpa.kmail.net)
 
 How can I make it look like:
 root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net)
 sneakytrick pts/1 Dec 6 10:22
 (34-218-228-130.arpa.kmail.net)

Try surrounding it with pre tags.

Chris

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




RE: [PHP] html output from system() command

2002-12-06 Thread Charles Bronson
If you try viewing the source of the webpage it will probably show up
correctly.

If this is the case, try putting the output into a variable and passing
it to the nl2br() function.

Echo nl2br($commandoutput);

And/or make your way to http://www.php.net/manual/en/function.nl2br.php

Bronson_AT_udatasystems.com


-Original Message-
From: Clay Stuckey [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 06, 2002 3:41 PM
To: Php
Subject: [PHP] html output from system() command


When I execute:
system('who');

I get the output to the screen but it is all concatenated together like
this:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net) sneakytrick pts/1
Dec 6 10:22 (34-218-228-130.arpa.kmail.net)

How can I make it look like:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net) sneakytrick pts/1
Dec 6 10:22 (34-218-228-130.arpa.kmail.net)



--
Clay Stuckey - RHCE, CCNA, MCSE
Charleston Housing Authority - MIS Manager
[EMAIL PROTECTED]
--



-- 
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] Failed to install Mod_cURL under Windows/Apache

2002-12-06 Thread DL Neil
PHP v4.2.3 with Apache 1.3.24 under Win2000 Prof SP2

Downloaded the full v4.2.3 zip package/Win binary, some weeks ago.
Installation went fine. Extensions are happily included. Have had several
weeks of operations.

Decided to install cURL to do some URL (strangely enough) link
verification-checking. Started at manual: XII. CURL, Client URL Library
Functions
with sent me to http://curl.haxx.se and in turn
http://curl.haxx.se/libcurl/php/

Downloaded curl-7.10.2-win32-nossl which (really) only contains CURL.EXE. I
cannot see any instructions telling me what to do with this/where to put
it!? Moved it to the same location as PHP.EXE. It runs happily from the
command line (so that's something!)

Moved both the .dlls around, checked the MVC file, and uncommented the
PHP.INI line - and verified it with PHPINFO().

However when a PHP script (copied straight off the PHP manual) calls
curl_init () it causes Apache to crash: Apache.exe has generated errors and
will be closed by Windows. You will need to restart the program. An error
log is being created.
- restarting the Apache service and re-running results in the same error
- rebooting the whole system and re-running also.
- the v-server's error log shows nothing and the access log only shows the
PHPINFO() mentioned
- there's nothing in the Windows Event log
- I can't figure out where this error log is created

Help! I've missed something...
=dn


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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread Andre Dubuc
Hi Jason,

So, I gather from your reply that I cannot add more digits to that integer 
field separated by spaces or whatever?  I sort of figured I won't be able to 
do it, so I'm trying to get things working by changing the type to varchar() 
and doing it as a string. Seems to work - with glitches.



An

On Friday 06 December 2002 01:39 pm, you wrote:
 On Saturday 07 December 2002 00:56, Andre Dubuc wrote:
  I would like to update an int4 column with new values appended to the end
  (preferably with a delimiter such as @ or a comma).
 
  With PostgreSQl 7.2, I can't seem to add the number with a delimiter (it
  gives me a parser error at the delimiter). For example, If I update the
  field 'radd' that already has  number 36 in it, it does append the new
  number, but without any space. So, if I updated with a new number, 6, the
  'radd' result would now be '366' instead of '36 6'
 
  Without the delimiter, it might be difficult to do selects on this field
  when I need to find a specific number within the field. (Btw, I'm using
  $_SESSION['rid'] . . . etc instead of $rid in the actual code.) Any ideas
  what I'm doing wrong?
 
  Any suggestions will be greatly appreciated.

 Am I missing something or are you really trying to insert non-digits into
 an INTEGER field?

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




[PHP] Mail(): How much time?

2002-12-06 Thread rolf vreijdenberger
Hi,
I am getting all my emailadresses for my mailinglist out of a database in a
loop,
and in that same loop I personalize the email by adding the name and a
personal URL (script.php?email=youremail).
In that loop I then send the email.
This whole process takes about 0.5 to 2 seconds per adress.
This seems quite long to me.
It can't be the database query or the if conditions in the loop, so why is
this taking so long??
I don't have any problems with script execution time as I increment it in
every iteration.
This is not a nice solution though.
I am also wondering how many adresses you can put in one subject, Cc or Bcc
field?

thanks in advance

--
Rolf Vreijdenberger
De Pannekoek en De Kale
Maystraat 6
2593 VW Den Haag
T: 06-24245719
E: [EMAIL PROTECTED]
W: www.depannekoekendekale.nl



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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread Andre Dubuc
de-ja vu   (P)  Pronunciation Key (du hhh)
n . Foreign
1. Something unpleasantly familiar
2. 'Been-there-done-that'

Don't you love it when you've set a field to a certain type, only to find out 
much later, after much coding, it's wrong?

Thanks for the reminder. Guess it's back to Geek 1.0.1 for me.

Regards,
Andre



On Friday 06 December 2002 03:31 pm, 1LT John W. Holmes wrote:
  I would like to update an int4 column with new values appended to the end
  (preferably with a delimiter such as @ or a comma).

   in·te·ger( P )  Pronunciation Key  (nt-jr)
   n. Mathematics
 1.. A member of the set of positive whole numbers 1, 2, 3,... ,
 negative whole numbers -1, -2, -3,... , and zero {0}.
 2.. A complete unit or entity.


 ---John Holmes...

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




  1   2   >