OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 2 Aug 2005 03:45:12 -0000 Issue 3601

php-general-digest-helplists.php.net
Date: Mon Aug 01 2005 - 22:45:12 CDT


php-general Digest 2 Aug 2005 03:45:12 -0000 Issue 3601

Topics (messages 219769 through 219810):

encoding a + sign
        219769 by: Diana Castillo
        219770 by: Rory Browne
        219771 by: Rory Browne

Re: Running a PHP script everyday [SOLVED]
        219772 by: Jochem Maas

[JOB] Need a Developer for PHP-MySQL Project
        219773 by: Larry E. Ullman

php script calling another one (on different machine), session variables
        219774 by: James
        219775 by: James
        219776 by: Rory Browne
        219777 by: Jochem Maas
        219779 by: Rory Browne
        219793 by: Jochem Maas
        219795 by: James

returning info. from a form selection
        219778 by: Bruce Gilbert
        219780 by: Rory Browne
        219781 by: Jack Jackson
        219784 by: Rory Browne
        219785 by: Edwin Barrios
        219789 by: Jim Moseby

Re: MYSQL translator
        219782 by: Rory Browne

Re: Running a PHP script everyday
        219783 by: Steve Buehler

Re: error checking a null array
        219786 by: Jack Jackson
        219796 by: Jochem Maas
        219798 by: Jack Jackson

Performace and segfault errors with Php5 + Apache 1.3.x + linux-2.6.x
        219787 by: Edwin Barrios
        219790 by: Greg Donald
        219791 by: Edwin Barrios
        219792 by: Greg Donald

trying to understand PHP unpack();
        219788 by: Sonia
        219794 by: Jochem Maas

array()
        219797 by: Sebastian
        219799 by: Edward Vermillion

php-mySQL insert problem
        219800 by: Adi Zebic
        219802 by: Jack Scott

Re: Timezone date/time conversion
        219801 by: Chris Boget

Re: SOLVED - [PHP] php-mySQL insert problem
        219803 by: Adi Zebic
        219804 by: Jack Scott

very simple, yet can't think how.
        219805 by: Esteamedpw.aol.com
        219808 by: sonu gill
        219809 by: Esteamedpw.aol.com
        219810 by: Mark Cain

Java - toString() <-> php - ?
        219806 by: Adi Zebic
        219807 by: sonu gill

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


what type of encoding should I use to send a "+" sign via XML?

--
Diana Castillo
Destinia.com
C/Granvia 22 dcdo 4-dcha
28013 Madrid-Spain
Tel : 00-34-913604039 Ext 216
Fax : 00-34-915228673
email: dianahotelkey.com
Web : http://www.hotelkey.com
      http://www.destinia.com

attached mail follows:


use &#43;

check out www.asciitable.com

On 8/1/05, Diana Castillo <dianahotelkey.com> wrote:
> what type of encoding should I use to send a "+" sign via XML?
>
>
> --
> Diana Castillo
> Destinia.com
> C/Granvia 22 dcdo 4-dcha
> 28013 Madrid-Spain
> Tel : 00-34-913604039 Ext 216
> Fax : 00-34-915228673
> email: dianahotelkey.com
> Web : http://www.hotelkey.com
> http://www.destinia.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On 8/1/05, Diana Castillo <dianahotelkey.com> wrote:
> I used this "%2B" instead of the + sign and it works, what type of encoding
> is that?

%2B looks like something that would appear in a URL, usually in the
QUERY_STRING(which is part of the URL).

&#43; is the format you would use in an XML document itself.

If you're using php check out www.php.net/urlencode and
www.php.net/htmlspecialchars and www.php.net/htmlentities those urls
are from memory, so may not be completely accurate. Let me know if
they're not, and I'll find the right ones for you.

> ----- Original Message -----
> From: "Rory Browne" <rory.brownegmail.com>
> To: "Diana Castillo" <dianahotelkey.com>
> Cc: <php-generallists.php.net>
> Sent: Monday, August 01, 2005 6:43 PM
> Subject: Re: [PHP] encoding a + sign
>
>
> > use &#43;
> >
> > check out www.asciitable.com
> >
> >
> >
> > On 8/1/05, Diana Castillo <dianahotelkey.com> wrote:
> >> what type of encoding should I use to send a "+" sign via XML?
> >>
> >>
> >> --
> >> Diana Castillo
> >> Destinia.com
> >> C/Granvia 22 dcdo 4-dcha
> >> 28013 Madrid-Spain
> >> Tel : 00-34-913604039 Ext 216
> >> Fax : 00-34-915228673
> >> email: dianahotelkey.com
> >> Web : http://www.hotelkey.com
> >> http://www.destinia.com
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
>
>

attached mail follows:


subpudlz.com wrote:
> What a convoluted mess.
>
> Rather than using the shebang at the begging of the PHP file I had to put it
> in the cron command

the shebang only works if you make the file executable...
do something _like_:

$> chmod ug+x /path/to/your/php/file

> "/usr/local/bin/php public_html/wap/mailer/dailylist.php"
>
> It will now run.
>
> But then I had to slightly redesign the HTMLMimeMail code. I had to define
> some of it as functions and include the file as a function definition rather
> than include the direct code. I also had to change my include statements to
> this "include "public_html/wap/mailer/sending.php";" With this type of
> include I can no longer run it from a browser, but I really didn't want to

exactly what 'kind' of include is that then - looks normal to me.

maybe you need to learn a bit about how include works, what the 'current working
directory' is (and how this differs between CLI and SAPI versions), and how
the include_path ini setting affects the use of [include|require](_once)?

that said I've sometimes had to have script that runs off the cmdline and via a browser
and it can be a bit of PITA to get to work flawlessly in both envs :-)

... as long as it works heh! :-)

> do that anyways.
>
> Thanks for all your help.
>
> Andrew Darrow
> Kronos1 Productions
> www.pudlz.com
>
>
> ----- Original Message -----
> From: "Miles Thompson" <milesallnovascotia.com>
> To: <subpudlz.com>; <php-generallists.php.net>
> Sent: Saturday, July 30, 2005 5:57 PM
> Subject: Re: [PHP] Running a PHP script everyday
>
>
>
>>If you're on Windows, use Task Manager and have it start an instance of a
>>web browser, with your URL and script passed to it.
>>or
>>Cron job on server, if you have that level of access.
>>
>>Miles
>>
>>
>>At 01:17 PM 7/30/2005, subpudlz.com wrote:
>>
>>>I have a PHP script that I need to run once a day. I have it currently
>>>setup so that I just run it from my cell phone, but I would prefer
>
> something
>
>>>automated. I'd looked into a cron job, but that just looks like it's for
>>>doing linux command line stuff on my host.
>>>
>>>I also thought about writing a never ending while loop with an if
>
> statement
>
>>>that checks to see if it's time to run the script, then when it is time,
>
> it
>
>>>runs. Then checks to see if it's time again.
>>>
>>>But even assuming I could get it working, do I really want to have a PHP
>>>script that runs all the time. This could be bad if it ate up all the CPU
>
> on
>
>>>my server. I'm not even sure I have access rights to kill the process
>
> once I
>
>>>start it.
>>>
>>>Any suggestions?
>>>
>>>Andrew Darrow
>>>Kronos1 Productions
>>>www.pudlz.com
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>>
>>
>>--
>>No virus found in this incoming message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005
>>
>>
>
>

attached mail follows:


The National Coalition for Dialogue and Deliberation (NCDD) is seeking
an independent contractor or company to perform some PHP and MySQL Web
development work. In simplest terms, the Web site is a MySQL-driven
content management system (CMS), written in PHP, running on a
Unix/Linux server. The project can be done remotely but must be
completed by the end of 2005.

A full and descriptive request for proposal can be found at
http://www.thataway.org/misc/ncdd_rfp.pdf

Questions can be addressed to the contact person named in the RFP or by
replying to this email (not to the mailing list).

Thanks,
Larry

attached mail follows:


I have two Windows machines.

machine A has apache/mysql/php (main host)
machine B has apache/media server (secondary host for high bandwidth
media such as video)

I have admin tools (written in PHP and using sesson variables) on A
which allows for updating of the database with pictures and such. The
admin tools also allows you to delete records.

When the user deletes a record using the admin tools on machine A, I
also want to delete some media files on machine B.

At this point, I figured that I should have my admin tools call a PHP
script on machine B to delete files from the B's filesystem.

I did a search online and it seems that I should use a header() call
to call the PHP script on machine B.

But what if I want to RETURN the user to the admin tools? Can I send
another header() from machine B's script? What will happen to the
session variables? How can I hold onto the session variables while
moving between web servers?

--
-James

attached mail follows:


I just thought of something...

Will this work...

(machine A) User hits submit in the Admin Tools to delete a record.
(machine A) I send POST variables to a database php script in a NEW
WINDOW...at the end of the script...it uses a header() to call the
PHP script on machine B...to delete files from that machine.
(machine B) after the php script runs and deletes the media files, it
displays a "SUCCESS...please close window" which appears in the new
window.

The user still has the admin tools, with it's session variables, in
the parent window.

-James

At 2:43 PM -0400 8/1/05, James wrote:
>I have two Windows machines.
>
>machine A has apache/mysql/php (main host)
>machine B has apache/media server (secondary host for high bandwidth
>media such as video)
>
>I have admin tools (written in PHP and using sesson variables) on A
>which allows for updating of the database with pictures and such.
>The admin tools also allows you to delete records.
>
>When the user deletes a record using the admin tools on machine A, I
>also want to delete some media files on machine B.
>
>At this point, I figured that I should have my admin tools call a
>PHP script on machine B to delete files from the B's filesystem.
>
>I did a search online and it seems that I should use a header() call
>to call the PHP script on machine B.
>
>But what if I want to RETURN the user to the admin tools? Can I
>send another header() from machine B's script? What will happen to
>the session variables? How can I hold onto the session variables
>while moving between web servers?
>
>
>--
>-James
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--
-James

attached mail follows:


On 8/1/05, James <jtuesidesign.com> wrote:
> I have two Windows machines.
>
> machine A has apache/mysql/php (main host)
> machine B has apache/media server (secondary host for high bandwidth
> media such as video)
>
> I have admin tools (written in PHP and using sesson variables) on A
> which allows for updating of the database with pictures and such. The
> admin tools also allows you to delete records.
>
> When the user deletes a record using the admin tools on machine A, I
> also want to delete some media files on machine B.
>
> At this point, I figured that I should have my admin tools call a PHP
> script on machine B to delete files from the B's filesystem.
>
> I did a search online and it seems that I should use a header() call
> to call the PHP script on machine B.
Um.. No. You use header when you want to pass additional headers to
the browser, that is downloading your content. An example of this
would be when you want to serve up a PNG image, instead of html, you
would use header("Content-type: image/png")

You can use a header to redirect a user to scripts on another system.
To do this you would pass a location header header("Location:
serverb.com/whatever")

If you want to call a script on machine B, then you can either simply
use file handling functions eg: fopen("http://machineb/page.php"), or
www.php.net/curl

>
> But what if I want to RETURN the user to the admin tools? Can I send
> another header() from machine B's script? What will happen to the
> session variables? How can I hold onto the session variables while
> moving between web servers?
Do the two machines share a common domain name? are your machines for
example boxa.commondomain.com and boxb.commondomain.com if so then you
can have the cookies(which hold the session tracking number) operate
at the commondomain.com level. All you have to do then is configure
one machine to get session files from the other.

Otherwise you can use session.use_trans_sid and add the SID to the url
when you header("Location")

In windows you could do this by setting up a share containing the
session files, and modding your php.ini file to reflect that the
session info is stored in this file.

If you don't have admin access to your boxes, then you could write a
session handler on one of the systems to dl the necessary sesssion
info on demand. For more info see

Having that said, it seems to be a fairly common requirement - so
there may be a cleaner solution to the one I have outlined here. I've
just never needed it - so therefore I've never come across it.

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

attached mail follows:


Rory Browne wrote:
> On 8/1/05, James <jtuesidesign.com> wrote:

...

>
> Do the two machines share a common domain name? are your machines for
> example boxa.commondomain.com and boxb.commondomain.com if so then you
> can have the cookies(which hold the session tracking number) operate
> at the commondomain.com level. All you have to do then is configure
> one machine to get session files from the other.
>
> Otherwise you can use session.use_trans_sid and add the SID to the url
> when you header("Location")
>
> In windows you could do this by setting up a share containing the
> session files, and modding your php.ini file to reflect that the
> session info is stored in this file.
>
> If you don't have admin access to your boxes, then you could write a
> session handler on one of the systems to dl the necessary sesssion
> info on demand. For more info see

purely out of interest, see what? :-)

>
> Having that said, it seems to be a fairly common requirement - so
> there may be a cleaner solution to the one I have outlined here. I've
> just never needed it - so therefore I've never come across it.
>
>
>>
>>--
>>-James
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>

attached mail follows:


On 8/1/05, Jochem Maas <jochemiamjochem.com> wrote:
> Rory Browne wrote:
> > On 8/1/05, James <jtuesidesign.com> wrote:
>
> ...
>
> >
> > Do the two machines share a common domain name? are your machines for
> > example boxa.commondomain.com and boxb.commondomain.com if so then you
> > can have the cookies(which hold the session tracking number) operate
> > at the commondomain.com level. All you have to do then is configure
> > one machine to get session files from the other.
> >
> > Otherwise you can use session.use_trans_sid and add the SID to the url
> > when you header("Location")
> >
> > In windows you could do this by setting up a share containing the
> > session files, and modding your php.ini file to reflect that the
> > session info is stored in this file.
> >
> > If you don't have admin access to your boxes, then you could write a
> > session handler on one of the systems to dl the necessary sesssion
> > info on demand. For more info see
>
> purely out of interest, see what? :-)

Sorry - but I thought someone of your experience Jochem would know :)

See: http://www.php.net/manual/en/function.session-set-save-handler.php

>
> >
> > Having that said, it seems to be a fairly common requirement - so
> > there may be a cleaner solution to the one I have outlined here. I've
> > just never needed it - so therefore I've never come across it.
> >
> >
> >>
> >>--
> >>-James
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
>
>

attached mail follows:


Rory Browne wrote:

...

>>>
>>>If you don't have admin access to your boxes, then you could write a
>>>session handler on one of the systems to dl the necessary sesssion
>>>info on demand. For more info see
>>
>>purely out of interest, see what? :-)
>
>
> Sorry - but I thought someone of your experience Jochem would know :)

experience? me? only the bad kind ;-)

>
> See: http://www.php.net/manual/en/function.session-set-save-handler.php

ah, righty ho. that does look familiar - I just assumed that you were pointing
to some resource/article elsewhere than php.net - didn't cross my mind that you might
just have been pointing to OP to the most natural place to start reading about sessions
(or anything php for that matter) - which is why I asked, you never you when you can learn
something new! :-)

that said I have always been satisfied with the default session handler (and given that
(nearly) all my work is published either on my 'own' server (not really mine but I have
full control and there are no 'anon' 3rd party running stuff) or on dedicated servers belonging
to clients I don't have to worry about all the potential security risks involved with (badly setup?)
shared hosting environments. for that reason (and lack of time) I have never really dived deep
into to the possibilities of custom session handlers (I have used some 3rd party code once that
used a mysql DB to store the session data which was a quite simple affair - such a setup would
allow sharing of sessions accross various boxes.... asumming a shared base domain)

rgds,
jochem

>
>
>

attached mail follows:


Thanks Rory:

I tried using fopen() and CURL and they both worked like a charm!
No need to juggle redirects and session variables.

-James

At 9:21 PM +0200 8/1/05, Rory Browne wrote:
>On 8/1/05, Jochem Maas <jochemiamjochem.com> wrote:
>> Rory Browne wrote:
>> > On 8/1/05, James <jtuesidesign.com> wrote:
>>
>> ...
>>
>> >
>> > Do the two machines share a common domain name? are your machines for
>> > example boxa.commondomain.com and boxb.commondomain.com if so then you
>> > can have the cookies(which hold the session tracking number) operate
>> > at the commondomain.com level. All you have to do then is configure
>> > one machine to get session files from the other.
>> >
>> > Otherwise you can use session.use_trans_sid and add the SID to the url
>> > when you header("Location")
>> >
>> > In windows you could do this by setting up a share containing the
>> > session files, and modding your php.ini file to reflect that the
>> > session info is stored in this file.
>> >
>> > If you don't have admin access to your boxes, then you could write a
>> > session handler on one of the systems to dl the necessary sesssion
>> > info on demand. For more info see
>>
>> purely out of interest, see what? :-)
>
>Sorry - but I thought someone of your experience Jochem would know :)
>
>See: http://www.php.net/manual/en/function.session-set-save-handler.php
>
>
>>
>> >
>> > Having that said, it seems to be a fairly common requirement - so
>> > there may be a cleaner solution to the one I have outlined here. I've
>> > just never needed it - so therefore I've never come across it.
>> >
>> >
>> >>
>> >>--
>> >>-James
>> >>
>> >>--
>> >>PHP General Mailing List (http://www.php.net/)
>> >>To unsubscribe, visit: http://www.php.net/unsub.php
>> >>
>> >>
>> >
>> >
>>
>>

--
-James

attached mail follows:


can anyone give me an idea on how to return info. from a forl pulldown menu

eg:

<select class="textbox"
                        name="loan_process">
                      <option value=""
                          selected="selected">Purchase</option>
                      <option
                          value="">Construct Home</option>
                      <option>
</select>

and return that to an email address.

thanks

--
::Bruce::

attached mail follows:


You would give the options a different value(each of them in your case is "")

Try
<form action="whatever.php">
 <select class="textbox"
                        name="loan_process">
                      <option value="purchase"
                          selected="selected">Purchase</option>
                      <option
                          value="construct_home">Construct Home</option>
                      <option>
 </select>
</form>

May I also suggest that if you're experimenting try putting "<?php
phpinfo() ?>" without the quotes into whatever.php(see form action)

On 8/1/05, Bruce Gilbert <webguyncgmail.com> wrote:
> can anyone give me an idea on how to return info. from a forl pulldown menu
>
> eg:
>
> <select class="textbox"
> name="loan_process">
> <option value=""
> selected="selected">Purchase</option>
> <option
> value="">Construct Home</option>
> <option>
> </select>
>
> and return that to an email address.
>
>
> thanks
>
>
>
> --
> ::Bruce::
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


It'd have to be in the form of a form and you'd need to add values to
the options, wrap it inside form tags, specify a method like $_POST or
$_GET, error check and then send.

Bruce Gilbert wrote:
> can anyone give me an idea on how to return info. from a forl pulldown menu
>
> eg:
>
> <select class="textbox"
> name="loan_process">
> <option value=""
> selected="selected">Purchase</option>
> <option
> value="">Construct Home</option>
> <option>
> </select>
>
> and return that to an email address.
>
>
> thanks
>
>
>

attached mail follows:


On 8/1/05, Jack Jackson <jackson.linuxgmail.com> wrote:
> It'd have to be in the form of a form and you'd need to add values to
> the options, wrap it inside form tags, specify a method like $_POST or
> $_GET, error check and then send.

You don´t _have_ to specify a method. It defaults to "GET". Although
granted you generally do have to place it inside a <form> tag.

>
>
>
>
> Bruce Gilbert wrote:
> > can anyone give me an idea on how to return info. from a forl pulldown menu
> >
> > eg:
> >
> > <select class="textbox"
> > name="loan_process">
> > <option value=""
> > selected="selected">Purchase</option>
> > <option
> > value="">Construct Home</option>
> > <option>
> > </select>
> >
> > and return that to an email address.
> >
> >
> > thanks
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


 Hi . !
 
 what you want it's recive values from a "select". !!!
 
 First a select input send ( when the form is submitted ), the value of
 the selected item, then
 the php script that it's the form action recive, a on post or get a
 variable with the name of the select input with this value.
 
 Then you have:
 
 This the html source
 
 <form method="post" action="test.php">
 <select class="textbox" name="loan_process">
                      <option value="1"
                          selected="selected">Purchase</option>
                      <option
                          value="2">Construct Home</option>
                      <option>
 </select>
 </form>
 
 
 On the php source:
 
 <?php
 
 if(isset($_POST["loan_process"]))
   echo $_POST["loan_process"];
 ?>
 
 
 That it's all.
>
>
> On 8/1/05, Bruce Gilbert <webguyncgmail.com> wrote:
> > can anyone give me an idea on how to return info. from a forl pulldown menu
> >
> > eg:
> >
> > <select class="textbox"
> > name="loan_process">
> > <option value=""
> > selected="selected">Purchase</option>
> > <option
> > value="">Construct Home</option>
> > <option>
> > </select>
> >
> > and return that to an email address.
> >
> >
> > thanks
> >
> >
> >
> > --
> > ::Bruce::
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>

attached mail follows:


>
> can anyone give me an idea on how to return info. from a forl
> pulldown menu
>
> eg:
>
> <select class="textbox"
> name="loan_process">
> <option value=""
> selected="selected">Purchase</option>
> <option
> value="">Construct Home</option>
> <option>
> </select>
>
> and return that to an email address.
>

A most basic question begs a most basic answer:

<?
if (!$_POST['submit']){ // Display form
?>
<html>
<head>
<title>Dropdown Value to Email</title>
</head>
<body>

<form method="POST" action="<? echo $_SERVER['PHP_SELF'];?>">
<select name="loan_process">
  <option value="Purchase">Purchase</option>
  <option value="Construct">Construct Home</option>
  </select><input type="submit" value="Submit" name="submit">
</form>
</body>
</html>

<?
}else{ // Mail form results
if(mail('recipientexample.com','Dropdown results',$_POST['loan_process'])){
  echo 'Mail sent!';}
else {
  echo 'Mail NOT sent!';}

attached mail follows:


From what I can see it looks a bit like an SQL version of the
strtotime function. Basicly it translates from a less strict syntax,
into the more strict SQL syntax, with the added advantage that the
less strict one can be in a different language(in this case French and
Italian)

Is my understanding correct Alessandro?

On 8/1/05, Alessandro Rosa <zandor_zzyahoo.it> wrote:
> Dear All subscribers,
>
> I wish to submit to you a PHP class I coded to translate native language
> parsed queries into SQL syntax ones.
>
> The main goal of this class is the implementation into web-based
> applications
> for letting final users/customers input their own defined queries without
> knowing
> sql syntax strictly. This goes into the direction of giving wider
> flexibility to sql users.
>
> Native language queries really look like everyday input requests.
>
> Class still supports French and Italian, but I look forward to find helpers
> to
> supply other languages. So you are invited to visit this link
>
> http://www.phpclasses.org/browse/package/2449.html
>
> for further infos, as well as the class code, examples, shots to preview how
> it
> works and a short tutorial.
>
> For those who would like helping me to provide new language, I'm going
> to write down a PDF document for listing the general features, the
> properties
> of all entries to lessen the creation of new related dictionaries.
>
> Thanks,
>
> Alessandro Rosa
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


At 09:56 AM 8/1/2005, you wrote:
>[snip]
>What is the "-q" for? I can't find any documentation on it. If I do
>a "php -h" or "man php", it is not listed. I am running php 5.0.3 on
>RHEL ES 4
>[/snip]
>
>It means 'quiet'...in other words do not send anything to standard out.

Thank You. I guess they are keeping "quiet" about letting people
know about it. I would have thought that a "php -h" or "man php"
would have given me the answer to that one. And since the poster
said that he needed that to run the program, it never occurred to me
that it was for "quiet" since that should not hinder him from running
a program. Just keep him from getting a bunch of output. Of course,
I might have total mis-understood him too. I have to much going on
right now to remember. Anyway, thanks.

Thanks
Steve

attached mail follows:


AAarg.

Okay, thanks to all of you I've decided that any field name I need to
see will be sent to $_SESSION['required_fields'] and basta.

Then after the submit button is pressed, I am doing this:

reset($_SESSION['required_fields']);
   foreach ($_SESSION['required_fields'] as $fieldname)
     {
        if (!isset($_POST[$fieldname]) || empty($_POST[$fieldname]))
         {
         $message[$fieldname]=1;
         include_once(QUESTIONS . 'q.inc');
         }
     }//error check

And this is *almost* working: it seems to crap out after the first loop
through the $_SESSION['required_field'] array.

The array says:

Array ( [required_fields] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4
[4] => 1 [5] => 2 [6] => 3 [7] => 4 [8] => 1 [9] => 2 [10] => 3 [11] =>
4 ) )

$_POST says:

Array ( [action] => [process]process [1] => [2] => 68 [3] => [4] => )

So you see, there's an answer specified for the value of question [2].

But $messages says only:

$message: array(1) { [1]=> int(1) }

Why is it dying after the first loop through?

Thanks in advance

attached mail follows:


Jack Jackson wrote:
> AAarg.
>
>
> Okay, thanks to all of you I've decided that any field name I need to
> see will be sent to $_SESSION['required_fields'] and basta.
>
> Then after the submit button is pressed, I am doing this:
>
>
>
> reset($_SESSION['required_fields']);

reset is not required when using foreach. and given that you have probably
not looped that item

> foreach ($_SESSION['required_fields'] as $fieldname)
> {
> if (!isset($_POST[$fieldname]) || empty($_POST[$fieldname]))
> {
> $message[$fieldname]=1;
> include_once(QUESTIONS . 'q.inc');
> }
> }//error check
>
>

you may be getting into trouble because of php's typecasting - try using
fielnames that are strings that do not auto cast to integers (which can be
used as array keys for indexed arrays) e.g. "cb1" instead of "1"

>
> And this is *almost* working: it seems to crap out after the first loop
> through the $_SESSION['required_field'] array.
>
> The array says:
>
> Array ( [required_fields] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4
> [4] => 1 [5] => 2 [6] => 3 [7] => 4 [8] => 1 [9] => 2 [10] => 3 [11] =>
> 4 ) )
>
> $_POST says:
>
> Array ( [action] => [process]process [1] => [2] => 68 [3] => [4] => )

that does not look like valid output from var_dump() neither does the output you
show for $_SESSION['required_field'].

>
> So you see, there's an answer specified for the value of question [2].
>
> But $messages says only:
>
> $message: array(1) { [1]=> int(1) }
>
>
> Why is it dying after the first loop through?

is it? (use print_r() or var_dump() inside the loop to see what is happening)

NOT SO SUBTLE HINT: USE echo, print_r() and var_dump() until either you fingers or
your eyes start to bleed ;-) if you still haven't figured it out by then it's
time to see a doctor -

>
> Thanks in advance
>

attached mail follows:


I can only swear this to the entire list:

Before I come here for help, each time, I echo and var_dump and print_r
until, yes, I need a doctor.

So by the time I come here, it's not laziness or lack of looking in the
manual, it's head-swirling confusion infused with incompetence and a
complete lack of programming experience at any time before April of this
year which leads me to come back again and again with relatively foolish
questions.

My problem before, for example: In my error check function, I placed the
include file (to return to the form) *within* the foreach loop, and then
I wondered why it only ran through once.

D'oh.

Jochem Maas wrote:
> Jack Jackson wrote:
>
>> AAarg.
>>
>>
>> Okay, thanks to all of you I've decided that any field name I need to
>> see will be sent to $_SESSION['required_fields'] and basta.
>>
>> Then after the submit button is pressed, I am doing this:
>>
>>
>>
>> reset($_SESSION['required_fields']);
>
>
> reset is not required when using foreach. and given that you have probably
> not looped that item
>
>> foreach ($_SESSION['required_fields'] as $fieldname)
>> {
>> if (!isset($_POST[$fieldname]) || empty($_POST[$fieldname]))
>> {
>> $message[$fieldname]=1;
>> include_once(QUESTIONS . 'q.inc');
>> }
>> }//error check
>>
>>
>
> you may be getting into trouble because of php's typecasting - try using
> fielnames that are strings that do not auto cast to integers (which can be
> used as array keys for indexed arrays) e.g. "cb1" instead of "1"
>
>>
>> And this is *almost* working: it seems to crap out after the first
>> loop through the $_SESSION['required_field'] array.
>>
>> The array says:
>>
>> Array ( [required_fields] => Array ( [0] => 1 [1] => 2 [2] => 3 [3] =>
>> 4 [4] => 1 [5] => 2 [6] => 3 [7] => 4 [8] => 1 [9] => 2 [10] => 3 [11]
>> => 4 ) )
>>
>> $_POST says:
>>
>> Array ( [action] => [process]process [1] => [2] => 68 [3] => [4] => )
>
>
> that does not look like valid output from var_dump() neither does the
> output you
> show for $_SESSION['required_field'].
>
>>
>> So you see, there's an answer specified for the value of question [2].
>>
>> But $messages says only:
>>
>> $message: array(1) { [1]=> int(1) }
>>
>>
>> Why is it dying after the first loop through?
>
>
> is it? (use print_r() or var_dump() inside the loop to see what is
> happening)
>
> NOT SO SUBTLE HINT: USE echo, print_r() and var_dump() until either you
> fingers or
> your eyes start to bleed ;-) if you still haven't figured it out by then
> it's
> time to see a doctor -

>
>>
>> Thanks in advance
>>
>
>
>

attached mail follows:


i'am developing a web framework SifEngine (Secure Web Inteface
framework) that implement MVC applaying the security ideas from
http://phpsec.org. I'am using DomXML, Sqlite, Mcrypt and PostgreSql.

After of post my development on the internet ( i have been thinking
to post on PEAR ), i made simple tests of aplications with my
framework. During the implementation, i used Slackware 10.1 with
kernel 2.4.29 + php5.0.4 + Apache 1.3.2, with no problems. I didn't
detect performace problems or segfaults by apache. Then i decided to
do the same test but with kernel 2.6.10, wating that no problems
occur. However my expectation, on this new configuration all the
aplications develped with my framework, had performance issues or in
the worst situation produce apache forks to be restarted, or a lot of
apache forks.

i don't undestand why this occur, i try to use valigrand to verify
memorie lacks without results.

Someone can help me, with this problem !

On this moment i'm using SIfEngine, to implement my proyects only on
kernel 2.4.x !

Thanks !

Atte:
Edwin Hernan Barrios Nuñez
iBand Networks Ltda.
www.iband.net

attached mail follows:


On 8/1/05, Edwin Barrios <advilproggmail.com> wrote:
> i'am developing a web framework SifEngine (Secure Web Inteface
> framework) that implement MVC applaying the security ideas from
> http://phpsec.org. I'am using DomXML, Sqlite, Mcrypt and PostgreSql.
>
> After of post my development on the internet ( i have been thinking
> to post on PEAR ), i made simple tests of aplications with my
> framework. During the implementation, i used Slackware 10.1 with
> kernel 2.4.29 + php5.0.4 + Apache 1.3.2, with no problems. I didn't
> detect performace problems or segfaults by apache. Then i decided to
> do the same test but with kernel 2.6.10, wating that no problems
> occur. However my expectation, on this new configuration all the
> aplications develped with my framework, had performance issues or in
> the worst situation produce apache forks to be restarted, or a lot of
> apache forks.
>
> i don't undestand why this occur, i try to use valigrand to verify
> memorie lacks without results.
>
> Someone can help me, with this problem !
>
> On this moment i'm using SIfEngine, to implement my proyects only on
> kernel 2.4.x !

Any exotic security patches been applied to the kernel that is having issues?

I have PHP5, Apache2 on a 2.6.8 kernel with no issues. It may be that
you have a non-thread-safe library added to your Apache/PHP setup.
Apache 1.3.x is still the Apache of choice last I heard.

--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

attached mail follows:


I compile the vanilla kernel from kernel.org, linux-2.6.10 , and i'am
using apache 1.3.3. My php congifigurations are:

'./configure' '--with-apxs' '--with-pgsql' '--with-mysql'
'--with-opennssl' '--with-zlib' '--with-bz2' '--enable-calendar'
'--with-curl' '--with-curlwarppers' '--enable-ftp' '--with-gettext'
'--with-mcrypt' '--enable-pcntl' '--enable-soap' '--enable-sockets'
'--enable-sqlite-utf8' '--enable-sysvmsg' '--enable-sysvsem'
'--enable-sysvshm' '--enable-shmop' '--with-xsl'
'--enable-maintainer-zts' '--with-tsrm-pthreads'

Then, i don't know what it's happing.

On 8/1/05, Greg Donald <destineygmail.com> wrote:
> On 8/1/05, Edwin Barrios <advilproggmail.com> wrote:
> > i'am developing a web framework SifEngine (Secure Web Inteface
> > framework) that implement MVC applaying the security ideas from
> > http://phpsec.org. I'am using DomXML, Sqlite, Mcrypt and PostgreSql.
> >
> > After of post my development on the internet ( i have been thinking
> > to post on PEAR ), i made simple tests of aplications with my
> > framework. During the implementation, i used Slackware 10.1 with
> > kernel 2.4.29 + php5.0.4 + Apache 1.3.2, with no problems. I didn't
> > detect performace problems or segfaults by apache. Then i decided to
> > do the same test but with kernel 2.6.10, wating that no problems
> > occur. However my expectation, on this new configuration all the
> > aplications develped with my framework, had performance issues or in
> > the worst situation produce apache forks to be restarted, or a lot of
> > apache forks.
> >
> > i don't undestand why this occur, i try to use valigrand to verify
> > memorie lacks without results.
> >
> > Someone can help me, with this problem !
> >
> > On this moment i'm using SIfEngine, to implement my proyects only on
> > kernel 2.4.x !
>
> Any exotic security patches been applied to the kernel that is having issues?
>
> I have PHP5, Apache2 on a 2.6.8 kernel with no issues. It may be that
> you have a non-thread-safe library added to your Apache/PHP setup.
> Apache 1.3.x is still the Apache of choice last I heard.
>
>
> --
> Greg Donald
> Zend Certified Engineer
> MySQL Core Certification
> http://destiney.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


On 8/1/05, Edwin Barrios <advilproggmail.com> wrote:
> I compile the vanilla kernel from kernel.org, linux-2.6.10 , and i'am
> using apache 1.3.3. My php congifigurations are:
>
> './configure' '--with-apxs' '--with-pgsql' '--with-mysql'
> '--with-opennssl' '--with-zlib' '--with-bz2' '--enable-calendar'
> '--with-curl' '--with-curlwarppers' '--enable-ftp' '--with-gettext'

--with-curlwrappers, I doubt that's your segfault issue though.

You could recompile everything with debugging and use gdb. At least
then you could produce a backtrace to send to the maintainers.

--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

attached mail follows:


Hi

In Perl I have a part of a script....

# cut..

my $line = '!v2005*08|05+09?04^19*!';

my ( $s_code, $year, $month, $day, $hour, $minute, $second, $e_code ) =
unpack ( "x1 A1 A4 x1 A2 x1 A2 x1 A2 x1 A2 x1 A2 A1", $line );

print $s_code . "\n";
print $year . "\n";
print $month . "\n";
print $day . "\n";
print $hour . "\n";
print $minute . "\n";
print $second . "\n";
print $e_code . "\n";

sleep 10; # so we can see it in the command window

In Perl this runs without trouble, in PHP it does not seem to work the same
way. Can someone explain to me what I need to do differently to
allow PHP to understand what I am trying to do!

<?

my $line = '!v2005*08|05+09?04^19*!';

$output = unpack ( "x1 A1 A4 x1 A2 x1 A2 x1 A2 x1 A2 x1 A2 A1", $line );

print_r ( $output );

?>

Thanks

SD

attached mail follows:


Sonia wrote:
> Hi
>
> In Perl I have a part of a script....
>
> # cut..
>
> my $line = '!v2005*08|05+09?04^19*!';
                                 ^-- note how my email client screws up your original
string... something I don't really understand...
>
> my ( $s_code, $year, $month, $day, $hour, $minute, $second, $e_code ) =
> unpack ( "x1 A1 A4 x1 A2 x1 A2 x1 A2 x1 A2 x1 A2 A1", $line );
>
> print $s_code . "\n";
> print $year . "\n";
> print $month . "\n";
> print $day . "\n";
> print $hour . "\n";
> print $minute . "\n";
> print $second . "\n";
> print $e_code . "\n";
>
> sleep 10; # so we can see it in the command window
>
>
>
> In Perl this runs without trouble, in PHP it does not seem to work the same
> way. Can someone explain to me what I need to do differently to
> allow PHP to understand what I am trying to do!
>
> <?
>
> my $line = '!v2005*08|05+09?04^19*!';
   ^-- this will cause a parse error

>
> $output = unpack ( "x1 A1 A4 x1 A2 x1 A2 x1 A2 x1 A2 x1 A2 A1", $line );
>
> print_r ( $output );
>
> ?>

I have next no knowledge wroth speaking of concerning binary data - and the
string screw problem mentioned above makes it impossible for me to determine whether
I am really on the right path here but take a look at the following:

$line = "!v2005*08|05+09?0419*!";
$output = unpack ( "x1 A1 A4 x1 A2 x1 A2 x1 A2 x1 A2 x1 A2 A1", $line );
$output2 = unpack ( "x1A1A4x1A2x1A2x1A2x1A2x1A2A1", $line );
$output3 = unpack ( "x1/A1/A4/x1/A2/x1/A2/x1/A2/x1/A2/x1/A2/A1", $line );
$output4 = unpack ( "x1_a/A1_b/A4_c/x1_d/A2_e/x1_f/A2_g/x1_h/A2_i/x1_j/A2_k/x1_l/A2_m/A1_n", $line );
var_dump( $output, $output2, $output3, $output4 );'

this page:
http://nl2.php.net/unpack

... does mention that the php unpack() implementation is somewhat different to the perl one
(btw I'm a complete perl luddite! - I don't think my brain can cope with that much cryptic crap
;-) - that said thank Larry for PCRE!)

I'd be very grateful if you report back on your progress - I for one can definitely learn something
here!

rgds,
jochem

ps - welcome to phpland perlie ;-)

>
>
> Thanks
>
> SD
>

attached mail follows:


is it always necessary to call array() when you do something like this:

mysql_query("SELECT ....");
while($rows .....)
{
    $data[] = $rows;
}

if so, why? i have a habit of never calling array() and someone told me
i shouldn't do this.

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005

attached mail follows:


Sebastian wrote:
> is it always necessary to call array() when you do something like this:
>
> mysql_query("SELECT ....");
> while($rows .....)
> {
> $data[] = $rows;
> }
>
> if so, why? i have a habit of never calling array() and someone told me
> i shouldn't do this.
>
>
If that's your first use of $data then it's not necessary, but it's very
highly recommended to do something like:

$data = array();

mysql_query("SELECT ....");
while($rows .....)
{
    $data[] = $rows;
}

That way you _know_ that $data is "clean" before you start doing
anything with it.

It's always a good idea to set any variables you're using to some value,
either "", array(), 0, or some default value, before you use them to
help keep the "bad guys" out of your scripts.

attached mail follows:


Hi,

I'm new in php so like usual I have little problem(s).
I have "DB" clas who connect to database, select database, query
database and so on.
I have other class "User" with some "members".
exemple:
...
var $firstName;
var $lastName;
...
Then I need to insert created object into mySQL database doing something
like this:
INSERT into TABLE values ($this -> firstName, $this -> lastName);

I do that this way:

$insertQuery = "Insert into TABLE values (".$this -> firstName.",".$this
-> lastName)");
$db = new DB;
$db -> query($insertQuery);

this is not working and I have next message:
Parse error: parse error, unexpected T_OBJECT_OPERATOR in
/Library/Apache2/htdocs/Users.php on line 80

I think that my error is in escape characters and I dont not know hox to
resolve my problem. Any help is welcome.

Thanks in advance

ADI

attached mail follows:


Try this:
$insertQuery = "Insert into TABLE
                (
                        col_one,
                        col_two
                )values (
                        '" . $this -> firstName . "',
                        '" . $this-> lastName . "'
                )";
$db =& new DB;
$res = $db->query($insertQuery);
if(DB::isError($res)){
    exit("Insert query failed: ".__FUNCTION__."() <br>in file
".__FILE__."<br>on line ".__LINE__."<br>".$res->getDebugInfo());
}else{
    return;
}

you need to have quotes arround your varchar items and you should also
specify which column you want the values to go into.
It is also good practice to check if there is an error and try to get
the most information available.

On Tue, 2005-08-02 at 00:44 +0200, Adi Zebic wrote:
> $insertQuery = "Insert into TABLE values (".$this ->
> firstName.",".$this
> -> lastName)");
> $db = new DB;
> $db -> query($insertQuery);

attached mail follows:


> I'm sure something like this has already been written and I'd
> hate to redesign the wheel. I've searched google but came up
> empty and am wondering if any of you guys have what I am
> looking for.

I ended up writing my own. Hopefully to help anyone else out
trying to do the same thing, I've included my function below.
I used the following page as a guide

http://www.timeanddate.com/library/abbreviations/timezones/

function calculateTimeZoneDate( $dateTime, $fromTZ, $toTZ, $fromLocation =
'North America', $toLocation = 'GMT' ) {

  $retval = $dateTime;
  $timeStamp = strtotime( $dateTime );

  $timeZonesArray = array( 'GMT' => array( 'GMT' => +0 // GMT
                                                      ),
                           'North America' => array( 'NST' => -3.5, //
Newfoundland Standard Time
                                                      'NDT' => -2.5, //
Newfoundland Daylight Time
                                                      'AST' => -4, //
Atlantic Standard Time
                                                      'ADT' => -3, //
Atlantic Daylight Time
                                                      'EST' => -5, //
Eastern Standard Time
                                                      'EDT' => -4, //
Eastern Daylight Time
                                                      'CST' => -6, //
Central Standard Time
                                                      'CDT' => -5, //
Central Daylight Time
                                                      'MST' => -7, //
Central Daylight Time
                                                      'MDT' => -6, //
Mountain Daylight Time
                                                      'PST' => -8, //
Pacific Standard Time
                                                      'PDT' => -7, //
Pacific Daylight Time
                                                      'AKST' => -9, //
Alaska Standard Time
                                                      'AKDT' => -8, //
Alaska Daylight Time
                                                      'HAST' => -10, //
Hawaii-Aleutian Standard Time
                                                      'HADT' => -9 //
Hawaii-Aleutian Daylight Time
                                                      ),
                           'Australia' => array( 'NFT' => +11.5, //
Norfolk (Island) Time
                                                      'EST' => +10, //
Eastern Standard Time
                                                      'EDT' => +11, //
Eastern Daylight Time
                                                      'CST' => +9.5, //
Central Standard Time
                                                      'CDT' => +10.5, //
Central Daylight Time
                                                      'WST' => +8, //
Western Standard Time
                                                      'CXT' => +7, //
Christmas Island Time
                                                      ),
                           'Europe' => array( 'GMT' => +0, //
Greenwich Mean Time
                                                      'BST' => +1, //
British Summer Time
                                                      'IST' => +1, // Irish
Summer Time
                                                      'WET' => +0, //
Western European Time
                                                      'WEST' => +1, //
Western European Summer Time
                                                      'CET' => +1, //
Central European Time
                                                      'CEST' => +2, //
Central European Summer Time
                                                      'EET' => +2, //
Eastern European Time
                                                      'EEST' => +3 //
Eastern European Summer Time
                                                      ),
                           'Military' => array( 'Z' => +0, // Zulu
Time Zone
                                                      'Y' => -12, // Yankee
Time Zone
                                                      'X' => -11, // X-ray
Time Zone
                                                      'W' => -10, // Whiskey
Time Zone
                                                      'V' => -9, // Victor
Time Zone
                                                      'U' => -8, // Uniform
Time Zone
                                                      'T' => -7, // Tango
Time Zone
                                                      'S' => -6, // Sierra
Time Zone
                                                      'R' => -5, // Romeo
Time Zone
                                                      'Q' => -4, // Quebec
Time Zone
                                                      'P' => -3, // Papa
Time Zone
                                                      'O' => -2, // Oscar
Time Zone
                                                      'N' => -1, // November
Time Zone
                                                      'A' => +1, // Alpha
Time Zone
                                                      'B' => +2, // Bravo
Time Zone
                                                      'C' => +3, // Charlie
Time Zone
                                                      'D' => +4, // Delta
Time Zone
                                                      'E' => +5, // Echo
Time Zone
                                                      'F' => +6, // Foxtrot
Time Zone
                                                      'G' => +7, // Golf
Time Zone
                                                      'H' => +8, // Hotel
Time Zone
                                                      'I' => +9, // India
Time Zone
                                                      'K' => +10, // Kilo
Time Zone
                                                      'L' => +11, // Lima
Time Zone
                                                      'M' => +12 // Mike
Time Zone
                                                      ));

  $fromGMTDiff = $timeZonesArray[$fromLocation][$fromTZ];
  $toGMTDiff = $timeZonesArray[$toLocation][$toTZ];

  if(( '' != trim( $fromGMTDiff )) && ( '' != trim( $toGMTDiff ))) {
    if( $fromGMTDiff > $toGMTDiff ) {
      $netDiff = $fromGMTDiff - $toGMTDiff;

    } else {
      $netDiff = $toGMTDiff - $fromGMTDiff;

    }
    $retval = date( 'Y-m-d h:i:sa', ( $timeStamp + ( 3600 * $netDiff )));

  }
  return $retval;

} // end function calculateTimeZoneDate()

As for daylight savings time, I'm leaving it up to the developer using the
above function to determing the appropriate TZ based on DST to pass
in. I didn't want to have to worry about what timezones actually use
DST. If anyone sees any gross mistakes, please let me know. Other-
wise, please feel free to use if needed.

thnx,
Chris

attached mail follows:


Jack Scott a écrit :
> Try this:
> $insertQuery = "Insert into TABLE
> (
> col_one,
> col_two
> )values (
> '" . $this -> firstName . "',
> '" . $this-> lastName . "'
> )";
> $db =& new DB;
> $res = $db->query($insertQuery);
> if(DB::isError($res)){
> exit("Insert query failed: ".__FUNCTION__."() <br>in file
> ".__FILE__."<br>on line ".__LINE__."<br>".$res->getDebugInfo());
> }else{
> return;
> }
>
> you need to have quotes arround your varchar items and you should also
> specify which column you want the values to go into.

Yess! That's the right one :-)

> It is also good practice to check if there is an error and try to get
> the most information available.

"DB" class do the right thing with try/catch.

THANK YOU VERY VERY MUCH Jack Scott!

ADI

attached mail follows:


no prob ;-)

On Tue, 2005-08-02 at 02:27 +0200, Adi Zebic wrote:
> Jack Scott a écrit :
> > Try this:
> > $insertQuery = "Insert into TABLE
> > (
> > col_one,
> > col_two
> > )values (
> > '" . $this -> firstName . "',
> > '" . $this-> lastName . "'
> > )";
> > $db =& new DB;
> > $res = $db->query($insertQuery);
> > if(DB::isError($res)){
> > exit("Insert query failed: ".__FUNCTION__."() <br>in file
> > ".__FILE__."<br>on line ".__LINE__."<br>".$res->getDebugInfo());
> > }else{
> > return;
> > }
> >
> > you need to have quotes arround your varchar items and you should also
> > specify which column you want the values to go into.
>
> Yess! That's the right one :-)
>
> > It is also good practice to check if there is an error and try to get
> > the most information available.
>
> "DB" class do the right thing with try/catch.
>
> THANK YOU VERY VERY MUCH Jack Scott!
>
> ADI
>

attached mail follows:


Hi everyone,
 
 Sorry for the n00bie question but I've been racking my brain, searching
Google and yes, I have been "RTFM" for over 6 months :-)
 
All I'm trying to do is set up a "User system" that allows a member to
create their own personal site using an auto_increment type system? This is my
problem...
 
I've been trying to look through other code trying to figure out where and
how they do it - but for some reason I can't figure out how to Dynamically
create something like this:
 
User Joe comes in and creates an account... when he creates his account he
can give his site a TITLE, DESCRIPTION, ABOUT US INFO (say /aboutus.php),
CONTACT (./contactus.php), etc. after he clicks "Submit" the system automatically
creates a site such as _http://mydomain.com/0/joe/ _
(http://mydomain.com/0/joe/ ) , Bob does the same thing and his is _http://mydomain.com/0/bob_
(http://mydomain.com/0/bob)
 
I'm sure most of you know how this is done or you've seen it on sites such
as Soundclick.com (although it's CF) - I've been checking out Jamroom to see if
 I could figure it out there- but kinda got lost lol... I want to use PHP,
Smarty and MySQL to do this - but I'm missing something... I'm not asking
anybody to build this - I'm looking for a little guidance, tips, etc. - that's all.
 
Would this be done through auto_increment in MySQL or something?
 
Thanks everyone :-)

attached mail follows:


From my understanding of what you are trying to do you have templates,
perhaps, setup for your users that get customized with each individuals
data. In that case what you will require to do is first off

1. create a folder for user underneath the corresponding location you want
the user setup, so if
-web address: www.mydomain.com physical location: c:\mydomain\
-web address: www.mydomain.com/Joe/ physical location: c:\mydomain\Joe\

2. insert user data into templates
3. copy the template files over to the new folder location for user, so if
the user has a contactus.php
-web address: www.mydomain.com/Joe/contactus.php physical location:
c:\mydomain\Joe\contactus.php

I'm pretty sure this is probably overkill for what you were looking for.
Hope it helps..

-sonu

ps- You will need to look up directory and file manipulation functions.
They are simple...

<Esteamedpwaol.com> wrote in message news:1e4.40c25a29.30201c0baol.com...
> Hi everyone,
>
> Sorry for the n00bie question but I've been racking my brain, searching
> Google and yes, I have been "RTFM" for over 6 months :-)
>
> All I'm trying to do is set up a "User system" that allows a member to
> create their own personal site using an auto_increment type system? This
> is my
> problem...
>
> I've been trying to look through other code trying to figure out where and
> how they do it - but for some reason I can't figure out how to Dynamically
> create something like this:
>
> User Joe comes in and creates an account... when he creates his account he
> can give his site a TITLE, DESCRIPTION, ABOUT US INFO (say /aboutus.php),
> CONTACT (./contactus.php), etc. after he clicks "Submit" the system
> automatically
> creates a site such as _http://mydomain.com/0/joe/ _
> (http://mydomain.com/0/joe/ ) , Bob does the same thing and his is
> _http://mydomain.com/0/bob_
> (http://mydomain.com/0/bob)
>
> I'm sure most of you know how this is done or you've seen it on sites such
> as Soundclick.com (although it's CF) - I've been checking out Jamroom to
> see if
> I could figure it out there- but kinda got lost lol... I want to use PHP,
> Smarty and MySQL to do this - but I'm missing something... I'm not asking
> anybody to build this - I'm looking for a little guidance, tips, etc. -
> that's all.
>
> Would this be done through auto_increment in MySQL or something?
>
> Thanks everyone :-)
>

attached mail follows:


 
Thanks, that's actually really close to what I was looking for...
 
so if I wanted, say: _http://mydomain.com/0/joe_ (http://mydomain.com/0/joe)
  - you're saying I should have the Directory "/0/" or "/1/" already set
up... right? then do I use something such as mkdir and chdir to create joe? then
file manipulation functions such as fwrite, fread, etc?
 
So basically if I'm reading clearly... I insert the User info into the
Database, then use that info to write into the Directory "/joe/" ?
 
Thanks a lot man, I feel like I might have been right all along - but this
is the first big project I've done - so I'm trying to get the Logic down
correctly before I get started... :-)
 
- Clint
 
p.s. sorry, I meant to do "reply all" :-( So, here it is again!

attached mail follows:


I have coded this type of website for many years and have run the gamut of
trying different things -- originally, 8 years ago, I used perl with flat
files and physical folders but in the recent past I have used PHP, MySQL and
dynamic folders.

In my opinion the best way to build this site is with dynamic folders via
custom 404 error handling. Here how it works:

You build the pages for things like "contact us" "my store" "my stuff" or
whatever. Then you send someone to the site with an address like:
mydomain.com/joe which doesn't exist. A custom 404 error handler picks up
the error and parses the URL to identify "joe" as a unique ID. The 404
script pulls "joe's" info from a database and populates the pages with his
custom contact info then delivers the page. Joe's ID usually gets stuffed
into a cookie and then when the person comes back to the site at a later
date, they are delivered joe's info.

That's it in a nut shell. Be sure that you deliver 200 headers and not 404
headers when delivering the dynamic folder.

Now you can do the physical folders and every time someone "signs up" you
can