php-general Digest 6 May 2002 06:27:45 -0000 Issue 1328

Topics (messages 96166 through 96206):

Re: SSH
        96166 by: Kyle Gibson
        96187 by: Richard Archer
        96188 by: Kyle Gibson

help!!!
        96167 by: J. H.
        96168 by: Austin Marshall
        96171 by: George Nicolae
        96174 by: John Holmes
        96182 by: David Jackson

Re: PHP compared to JSP
        96169 by: SP
        96170 by: Dennis Moore
        96176 by: Manuel Lemos

Re: function sql question
        96172 by: John Holmes
        96186 by: Richard Archer

Re: Please, can you help me?
        96173 by: John Holmes
        96194 by: David Freeman

Re: HTML to mysql - from msql to html
        96175 by: Mantas Kriauciunas
        96177 by: Jason Wong
        96189 by: Miguel Cruz
        96193 by: David Freeman
        96200 by: Mantas Kriauciunas

Stuck using mail() in script with variable
        96178 by: Cheyenne Vermeulen

Who's having a good hosting experience these days?
        96179 by: Marcus James Christian
        96180 by: Kyle Gibson
        96192 by: David Freeman
        96196 by: Justin French
        96201 by: olinux

F/U on  sendmail return-path (not 4 newbies)
        96181 by: Anthony Rodriguez

Re: Php Sessions
        96183 by: Daniel Svanbäck
        96184 by: Daniel Svanbäck

mail function
        96185 by: Diana Castillo
        96190 by: Austin Marshall

Re: replace question
        96191 by: Miguel Cruz

Re: Tailing a log file {!?}
        96195 by: .ben
        96198 by: David Freeman
        96203 by: Miguel Cruz

Register Globals workarounds
        96197 by: Justin French
        96205 by: Philip Olson

Re: Postnuke Anyone ?
        96199 by: Ricardo Fitzgerald

Newbie needs compile
        96202 by: Sogno Kahlenberg
        96204 by: Julian
        96206 by: Jason Wong

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]


----------------------------------------------------------------------
--- Begin Message ---
> Your ISP has safe mode turned on which means you cannot use backquotes. Read all 
> about it at http://www.php.net/manual/en/features.safe-mode.php.


I am my own ISP, techically.

In the php.ini file, safe mode is off. Which is why I am curious as to 
why this is occuring.

---
;
; Safe Mode
;
safe_mode = Off

---


-Kyle

--- End Message ---
--- Begin Message ---
At 2:29 PM -0400 5/5/02, Kyle Gibson wrote:

>In the php.ini file, safe mode is off. Which is why I am curious as to
>why this is occuring.

What does phpinfo() have to say about it?

 ...R.
--- End Message ---
--- Begin Message ---
> What does phpinfo() have to say about it?


It says that the Local Value is "on" but the master value is "off".


-Kyle


--- End Message ---
--- Begin Message ---
Can anyone here help me write a simple auto shop
scheduling program? Would really appreciate it if you
would help me out. 

Jane H. 

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
--- End Message ---
--- Begin Message ---
J. H. wrote:
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out. 
> 
> Jane H. 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com

Don't expect anyone to write your code for you.  If you come across a 
specific problem, then we may be able to help you.  If you want someone 
to write your code for you, money talks.  Hire someone.

--- End Message ---
--- Begin Message ---
If you find someone pls tell him to write for me a new portal with secure
user authentication and a webmail system with Oracle backend.
tanx.
--


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"J. H." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out.
>
> Jane H.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com


--- End Message ---
--- Begin Message ---
And I need a PHP script to help me take over the world. It has to be
fewer than 666 lines and I don't have MySQL. Also, could you write the
PHP in ASP, please?

---John Holmes...

> -----Original Message-----
> From: George Nicolae [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 12:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: help!!!
> 
> If you find someone pls tell him to write for me a new portal with
secure
> user authentication and a webmail system with Oracle backend.
> tanx.
> --
> 
> 
> Best regards,
> George Nicolae
> IT Manager
> ___________________
> PaginiWeb.com  - Professional Web Design
> www.PaginiWeb.com
> 
> 
> "J. H." <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Can anyone here help me write a simple auto shop
> > scheduling program? Would really appreciate it if you
> > would help me out.
> >
> > Jane H.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Health - your guide to health and wellness
> > http://health.yahoo.com
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Jane --
Check http://www.freshmeat.net.
Keep in mind there's good and their simple.
Try searching on project, store, scheduler
also take a look at http://www.phprojetk.com ( or is it org).

HTH,
David

"J. H." wrote:
> 
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out.
> 
> Jane H.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
--- End Message ---
--- Begin Message ---
Does anyone think caching should be built into php for it to edge out the competition?
(like what smarty is doing)

I mean a static page will always serve up faster then a dynamic one.  Also even if you 
are
getting 100 pages/sec on your database, you could cache it for 5 seconds and you save 
500
accesses to your database.  Yeah the page would be at most 5 seconds old but no one 
would
know.

Plus if you are a crappy programmer then it would mask how slow your code is :-)


-----Original Message-----
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: May 5, 2002 3:01 AM
To: Pag
Cc: Luc Saint-Elie; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP compared to JSP


On Sat, 4 May 2002, Pag wrote:
>> Does PHP compile : NO
>> Does the user loading same page for 2nd time gets better response : YES
>> it can if caching is provided
>
> On a side not..isnt caching a bit like going against why PHP was built
> in the first place? I mean, information may get a bit out of date if we
> get a page on the cache instead of getting it "fresh" from the server.

Sometimes the developer knows how stale information can get before it
needs to be refreshed. An awful lot of pages fetched with GET args are
just straight-up retrievals from mostly-static databases, and can be
cached with impunity.

Also, there are other types of caching. On a multi-use machine that is
busy with other stuff but not getting a lot of web traffic, httpd may have
been paged out. And the PHP source file will be cached by the filesystem
for a while after being read, saving subsequent repeat visits the delay of
a disk operation.

miguel


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


--- End Message ---
--- Begin Message ---
Food for thought...

There are a lot of performance issues outside of PHP...

MySQL - version 4.0.x  supports caching...

Apache 2.0 -  is now threaded...

Memory is now cheap... Increase the server's memory

You may also want to consider Zends Optimizer and Accelerator if you need
additional boost in performance.  Or even write your appliation to generate
the HTML pages and place it in the cron job to keep the data refreshed...

Just my 2 cents...


----- Original Message -----
From: "SP" <[EMAIL PROTECTED]>
To: "Miguel Cruz" <[EMAIL PROTECTED]>; "Pag" <[EMAIL PROTECTED]>
Cc: "Luc Saint-Elie" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 2:47 PM
Subject: RE: [PHP] PHP compared to JSP


> Does anyone think caching should be built into php for it to edge out the
competition?
> (like what smarty is doing)
>
> I mean a static page will always serve up faster then a dynamic one.  Also
even if you are
> getting 100 pages/sec on your database, you could cache it for 5 seconds
and you save 500
> accesses to your database.  Yeah the page would be at most 5 seconds old
but no one would
> know.
>
> Plus if you are a crappy programmer then it would mask how slow your code
is :-)
>
>
> -----Original Message-----
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
> Sent: May 5, 2002 3:01 AM
> To: Pag
> Cc: Luc Saint-Elie; [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP compared to JSP
>
>
> On Sat, 4 May 2002, Pag wrote:
> >> Does PHP compile : NO
> >> Does the user loading same page for 2nd time gets better response : YES
> >> it can if caching is provided
> >
> > On a side not..isnt caching a bit like going against why PHP was built
> > in the first place? I mean, information may get a bit out of date if we
> > get a page on the cache instead of getting it "fresh" from the server.
>
> Sometimes the developer knows how stale information can get before it
> needs to be refreshed. An awful lot of pages fetched with GET args are
> just straight-up retrievals from mostly-static databases, and can be
> cached with impunity.
>
> Also, there are other types of caching. On a multi-use machine that is
> busy with other stuff but not getting a lot of web traffic, httpd may have
> been paged out. And the PHP source file will be cached by the filesystem
> for a while after being read, saving subsequent repeat visits the delay of
> a disk operation.
>
> miguel
>
>
> --
> 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
>

--- End Message ---
--- Begin Message ---
Hello,

Sp wrote:
> Does anyone think caching should be built into php for it to edge out the 
>competition?
> (like what smarty is doing)
> 
> I mean a static page will always serve up faster then a dynamic one.  Also even if 
>you are
> getting 100 pages/sec on your database, you could cache it for 5 seconds and you 
>save 500
> accesses to your database.  Yeah the page would be at most 5 seconds old but no one 
>would
> know.

I have been doing that for quite some time and I can tell that it is not 
worthy to cache just database query results but rather the pages that 
are generated with the data that is returned with such queries.

For that I have developed of a robust class that caches pages in files 
while it prevents that concurrent accesses update the cache files 
simultaneously to prevent corrupting the cached data.

You may want to try getting it here:

http://www.phpclasses.org/browse.html/package/313.html

Regards,
Manuel Lemos

--- End Message ---
--- Begin Message ---
It will work; you're just doing something wrong. Do you want to fix it,
or keep doing it this way?

---John Holmes...

> -----Original Message-----
> From: John Fishworld [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 10:55 AM
> To: [EMAIL PROTECTED]; 'PHP-General'
> Subject: Re: [PHP] function sql question
> 
> duh !
> yeah that makes sense !
> but it doesn't work !
> I've no idea why but it refuses to give any information back !
> 
> I've managed to get round this by now no loger declaring it a function
> but just actually requiring it where i need it
> 
> require ("get_city_1.inc");
> print_r(array_values ($city));
> 
> I've also chopped the return part
> and just return the values
> 
>  $city[0] = $city_id;
>  $city_name[1] = $city_name;
> 
> Strange
> 
> 
> > >    return 1;
> > >    return $city_id;
> > >    return $cityname;
> >
> > You can't return 3 values...try returning an array, instead.
> >
> > $ret[0] = $city_id;
> > $ret[1] = $cityname;
> > return $ret;
> >
> > or...
> >
> > $ret["City_ID"] = $city_id;
> > $ret["CityName"] = $cityname;
> > return $ret;
> >
> > ---John Holmes...
> >
> >
> 


--- End Message ---
--- Begin Message ---
At 6:34 PM +0200 5/5/02, John Fishworld wrote:

John,

Your mysql_db_query should contain either "DBWEB" (with
quotes) or $DBWEB (a var). Just DBWEB is an error.
Also, from the manual re: mysql_db_query
  Note:  This function has been deprecated since PHP 4.0.6.
  Do not use this function.
  Use mysql_select_db()  and mysql_query() instead.

Your SQL query is incorrect. The strings you use to identify
a column contain "_" instead of ".". Perhaps just an artifact
of your mailer, but the query as it is should be throwing
"unknown column t_city_name" errors. Try adding some "as"
clauses into your query to name these "virtual" columns.
Or replace the "_" with ".".

Hey, and it's nice to see a normalized database for a change :)

Your coding formatting style is likely to cause you problems.
You have (partially) indented the code the way you want to
behave logically, but your braces are all over the shop.

Try adopting one of the coding styles commonly in use and
that will almost certainly make your life easier. I use the
K&R "one true brace style" because I'm a C hacker from way
back, but you might like an extra line break before a "{".

As for this function, the first time through the loop,
unless the cityname is not "" you return 0. Since you test for
a blank cityname, I assume that's a possible return value from
the database. In this case you shouldn't return 0 then, but
instead loop though to the next result in the result set.


Try this:

function check_city_from_plz($str) {
// connect and select database
$city_query = "select distinct t_city.name AS t_city_name,
t_city.id_city AS t_city_id_city from
t_city,t_zipcodecity where
(t_city_id_city = t_zipcodecity_id_city) and
(t_zipcodecity.zipcode like '$str')";

$city_result = mysql_db_query(DBWEB, $city_query);

if ($city_result) {
    while ($q = mysql_fetch_array($city_result)) {
        $city_id = $q["t_city_id_city"];
        $cityname = $q["t_city_name"];
        if ($cityname != "") {
            r["city_id"] = $city_id;
            r["cityname"] = $cityname;
            return $r;
        } // close if
    } // close while
    // return 0 if no matches after iterating through data
    return 0;
} //  close function


 ...R.
--- End Message ---
--- Begin Message ---
RTM... www.php.net/flock

---John Holmes...

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 03, 2002 2:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Please, can you help me?
> 
> Hello!
> I have a big problem and cannot find the answer anywhere, so please,
> help me if you can. When I use fwrite() function on webserver, it
> sometimes happens, that more then one user accesses the file and the
> result is, that the file is corrupted or truncated. A good example of
> this problem is webpage access counter. I know, that I can use MySQL
> to count accesses, but on some servers I can't. When I have this
> counter as a file on my server and read/write into it, there's only a
> question of time, when it corrupts itself. Please, can you help me to
> solve this problem? I think, that the easiest solution should be to
> prevent more that one user to write to that file, but I have no idea,
> how to do this. Or is there any other way to prevent that files from
> their corruption? I'll be very happy, if you help me with this
> problem.
> Thank you in advance.
> Miloslav Dornak
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---

 > I have a big problem and cannot find the answer anywhere, so 
 > please, help me if you can. When I use fwrite() function on 
 > webserver, it sometimes happens, that more then one user 
 > accesses the file and the result is, that the file is 
 > corrupted or truncated.

I suspect that flock() would be of use, consult the php manual for it's
use.

CYA, Dave


--- End Message ---
--- Begin Message ---
Hey PHP General List,

ok i solwed the problems with line breaks.... but i didn't use
nl12br() function. i did like this:

$newz = str_replace("\n","<br>",$myrow[3]);

now i am having problems with spaces

text is:
---------------
bla bla bla                                      foo
---------------

and shows:
---------------
bla bla bla foo
---------------

what do i have to do to get all those spaces? as i understand(english
is weak) nl12br() is for breaks only. what about spaces?

:----
MC> On Sat, 4 May 2002, Mantas Kriauciunas wrote:
>>  I have hare a little problem. Well i have in the page <TEXTAREA>
>>  thingy and there i wrote text like that(between lines):
>> 
>>  ----------------------
>>  foo bar
>> 
>>  more foo bar
>>  ----------------------
>> 
>>  now i do msql_query("UPDATE............."); and it sets into the
>>  database with just space. and when i take it out from database there
>>  is no empty line in the middle.

MC> View the source of the page displaying the retrieved data. If the text 
MC> displays on multiple lines there, then you just need to call nl2br() on 
MC> the string to convert internal line breaks to HTML breaks.

MC> If the text does not show line breaks in the source (or when you use the 
MC> mysql CLI to query), then you need to change the parameters of the 
MC> <TEXTAREA>. Probably <textarea wrap="soft"> but I'm not 100% sure offhand.

MC> miguel



:------------------------------:
        Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt

--- End Message ---
--- Begin Message ---
On Monday 06 May 2002 06:01, Mantas Kriauciunas wrote:
> Hey PHP General List,
>
> ok i solwed the problems with line breaks.... but i didn't use
> nl12br() function. i did like this:
>
> $newz = str_replace("\n","<br>",$myrow[3]);
>
> now i am having problems with spaces
>
> text is:
> ---------------
> bla bla bla                                      foo
> ---------------
>
> and shows:
> ---------------
> bla bla bla foo
> ---------------
>
> what do i have to do to get all those spaces? as i understand(english
> is weak) nl12br() is for breaks only. what about spaces?

replace the spaces with a non-breaking space:

 &nbsp;

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

/*
It is a lesson which all history teaches wise men, to put trust in ideas,
and not in circumstances.
                -- Emerson
*/
--- End Message ---
--- Begin Message ---
On Sun, 5 May 2002, Mantas Kriauciunas wrote:
> Hey PHP General List,
> 
> ok i solwed the problems with line breaks.... but i didn't use
> nl12br() function. i did like this:
> 
> $newz = str_replace("\n","<br>",$myrow[3]);
> 
> now i am having problems with spaces
> 
> text is:
> ---------------
> bla bla bla                                      foo
> ---------------
> 
> and shows:
> ---------------
> bla bla bla foo
> ---------------
> 
> what do i have to do to get all those spaces? as i understand(english
> is weak) nl12br() is for breaks only. what about spaces?

I think you're going to have a good time with <pre></pre>. You could try
swapping &nbsp; for each space but they're sometimes wider than normal
spaces and I suspect may have other weird side effects as well.

As a print designer in a former life, by the way, the thought of you 
trying to format something with spaces makes my skin crawl. But I'm trying 
to keep my cool.

miguel

--- End Message ---
--- Begin Message ---

 > now i am having problems with spaces
 > 
 > text is:
 > ---------------
 > bla bla bla                                      foo
 > ---------------
 > 
 > and shows:
 > ---------------
 > bla bla bla foo
 > ---------------

Plain old HTML ignores white space.  You do understand this?  To include
what you want you'll need to substitute spaces for non-breaking spaces
(&nbsp;) but I wouldn't advise it.  I'd be suggesting that if your
content requires such things that you reconsider how you are doing your
content.

CYA, Dave


--- End Message ---
--- Begin Message ---
Hey Miguel Cruz,

Got your email on:Sunday, May 05, 2002, 3:29:49 PM writing:

:----
MC> On Sun, 5 May 2002, Mantas Kriauciunas wrote:
>> Hey PHP General List,
>> 
>> ok i solwed the problems with line breaks.... but i didn't use
>> nl12br() function. i did like this:
>> 
>> $newz = str_replace("\n","<br>",$myrow[3]);
>> 
>> now i am having problems with spaces
>> 
>> text is:
>> ---------------
>> bla bla bla                                      foo
>> ---------------
>> 
>> and shows:
>> ---------------
>> bla bla bla foo
>> ---------------
>> 
>> what do i have to do to get all those spaces? as i understand(english
>> is weak) nl12br() is for breaks only. what about spaces?

MC> I think you're going to have a good time with <pre></pre>. You could try
MC> swapping &nbsp; for each space but they're sometimes wider than normal
MC> spaces and I suspect may have other weird side effects as well.

MC> As a print designer in a former life, by the way, the thought of you 
MC> trying to format something with spaces makes my skin crawl. But I'm trying 
MC> to keep my cool.

MC> miguel



:----

well i thought that it would be good to do with spaces.. but when i
researched more..and thought more i decided to leave it alone ;) its
just simple thing...that does not nessasary need spaces :).. thanks
for help everyone..i realy appreciate it.

P.S bad english is also in my way trying to learn

:------------------------------:
        Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt

--- End Message ---
--- Begin Message ---
Hi all!

I'm pretty green on this and i'm trying to create a form that sends a
authorization mail
using a few variable using the ()mail script.

I have all settings correct, added the smtp right, even tested it with the
following
scripts wich worked fine....

"<?php
print mail ('[EMAIL PROTECTED]',
   'No need for reply -- PHP test!', /* subject */
    "hi Cheyenne\nLine 2\n");            /* body    */
?>"

and this one

<?php
 $mailTo = "[EMAIL PROTECTED]";
 $mailSubject = "Testing EMail";
 $mailBody = "This is a test of the EMail system from a PHP script\n";
 $mailBody .= "PHP Version " . phpversion();
 $mailHeader = "From: [EMAIL PROTECTED]\n";
 $mailHeader .= "Reply-To: [EMAIL PROTECTED]\n";
 $mailHeader .= "X-Mailer: PHP/" . phpversion() . "\n\n";
 mail( $mailTo, $mailSubject, $mailBody, $mailHeader );
?>


When using the concerning script wich i copied below, it just doesnt send
the mail and
gives me the following error : "Warning: Server Error in x:\apache
group\apache\htdocs\php-pages\register.php on line 103"
It does in fact store the submitted data in the database so it is only the
mail that's given
me a headache!!! What is it i'm doing wrong? The error is in line:
mail($recipient, $subject, $message, $headers);


The source:

<html>
<head>
<title>Inschrijven</title>
</head>

<body>
<p align="left">
  <?
require "../db.php";
require "../functions.inc.php";
$result=mysql_query("SELECT * FROM CATEGORIE");
$result2=mysql_query("SELECT * FROM CATEGORIE");
$result3=mysql_query("SELECT * FROM CATEGORIE");
?>
  <?php
if ($submit)
{
 $geboortedatum=$jaar."-".$maand."-".$dag;
 $van=$jaar2."-".$maand2."-".$dag2;
 $tot=$jaar3."-".$maand3."-".$dag3;
 $postcode=$postcode1.$postcode2;
 for ($ix=0;$ix<count($rijbewijs);$ix++)
 {
 $rijbewijzen.=$rijbewijs[$ix]." ";
 }
 if (emailcheck($email)!="oke")
 {
 $fout.="Vul een geldig e-mailadres in.<br>";
 }
 if (strlen($ervaring)==0)
 {
 $fout.="Vul een geldige waarde in voor <b>ervaring</b>.<br>";
 }
 if (strlen($nationaliteit)==0)
 {
 $fout.="Vul een geldige waarde in voor <b>nationaliteit</b>.<br>";
 }
 if (strlen($naam)==0)
 {
 $fout.="Vul een geldige naam in.<br>";
 }
 if (strlen($voornaam)==0)
 {
 $fout.="Vul een geldige voornaam in.<br>";
 }
 if (strlen($adres)<7)
 {
 $fout.="Vul een geldig adres in.<br>";
 }
 if (strlen($postcode)!=6)
 {
 $fout.="Vul een geldige postcode in.<br>";
 }
 if (strlen($plaats)<5)
 {
 $fout.="Vul een geldige woonplaats in.<br>";
 }
 if (strlen($tel)<10 || strlen($mobiel)<10)
 {
 $fout.="Een telefoonnummer bestaat uit minimaal 10 cijfers.<br>";
 }

 if ($fout)
 {
 $fout.="<br>Klik <a href=javascript:history.go(-1)>hier</a> om de invoer te
verbeteren.";
 echo "<h1>FOUTE INVOER</h1>";
 echo $fout;
 }
 else
 {
 srand((double)microtime()*1000000);
 $mailcode= rand(1000,9999);
  if ($register=mysql_query("INSERT INTO TEST
VALUES('','$naam','$voornaam','$geslacht','$geboortedatum','$adres','$postco
de','$plaats','$tel','$mobiel','$email','$nationaliteit','$opleiding','$rijb
ewijzen','$cat1','$cat2','$cat3','$van','$tot','$ervaring','$info','$mailcod
e','0')"))
  {
  //variabalen declareren voor te versturen verificatie mail
  /* recipients */

  $recipient.= "$voornaam $naam  <$email>" ;

  /* subject */
  $subject= "E-mail verificatie TEST";

  /* message */
  $message.= "Beste ". $voornaam.",\n\n" ;
  $message.= "Je hebt je ingeschreven op de website van TEST.\n\n";
  $message.= "Om je inschrijving definitief te maken klik je op onderstaande
link.\n\n";
  $message.=
"http://notnamed.com/validate/validate.php?code=".$mailcode."\n\n";;
  $message.= "Staat je emailprogramma niet toe om email-links te volgen kun
je ook de volgende URL intypen:\n\n";
  $message.= "http://notnamed.com/validate/validate.php\n\n";;
  $message.= "Daar vul je dan de volgende code in:\n".$mailcode."\n\n";
  $message.= "Noteer deze persoonlijke code!\n".$mailcode."\n\n";
  $message.= "Deze code, samen met je emailadres geeft je de
mogelijkheid\n\n";
  $message.= "om te reageren op vacatures en je gegevens aan te
passen.\n\n";
  $message.= "Met vriendelijke groet,\n\TEST";

  $headers= "From: [EMAIL PROTECTED]>\n";
  $headers.= "X-Mailer: PHP\n"; // mailer
  $headers.= "Return-Path: <[EMAIL PROTECTED]>";  // Return path for errors

  mail($recipient, $subject, $message, $headers);

  echo "Uw gegevens zijn opgeslagen in het systeem.<br>";
  echo "U heeft een e-mailbericht ontvangen met daarin verdere instructies
om de inschrijving definitief te maken.<br>";
  echo "Pas als u die instructies heeft opgevolgd is uw inschrijving
definitief.<br>";
  }
  else
  {
  echo "Er ging iets mis bij het invoeren in de
database.<br>br>".mysql_error();
  }
 }

}
else{
?>
</p>
<form method=post action="<?echo $PHP_SELF;?>">
  <table border=0 width="461">
    <tr>
      <td width="127">Naam</td>
      <td colspan="3">
        <input type=text size=20 name=naam>
      </td>
    </tr>
    <tr>
      <td width="127">Voornaam</td>
      <td colspan="3">
        <input type=text size=20 name=voornaam>
      </td>
    </tr>
    <tr>
      <td width="127">Geslacht</td>
      <td colspan="3">
        <input type=radio name=geslacht value=M checked>
        Man
        <input type=radio name=geslacht value=V>
        Vrouw </td>
    </tr>
    <tr>
      <td width="127">Geboortedatum</td>
      <td colspan="3">
        <select name=dag>
          <?
   for ($i=1;$i<32;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <select name=maand>
          <?
   for ($i=1;$i<13;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <select name=jaar>
          <?
   for ($i=1940;$i<1999;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
      </td>
    </tr>
    <tr>
      <td width="127">Adres</td>
      <td colspan="3">
        <input type=text size=30 name=adres>
      </td>
    </tr>
    <tr>
      <td width="127">Postcode</td>
      <td colspan="3">
        <input type=text size=4 maxlength=4 name=postcode1>
        <input type=text size=2 maxlength=2 name=postcode2>
      </td>
    </tr>
    <tr>
      <td width="127">Woonplaats</td>
      <td colspan="3">
        <input type=text size=20 name=plaats>
      </td>
    </tr>
    <tr>
      <td width="127">Nationaliteit</td>
      <td colspan="3">
        <input type=text size=20 name=nationaliteit>
      </td>
    </tr>
    <tr>
      <td width="127">Opleiding</td>
      <td colspan="3">
        <select name=opleiding>
          <option>Laag</option>
          <option>Midden</option>
          <option>Hoog</option>
        </select>
      </td>
    </tr>
    <tr>
      <td width="127" rowspan="2" valign="top">Rijbewijs</td>
      <td colspan="3" valign="top">
        <input type=checkbox name=rijbewijs[] value=A>
        A
        <input type=checkbox name=rijbewijs[] value=B>
        B
<input type=checkbox name=rijbewijs[] value=C>
        C </td>
    </tr>
    <tr>
      <td valign="top" height="52" width="74">
        <input type=checkbox name=rijbewijs[]2 value=D>
        D</td>
      <td valign="top" height="52" width="36">
        <input type=checkbox name=rijbewijs[]22 value=E>
        E</td>
      <td valign="top" height="52" width="206"><br>
        <br>
      </td>
    </tr>
    <tr>
      <td width="127">Telefoon</td>
      <td colspan="3">
        <input type=text size=10 name=tel value="0000000000">
      </td>
    </tr>
    <tr>
      <td width="127">Mobiel</td>
      <td colspan="3">
        <input type=text size=11 name=mobiel value="0000000000">
      </td>
    </tr>
    <tr>
      <td width="127">E-mailadres</td>
      <td colspan="3">
        <input type=text size=20 name=email>
      </td>
    </tr>
    <tr>
      <td width="127">Beroepscategorie</td>
      <td colspan="3">
        <select name=cat1>
          <option value=0>-- Keuze 1 --</option>
          <?
   while ($row=mysql_fetch_array($result))
   {?>
          <option value="<?echo $row[ID];?>">
          <?echo $row[NL];?>
          </option>
          <?}?>
        </select>
        <select name=cat2>
          <option value=0>-- Keuze 2 --</option>
          <?
   while ($row2=mysql_fetch_array($result2))
   {?>
          <option value="<?echo $row2[ID];?>">
          <?echo $row2[NL];?>
          </option>
          <?}?>
        </select>
        <select name=cat3>
          <option value=0>-- Keuze 3 --</option>
          <?
   while ($row3=mysql_fetch_array($result3))
   {?>
          <option value="<?echo $row3[ID];?>">
          <?echo $row3[NL];?>
          </option>
          <?}?>
        </select>
      </td>
    </tr>
    <tr>
      <td width="127">Ervaring</td>
      <td colspan="3">
        <input type=text size=20 name=ervaring>
      </td>
    </tr>
    <tr>
      <td width="127">Beschikbaar</td>
      <td colspan="2">van<br>
        <br>
        tot </td>
      <td width="206">
        <select name=dag2>
          <?
   for ($i=1;$i<32;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <select name=maand2>
          <?
   for ($i=1;$i<13;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <select name=jaar2>
          <?
   for ($i=2001;$i<2002;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <br>
        <select name=dag3>
          <?
   for ($i=1;$i<32;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <select name=maand3>
          <?
   for ($i=1;$i<13;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
        <select name=jaar3>
          <?
   for ($i=2001;$i<2020;$i++)
   {
   ?>
          <option>
          <?echo $i;?>
          </option>
          <?
   }
   ?>
        </select>
      </td>
    </tr>
    <tr>
      <td width="127">Vink het vakje aan als u nieuws wilt ontvangen.</td>
      <td valign=top colspan="3">
        <input type=checkbox size=20 name=info value=1>
      </td>
    </tr>
    <tr>
      <td width="127">
        <input type=submit name=submit value=Inschrijven>
      </td>
      <td colspan="3">
        <input type=reset value=Opnieuw name="reset">
      </td>
    </tr>
  </table>
</form>
<?}?>
<p>
</body>
</html>


Hope anyone can help me out on this one...

Thanks in advance!!


Regards, Cheyenne




--- End Message ---
--- Begin Message ---
Hello,

My hosting service which WAS cool about 2 years ago has grown into a
bloated mess of zero logic.

My clients are going nuts, I'm sick of having mistakes and problems
created by the hosting service be the only reason I have any problems to

deal with at all!!!

My clients aren't rich big money folks but I need a PHP capable host for

about $11ish or less a month.  Traffic is minimal, and like I say the
only tech support calls I've had to make this past year were when the
hosting service tweeked and freaked something thus messing it all up.

Thanks,
-Marcus

--
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Marcus Unlimited
http://marcusunlimited.com
Multimedia Internet Design and Education
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

--------------------------------------
| Limited Time Offer!
| Download the Recordings of Chromaticus
| FREE! @ http://ampcast.com/chromaticus
| Complete song files and Sci-Fi Loops for
| programs like Reason, Flash, Premiere
| Logic, Cubase, Recycle, Acid, FruityLoops,
| and many, many, more!!!


--- End Message ---
--- Begin Message ---
> My clients aren't rich big money folks but I need a PHP capable host for
> 
> about $11ish or less a month.  Traffic is minimal, and like I say the
> only tech support calls I've had to make this past year were when the
> hosting service tweeked and freaked something thus messing it all up.


http://solutions.plaguenet.com/

HTH


-Kyle

--- End Message ---
--- Begin Message ---

 > My hosting service which WAS cool about 2 years ago has 
 > grown into a bloated mess of zero logic.

Fast, Reliable, Cheap, Feature-Rich

Now pick any three.

In the end I guess you get what you pay for.  If you can only afford a
lower price host then you only get lower value.

CYA, Dave

--- End Message ---
--- Begin Message ---
Cheap?
I've been with experthost.com for around 8 months, with very little to
complain about... I've got a reseller account with about 12 domains, so i'm
paying around US$6each, and I think the standard is US$15each for one, $10ea
for two, and then a sliding scale up to 25 domains @ $5ea or something.

It *shouldn't* be about the money, but I'm currently making a healthy profit
out of hosting some client domains under my account.


Reliable?
They have intelligent support staff on 24/7, and they've had one service
fallout in this time.  It was a biggie, and I had to reload some data from
my local copy, but I'd like to believe this was a one-off.


Fast?
The service seems fast (although I'm in Australia, so pings times are
affected by sheer distance).


Feature Rich?
50meg, 20POPs, redirects, groups, auto-responders, 2GB bandwidth, MySQL,
webmail, recent versions of Apache/MySQL/PHP, intelligent support staff, etc
etc.


I'm pretty happy.  Better still, they offer a free 1 month test account, so
you can try them for yourself.


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------





on 06/05/02 9:19 AM, David Freeman ([EMAIL PROTECTED]) wrote:

> 
>> My hosting service which WAS cool about 2 years ago has
>> grown into a bloated mess of zero logic.
> 
> Fast, Reliable, Cheap, Feature-Rich
> 
> Now pick any three.
> 
> In the end I guess you get what you pay for.  If you can only afford a
> lower price host then you only get lower value.
> 
> CYA, Dave
> 

--- End Message ---
--- Begin Message ---
php/mysql and tons of other features. The absolute
best control panel I have seen. (demo on their site).
Great support when needed as well.

http://www.websitesource.com

olinux

--- Kyle Gibson <[EMAIL PROTECTED]> wrote:
> > My clients aren't rich big money folks but I need
> a PHP capable host for
> > 
> > about $11ish or less a month.  Traffic is minimal,
> and like I say the
> > only tech support calls I've had to make this past
> year were when the
> > hosting service tweeked and freaked something thus
> messing it all up.
> 
> 
> http://solutions.plaguenet.com/
> 
> HTH
> 
> 
> -Kyle
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com
--- End Message ---
--- Begin Message ---
I've tried the "From" header (4th parameter) in mail().  It doesn't work.

My ISP does run Apache but I have no access to their files.

Thanks!
At 06:56 PM 5/3/2002 +0100, you wrote:
>On 3 May 2002 at 12:48, Anthony Rodriguez wrote:
> > PROBLEM
> >
> > When a php script uses mail() and sendmail, if the e-mail address is
> > not right, the e-mail is returned to the envelope sender (the hosting
> > provider), NOT to the "From", "Reply-To",  "Return-Path", or any other
> > additional headers included in mail().
> >
> > Apparently, this problem is faced by any user who utilizes a hosting
> > provider.
>
>The envelope address can be set on a per script basis by setting the 
>sendmail_from value
>using ini_set(). Alternatively, if you are using Apache, you can set it in 
>a .htaccess file.
>
>--
>Stuart

--- End Message ---
--- Begin Message ---
I'm using winxp and php.. can this be the problem. I solved the problem by
donwgrade to php 4.1.0..



"Austin Marshall" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Daniel SvanbäCk wrote:
> > Hi
> >
> > I have a problem. I can't send the session_id to the next page. It
worked
> > before (when I had an old version of php, now I have 4.2.0). It can send
the
> > session_id() if it's a link, but not a header(). If it is a header I
have to
> > do this:
> >
> > define('MYSID', session_name().'='.session_id());
> > header('Location: ../index.php?'.zOLSID);
> >
> > Do I have to add this to every header()? Or is there a easyier way. I
have
> > global variables = on.
> >
> > //Daniel
> >
> >
>
> Straight from the manual at http://www.php.net/manual/en/ref.session.php
>
> PHP is capable of doing this transparently when compiled with
> --enable-trans-sid. If you enable this option, relative URIs will be
> changed to contain the session id automatically. Alternatively, you can
> use the constant SID which is defined, if the client did not send the
> appropriate cookie. SID is either of the form session_name=session_id or
> is an empty string.
>
> You probably didn't have --enable-trans-sid when you configured/compiled
PHP
>


--- End Message ---
--- Begin Message ---
I'm using winxp and php.. can this be the problem. I solved the problem by
donwgrade to php 4.1.0..



"Austin Marshall" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Daniel SvanbäCk wrote:
> > Hi
> >
> > I have a problem. I can't send the session_id to the next page. It
worked
> > before (when I had an old version of php, now I have 4.2.0). It can send
the
> > session_id() if it's a link, but not a header(). If it is a header I
have to
> > do this:
> >
> > define('MYSID', session_name().'='.session_id());
> > header('Location: ../index.php?'.zOLSID);
> >
> > Do I have to add this to every header()? Or is there a easyier way. I
have
> > global variables = on.
> >
> > //Daniel
> >
> >
>
> Straight from the manual at http://www.php.net/manual/en/ref.session.php
>
> PHP is capable of doing this transparently when compiled with
> --enable-trans-sid. If you enable this option, relative URIs will be
> changed to contain the session id automatically. Alternatively, you can
> use the constant SID which is defined, if the client did not send the
> appropriate cookie. SID is either of the form session_name=session_id or
> is an empty string.
>
> You probably didn't have --enable-trans-sid when you configured/compiled
PHP
>


--- End Message ---
--- Begin Message ---
Hi, if I use the mail function, as in :
mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
The mail comes from "Webserver"  How can I change the from ?




--- End Message ---
--- Begin Message ---
Diana Castillo wrote:
Diana Castillo wrote:
> Hi, if I use the mail function, as in :
> mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
> The mail comes from "Webserver"  How can I change the from ?
> 
> 
> 
> 

Just as the manual says, the 4th parameter which is optional allows you 
to specify additional headers.

Try mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 
3","From: user@domain");


--- End Message ---
--- Begin Message ---
On Sun, 5 May 2002, Josh & Valerie McCormack wrote:
> I'm iterating through a CSV file pulling in rows as arrays with fgetcsv 
> and I'd like to search for patterns made up of the first two array items 
> of each row with a space between them in a text file, and make them into 
> links. I can't figure out how to do this, could someone help?

How about posting a sample row or two along with how you want the data to
appear after the transformation?

miguel

--- End Message ---
--- Begin Message ---
Is there a tail util for NT/W2K?

 .b

> -----Original Message-----
> From: Dave Raven [mailto:[EMAIL PROTECTED]]
> Sent: 05 May 2002 10:33
> To: Liam MacKenzie; [EMAIL PROTECTED]; Tom Rogers
> Subject: Re: [PHP] Tailing a log file {!?}
>
>
> check directory rights.
>
> If need be, passwd the user and give it a shell.
> then try on the console as the webserver user
> to tail the file.
>
> ----- Original Message -----
> From: "Liam MacKenzie" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Tom Rogers" <[EMAIL PROTECTED]>
> Sent: Saturday, May 04, 2002 11:26 AM
> Subject: Re: [PHP] Tailing a log file {!?}
>
>
> > That doesn't work either!
> > Something's going on here...
> >
> >
> >
> > ----- Original Message -----
> > From: "Tom Rogers" <[EMAIL PROTECTED]>
> > To: "Liam MacKenzie" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Sunday, May 05, 2002 6:49 PM
> > Subject: Re: [PHP] Tailing a log file {!?}
> >
> >
> > Hi
> > The following works for me, give it a try with the correct path.
> >
> > <?
> > exec("tail -n 50 /usr/local/apache/logs/access_log",$result);
> > echo count($result)." results returned. <br>";
> > if(count($result) > 0){
> >          foreach($result as $line){
> >                  echo $line."<br>";
> >          }
> > }
> > ?>
> >
> > Tom
> >
> >
> > At 06:25 PM 4/05/2002, Liam MacKenzie wrote:
> > >$cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
> > >$result);
> > >
> > >echo "$cmd";
> > >
> > >Still returns nothing under the top text.
> > >
> > >All log files are chmodded 644 and are owned by the web server.
> > >The paths to the files are correct.
> > >
> > >I've run out of ideas  =(
> > >
> > >Thanks
> > >
> > >
> > >----- Original Message -----
> > >From: "Jason Wong" <[EMAIL PROTECTED]>
> > >To: <[EMAIL PROTECTED]>
> > >Sent: Sunday, May 05, 2002 6:22 PM
> > >Subject: Re: [PHP] Tailing a log file {!?}
> > >
> > >
> > >On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> > > > Sorry, I should have included this in the first email...
> > >
> > >[snip]
> > >
> > > > When I call the page, I get the expected at the top:
> > > > Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> > > > Displaying the last 150 lines of error.log...
> > > >
> > > > But there's nothing underneath it.
> > >
> > >1) Check that you have permissions to access the file
> > >2) Add a 'return_var' to your exec() call. And check what this
> contains.
> > >
> > >--
> > >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > >Open Source Software Systems Integrators
> > >* Web Design & Hosting * Internet & Intranet Applications Development *
> > >
> > >/*
> > >DeVries' Dilemma:
> > >If you hit two keys on the typewriter, the one you don't want
> > >hits the paper.
> > >*/
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >
> >
> > --
> > PHP 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
>

--- End Message ---
--- Begin Message ---

 > Is there a tail util for NT/W2K?

Almost certainly there will be a tool that will read the end of files.
The problem will be in what you want to look at.  If you want to look at
log files on NT/2K then, AFAIK, they aren't actually vanilla text files
so a tail util won't do the job.  I'm not actually sitting near an NT/2K
box at the moment so I can't check that for certain.

CYA, Dave


--- End Message ---
--- Begin Message ---
On Mon, 6 May 2002, .ben wrote:
> Is there a tail util for NT/W2K?

I suspect cygwin would include one.

miguel

--- End Message ---
--- Begin Message ---
Hi all,

For those faced with the task of updating 100's or 1000's of pages that
assumed register_globals on, I've found a couple of solutions which can work
as a temporary solution whilst you re-engineer your pages (as I plan to do).

1. simple: ask your ISP to change php.ini :)

2. use a .htaccess file to change register_globals for your domain / dir, as
long as your Apache config file allows it.
http://www.php.net/manual/en/configuration.php

3. (untested) use ini_set() to turn them back on at a per-script or
per-config file level.
http://www.php.net/manual/en/function.ini-set.php

4. add this code to the top of your pages, or in a common library of code /
config file:

<?
foreach($GLOBALS as $key => $value)
    { $$key=$value; }
?>

If you have this url: page.php?foo=bah, with register_globals off, $foo will
not be available in your script automatically, as it was in older PHP
versions.

Using the above code, we scroll through the $GLOBALS array, and for each key
(eg foo) we assign a var of the same name (eg $foo) and assign it the
matching value (eg $foo = "bah").


The ultimate (secure) solution would be to get your code up to scratch with
the new set-up (and I plan to do this, ASAP), but I myself do not have time
for this, given that I have to update MANY sites within a short time frame,
and my ISP is planning a merge to the new version very soon.


I think foreach() was only available in newer versions of PHP though sorry.


Hope this helps.


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------



--- End Message ---
--- Begin Message ---
> 2. use a .htaccess file to change register_globals for your 
> domain / dir, as long as your Apache config file allows it.
> http://www.php.net/manual/en/configuration.php

As Justin stated, doing this (use of .htaccess) is possible 
if your host allows it.  The following will work in 
.htaccess:

  php_flag register_globals on

> 3. (untested) use ini_set() to turn them back on at a 
> per-script or per-config file level.
> http://www.php.net/manual/en/function.ini-set.php

This will not work as expected, $_GET['foo'] will not 
be $foo with register_globals set via ini_set().

> 4. add this code to the top of your pages, or in a common 
> library of code / config file:
> 
> <?
> foreach($GLOBALS as $key => $value)
>     { $$key=$value; }
> ?>

This will not work, the whole point of register_globals is 
to register variables into the global scope, which is what 
$GLOBALS is.  You're also trying to rewrite a ton of variables, 
such as $_GET.  Not a good idea.  To see what I mean, try:

  print_r($GLOBALS);

Also note that $GLOBALS lives within $GLOBALS.  As do all 
the PHP variables.

> If you have this url: page.php?foo=bah, with register_globals off, 
> $foo will not be available in your script automatically, as it 
> was in older PHP versions.

Just to be clear to everyone, register_globals is a directive that 
can be set in php.ini any time, in any version of PHP.  Also read 
about the mysterious variables_order directive.

> Using the above code, we scroll through the $GLOBALS array, and for 
> each key (eg foo) we assign a var of the same name (eg $foo) and 
> assign it the matching value (eg $foo = "bah").

As stated above, this will not work.  register_globals = on will 
add 'foo' to $GLOBALS.

> I think foreach() was only available in newer versions of PHP 
> though sorry.

foreach has been around since PHP 4.0.0, see php.net/foreach 
for PHP 3 alternatives.

Now, to hack them old scripts to work, consider using either 
extract() and/or import_request_variables().  These will allow 
you to easily mimik register_globals at runtime.  I believe 
the following is a pretty good hack to get the job done:

Goal:  register a lot of variables into the global scope
order: gpcss (order of $types_to_register)

  $types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
  foreach ($types_to_register as $type) {
    $arr = @${'HTTP_' . $type . '_VARS'};
    if (@count($arr) > 0) {
      extract($arr, EXTR_OVERWRITE);
    }
  }

Granted that it may not be identical to your register_globals, 
it may or may not be what you want so adjust accordingly.

I've posted a few related replies to this topic, see:

  Re: Using the new AUTOGLOBALS
    http://marc.theaimsgroup.com/?l=php-general&m=101803683730027

  Re: tutorial on global variables
    http://marc.theaimsgroup.com/?l=php-general&m=102036870428992


Regards,
Philip Olson



--- End Message ---
--- Begin Message ---
Kirk,

Thanx for your help, I've tried with another script and it worked, I
successfully retrieved variable content after issueing a POST, I had
to add my code after the heather code ---> 
<?php header code ?>
<?php my code ?>
>? footer code ?>

This code simply posts the form and uses javascript to validate form
contents before submit. But I still couldn't make my prior code to
work, because variable data is not outputed to mysql db, and I'm
getting parsing errors.

BTW is there a way to know the type of error code is producing ?

TIA 

Cheers,

Rick



Thanks for your help 


> Ricardo,
> I have noticed several things from just a quick look at your code:
> 
>  1. If your not able to post any data/receive any variables from your form
> when the submit button is clicked, you could have register_globals set to
> Off.  Here is a example form used for that situation:
> 
> <form name="form1" method="post" action='<?php $_SERVER['PHP_SELF'] ?>'>
>           <center><input type="submit" name="register" value="REGISTER">
> 
> Please note that I used $_SERVER instead of PHP_SELF alone, and note the use
> of the single quotes.  This is done when register_globals is turned off,
> which I have learned is the best way to write your scripts (thanks to the
> other guys & gals on this discussion board).
> 
> 2. Using
>                 if (isset($submit)) { stuff......}
> 
> is another thing i've been taught to do, rather than if($submit).
> 
> 3. You haven't given a variable name to your submit button:
>                 <input type="submit" value="Enviar"></form>
> 
> give the submit button a name="submit" and you will actually have a variable
> which your script can pick up.  Otherwise nothing will happen.
> 
> HTH,
> 
> -Kirk
> 
> "Ricardo Fitzgerald" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > I've been unsuccesfully trying to add a php script to a postnuke menu.
> > What I did is a simple form, that connects to a mysql database, and
> > inserts data, then some data is retrieved to generate a page with
> > "Welcome $name $lastname ... and so on"
> > The problem is the script must be in the center and must include the
> > header, the footer and the left block, I don't understand many things
> > from the way postnuke works, and I couldn't display any variable
> > entered in the form, neither insert data into the db ...
> > I've tried with action="some.php" and action=<?php PHP_SELF?>;
> > so far I only got parsing errors.
> >
> > Any ideas ?
> >
> > Regards,
> >
> > Rick
> >
> >
> 
> 
> 
--- End Message ---
--- Begin Message ---
Hi there,

I need to schedule to run a PHP script on server side, rather than invoke it 
from browser. Is there any way to compile it to .exe so it can run on 
Solaris/Apache environment? If yes, can you help me know how? Thanks a great 
deal!


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---
> I need to schedule to run a PHP script on server side, rather than invoke it
> from browser. Is there any way to compile it to .exe so it can run on
> Solaris/Apache environment?
no such thing as .exe in Solaris ;)  just "chmod 755" a file and it will
execute.

> If yes, can you help me know how? Thanks a great deal!
If you want to schedule something to run, say, every 5 minutes, then you
add it to your cron jobs.  In FreeBSD, you have to edit /etc/crontab to do
this, then restart cron.  Inorder to execute a PHP script like you
want (and I could be way off on this one), I would install lynx and make
cron call lynx with a link to your .php file.

Sabre

--- End Message ---
--- Begin Message ---
On Monday 06 May 2002 13:59, Julian wrote:
> > I need to schedule to run a PHP script on server side, rather than invoke
> > it from browser. Is there any way to compile it to .exe so it can run on
> > Solaris/Apache environment?

Yes, full instructions in the manual.

> no such thing as .exe in Solaris ;)  just "chmod 755" a file and it will
> execute.
>
> > If yes, can you help me know how? Thanks a great deal!
>
> If you want to schedule something to run, say, every 5 minutes, then you
> add it to your cron jobs.  In FreeBSD, you have to edit /etc/crontab to do
> this, then restart cron.  Inorder to execute a PHP script like you
> want (and I could be way off on this one), I would install lynx and make
> cron call lynx with a link to your .php file.

He did say he did /not/ want to invoke it from a browser :)

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

/*
Beat your son every day; you may not know why, but he will.
*/
--- End Message ---

Reply via email to