php-general Digest 16 Nov 2002 18:12:11 -0000 Issue 1708

Topics (messages 124702 through 124732):

Re: Javascript + PHP
        124702 by: Jason Wong

Forms and Sessions not working
        124703 by: Chris Jackson
        124707 by: Jason Wong

POSIX and PCRE help
        124704 by: OrangeHairedBoy
        124713 by: Aaron
        124722 by: OrangeHairedBoy

Re: what else do i need in this upload script?
        124705 by: Jason Wong

Re: session handling
        124706 by: OrangeHairedBoy
        124728 by: Lars Espelid
        124731 by: Ernest E Vogelsinger

Re: I'm in need of a PHP web host recommendation
        124708 by: OrangeHairedBoy
        124712 by: Jason Reid
        124732 by: John Kenyon

Re: Reasons for error message: Warning: Failed opening '/www/servers/webGNOM/test.php' 
for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
        124709 by: Jason Wong

Re: Relaying variables to distant site
        124710 by: Mike MacDonald

Re: Strings and php.ini
        124711 by: Khalid El-Kary
        124714 by: . Edwin
        124721 by: Khalid El-Kary
        124723 by: . Edwin

php, frames
        124715 by: Adrian Partenie
        124716 by: Aaron

Apache 2 and  PHP 4.2.3.
        124717 by: Horst Gassner
        124719 by: Danny Shepherd

InstallShield
        124718 by: Bob G

Re: GD 1.5
        124720 by: Danny Shepherd

Re: longitude/latitude function
        124724 by: Frederick L. Steinkopf

Form variables not working
        124725 by: Chris Jackson
        124726 by: Leif K-Brooks
        124727 by: Ernest E Vogelsinger
        124730 by: Jason Wong

Re: How to cache PHP on Apache
        124729 by: Luanna Silva

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 ---
On Saturday 16 November 2002 07:07, SED wrote:
> I need to finish a project using PHP and JavaScript but the references
> for JavaScript I'm using is rather old. I'm looking for a JavaScript
> postlist similar to this but without any luck. I have tried Google but
> it finds every site containing JavaScript where a postlist is mentioned.
> Since there are many pros on this list, maybe someone can point me to a
> JavaScript postlist similar to this.

google for 'javascript weenie'

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

/*
The ends justify the means.
                -- after Matthew Prior
*/

--- End Message ---
--- Begin Message ---
Hi all:
Im new to php and i have an isue.

php4.2.3 windows 2000 advanced server


I create a simple form page that posts back to its self and im unable to
retreive the posted form data to display on the page.

it seems like all my GLOBAL amd SESSION stuff isnt working.
sample code:


<form name="form" method="post" action="thispage.php">
Your Name<br>
<input type="text" name="Name" value="<?PHP $Name ?>"><br>
<input type="submit" name="Submit" value="Submit">
</form>

Im thinking that it may be a setting in the php.ini file but i dont know..
Please help.

Thanks.


--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 15:11, Chris Jackson wrote:
> Hi all:
> Im new to php and i have an isue.
>
> php4.2.3 windows 2000 advanced server
>
>
> I create a simple form page that posts back to its self and im unable to
> retreive the posted form data to display on the page.
>
> it seems like all my GLOBAL amd SESSION stuff isnt working.
> sample code:
>
>
> <form name="form" method="post" action="thispage.php">
> Your Name<br>
> <input type="text" name="Name" value="<?PHP $Name ?>"><br>

<?PHP $Name ?> doesn't acutally do anything (that you can see), you need

<?php echo $Name ?>

And if you still don't see anything then ...

> Im thinking that it may be a setting in the php.ini file but i dont know..

... enable register_globals in php.ini. But before you do, READ the notes in 
php.ini AND also the manual about register globals.

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

/*
The proof of the pudding is in the eating.
                -- Miguel de Cervantes
*/

--- End Message ---
--- Begin Message ---
I am trying to learn more about regular expressions as I haven't used them
much in the past. I am working with email, and I'm looking for a way to
split the following expression up:

Content-Type: text/plain; boundary="whatever";

Using   "/^(\S+)\:\s*(.+)$/iU"   I can split it into:

[Content-Type] and [text/plain; boundary="whatever";]

Problem is, it might have different tags. Here's a sketch of the whole
thing:

[Header Name a-zA-Z0-9] [\s*] [:] [\s*] [ Header value a-zA-Z0-9/_ ] [\s*]
[;] [ unlimited repeating pattern of ( [Property Name a-zA-Z0-9] [\s*] [=]
[\s*] ( string optionally surrounded by quotes - but necessary if value has
spaces - but can't include quotes ) [\s*] [;] ) ]

So, if I had:

User: JohnDoe; age=32; nickname="Billy 'the' Kid"; haircolor=orange;

I would need:

User - "JohnDoe" - age - "32" - nickname - "Billy 'the' Kid" - haircolor -
"orange"

in the outputted array. I have no idea how to do repeating patterns like
this...maybe I'm making this too complex?

Thanks for your help!

Lewis


--- End Message ---
--- Begin Message ---
Lewis,

First I would look at breaking out the tags:

    // User: JohnDoe; age=32; nickname="Billy 'the' Kid"; haircolor=orange;

    $string = 'User: JohnDoe; age=32; nickname="Billy \'the\' Kid";
haircolor=orange;';
    $stringArray = preg_split('/;/', $string, -1, PREG_SPLIT_NO_EMPTY);

Then split by the = or :

    // split by = or :

    foreach ($stringArray as $item) {
        list($tag, $element) = preg_split('/\:|\=/', $item, 1,
PREG_SPLIT_NO_EMPTY);
        echo "$tag => $element<br />";
    }

-aaron

"Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to learn more about regular expressions as I haven't used them
> much in the past. I am working with email, and I'm looking for a way to
> split the following expression up:
>
> Content-Type: text/plain; boundary="whatever";
>
> Using   "/^(\S+)\:\s*(.+)$/iU"   I can split it into:
>
> [Content-Type] and [text/plain; boundary="whatever";]
>
> Problem is, it might have different tags. Here's a sketch of the whole
> thing:
>
> [Header Name a-zA-Z0-9] [\s*] [:] [\s*] [ Header value a-zA-Z0-9/_ ] [\s*]
> [;] [ unlimited repeating pattern of ( [Property Name a-zA-Z0-9] [\s*] [=]
> [\s*] ( string optionally surrounded by quotes - but necessary if value
has
> spaces - but can't include quotes ) [\s*] [;] ) ]
>
> So, if I had:
>
> User: JohnDoe; age=32; nickname="Billy 'the' Kid"; haircolor=orange;
>
> I would need:
>
> User - "JohnDoe" - age - "32" - nickname - "Billy 'the' Kid" - haircolor -
> "orange"
>
> in the outputted array. I have no idea how to do repeating patterns like
> this...maybe I'm making this too complex?
>
> Thanks for your help!
>
> Lewis
>
>


--- End Message ---
--- Begin Message ---
Aaron,

Thanks for the advise, but I'm got a problem. If I first split it up by /;/,
how do I catch it if there's a semi-colon inside a string?

Lewis


"Aaron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Lewis,
>
> First I would look at breaking out the tags:
>
>     // User: JohnDoe; age=32; nickname="Billy 'the' Kid";
haircolor=orange;
>
>     $string = 'User: JohnDoe; age=32; nickname="Billy \'the\' Kid";
> haircolor=orange;';
>     $stringArray = preg_split('/;/', $string, -1, PREG_SPLIT_NO_EMPTY);
>
> Then split by the = or :
>
>     // split by = or :
>
>     foreach ($stringArray as $item) {
>         list($tag, $element) = preg_split('/\:|\=/', $item, 1,
> PREG_SPLIT_NO_EMPTY);
>         echo "$tag => $element<br />";
>     }
>
> -aaron
>
> "Orangehairedboy" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am trying to learn more about regular expressions as I haven't used
them
> > much in the past. I am working with email, and I'm looking for a way to
> > split the following expression up:
> >
> > Content-Type: text/plain; boundary="whatever";
> >
> > Using   "/^(\S+)\:\s*(.+)$/iU"   I can split it into:
> >
> > [Content-Type] and [text/plain; boundary="whatever";]
> >
> > Problem is, it might have different tags. Here's a sketch of the whole
> > thing:
> >
> > [Header Name a-zA-Z0-9] [\s*] [:] [\s*] [ Header value a-zA-Z0-9/_ ]
[\s*]
> > [;] [ unlimited repeating pattern of ( [Property Name a-zA-Z0-9] [\s*]
[=]
> > [\s*] ( string optionally surrounded by quotes - but necessary if value
> has
> > spaces - but can't include quotes ) [\s*] [;] ) ]
> >
> > So, if I had:
> >
> > User: JohnDoe; age=32; nickname="Billy 'the' Kid"; haircolor=orange;
> >
> > I would need:
> >
> > User - "JohnDoe" - age - "32" - nickname - "Billy 'the' Kid" -
haircolor -
> > "orange"
> >
> > in the outputted array. I have no idea how to do repeating patterns like
> > this...maybe I'm making this too complex?
> >
> > Thanks for your help!
> >
> > Lewis
> >
> >
>
>


--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 06:54, tweak2x wrote:
> it dosnt work for me

<sigh>

 http://marc.theaimsgroup.com/?l=php-general&m=103678340124082&w=2

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

/*
It is better to remain childless than to father an orphan.
*/

--- End Message ---
--- Begin Message ---
Here's what you need:

on page 1.php:

<?php
session_start();
$temp = 'someValue';
session_register("temp");
?>

on page 2.php:

<?php
session_start();
print $temp; /* PHP sets the variables back the way they were for you! */
?>

You have to register the variable with the session first so it knows that
it's a variable that needs monitored and, when the script finishes, needs
saved.

Hope this helps!

Lewis

"Anjali Kaur" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i want to access some variables generated in one page
> in all the other pages, so i thought of using
> $_SESSION.
>
> what i did is :
>
> in page1.php i do:
>
>    $temp = 'someValue';
>    session_start();
>    $_SESSION['abc'] = $temp;
>
>
> in page2.php :
>
> session_start();
> echo($_SESSION['abc']);
>
>
> but i am not able to get the value of abc.
>
> please help me out. i went thru the documentation
> online but cudnt grasp much as to where i am going
> wrong.
>
> thank you.
> anjali.
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - Let the expert host your site
> http://webhosting.yahoo.com


--- End Message ---
--- Begin Message ---
Session-vars won't work on my pages either.
Tried your suggested code, but get the following errors in my browser:

Page 1:
Warning: open(/tmp\sess_22b746f8ee84cf7aadb8da0b37ce9d2a, O_RDWR) failed: m
(2) in c:\apache group\apache\htdocs\system\kode\test.php on line 2


Page 2:
Warning: open(/tmp\sess_22b746f8ee84cf7aadb8da0b37ce9d2a, O_RDWR) failed: m
(2) in c:\apache group\apache\htdocs\system\kode\ident.php on line 2

I have no other code on my pages.
I'm running Apache 1.3.26, PHP 4.0.5 on WinXPpro.

Configuration problem??

Lars




"Orangehairedboy" <[EMAIL PROTECTED]> skrev i melding
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Here's what you need:
>
> on page 1.php:
>
> <?php
> session_start();
> $temp = 'someValue';
> session_register("temp");
> ?>
>
> on page 2.php:
>
> <?php
> session_start();
> print $temp; /* PHP sets the variables back the way they were for you! */
> ?>
>
> You have to register the variable with the session first so it knows that
> it's a variable that needs monitored and, when the script finishes, needs
> saved.
>
> Hope this helps!
>
> Lewis
>
> "Anjali Kaur" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > i want to access some variables generated in one page
> > in all the other pages, so i thought of using
> > $_SESSION.
> >
> > what i did is :
> >
> > in page1.php i do:
> >
> >    $temp = 'someValue';
> >    session_start();
> >    $_SESSION['abc'] = $temp;
> >
> >
> > in page2.php :
> >
> > session_start();
> > echo($_SESSION['abc']);
> >
> >
> > but i am not able to get the value of abc.
> >
> > please help me out. i went thru the documentation
> > online but cudnt grasp much as to where i am going
> > wrong.
> >
> > thank you.
> > anjali.
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Web Hosting - Let the expert host your site
> > http://webhosting.yahoo.com
>
>


--- End Message ---
--- Begin Message ---
At 18:04 16.11.2002, Lars Espelid said:
--------------------[snip]--------------------
>Session-vars won't work on my pages either.
>Tried your suggested code, but get the following errors in my browser:
>
>Page 1:
>Warning: open(/tmp\sess_22b746f8ee84cf7aadb8da0b37ce9d2a, O_RDWR) failed: m
>(2) in c:\apache group\apache\htdocs\system\kode\test.php on line 2
>
>
>Page 2:
>Warning: open(/tmp\sess_22b746f8ee84cf7aadb8da0b37ce9d2a, O_RDWR) failed: m
>(2) in c:\apache group\apache\htdocs\system\kode\ident.php on line 2

It looks as if you have either no /tmp directory (HIGHLY unlikely ;->), or
the user account apache runs in doesn't have the necessary rights for the
/tmp folder.

Set the access mode for the session directory (here: /tmp) to rwxrwxrwx to
allow anyone to read/write it.

However it's better to have a dedicated directory for PHP session files,
for security reasons (sensitive data may be stored there). On our servers,
I have:

session.save_path /tmp/session.php

ls -ald /tmp/session.php gives:
drwx------    2 apache   apache      16384 Nov 16 17:35 /tmp/session.php

allowing full access only to user "apache", and no one else.

>I have no other code on my pages.
>I'm running Apache 1.3.26, PHP 4.0.5 on WinXPpro.
>
>Configuration problem??

Ups - yes, it's a config problem.
On Win32 there's no directory /tmp, you need to set some other directory in
php.ini file, e.g. C:/TEMP.

What I said above for /tmp/session.php and the access rights holds true for
Win32 as well. Create an own directory for PHP session files, and set
access rights tightly, granting only the Apache user full access, denying
anyone else. Also set the owner of this directory to the Apache user.

Using the "Services" control panel, make sure Apache doesn't run under the
"system" or "Administrator" account, create a user for the Apache service
and grant the necessary rights (e.g. "allowed to run as a service", "may
log on locally", etc).


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
Seems a bit expensive though...$7.95/month for 5megs and 1 email.

You could try your-site.com which is $5.00/month for 50megs and 25 email,
etc...

Or, look at CIHOST.com - the folks I use. Their cheapest unix deal is ~
$15/month for 100megs, 25+email, mysql, etc...mega fast connection too...
One thing I like about them is their policy is to never use more than 33% of
their bandwidth...just in case...site never goes down...i'm on a trip...

Lewis


"Edward Peloke" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> http://www.ht-tech.net is who I use, VERY GOOD!  Just tell them I sent
you.
>
> Eddie
>
> -----Original Message-----
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 15, 2002 11:49 AM
> To: 'Phil Schwarzmann'; [EMAIL PROTECTED]
> Subject: RE: [PHP] I'm in need of a PHP web host recommendation
>
>
> Hi Phil,
>
> > would like to hear some recommendations of some
> > good companies that host PHP/MySQL and also JSP.
>
> http://34sp.com/ are great if you don't mind .uk-based hosting. I've heard
> good things about http://oneandone.co.uk/ but haven't used them myself.
>
> At the other end of the scale, you should stay *well* away from
> http://zenithtech.com/ - they're without a doubt the worst host I've ever
> used.
>
> Cheers
> Jon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
I suggest paying a visit to www.webhostingtalk.com and search the forums... theres 
tons of information on the large, and small hosts that might help. 

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

"OrangeHairedBoy" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Seems a bit expensive though...$7.95/month for 5megs and 1 email.
> 
> You could try your-site.com which is $5.00/month for 50megs and 25 email,
> etc...
> 
> Or, look at CIHOST.com - the folks I use. Their cheapest unix deal is ~
> $15/month for 100megs, 25+email, mysql, etc...mega fast connection too...
> One thing I like about them is their policy is to never use more than 33% of
> their bandwidth...just in case...site never goes down...i'm on a trip...
> 
> Lewis
> 
> 
> "Edward Peloke" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > http://www.ht-tech.net is who I use, VERY GOOD!  Just tell them I sent
> you.
> >
> > Eddie
> >
> > -----Original Message-----
> > From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 15, 2002 11:49 AM
> > To: 'Phil Schwarzmann'; [EMAIL PROTECTED]
> > Subject: RE: [PHP] I'm in need of a PHP web host recommendation
> >
> >
> > Hi Phil,
> >
> > > would like to hear some recommendations of some
> > > good companies that host PHP/MySQL and also JSP.
> >
> > http://34sp.com/ are great if you don't mind .uk-based hosting. I've heard
> > good things about http://oneandone.co.uk/ but haven't used them myself.
> >
> > At the other end of the scale, you should stay *well* away from
> > http://zenithtech.com/ - they're without a doubt the worst host I've ever
> > used.
> >
> > Cheers
> > Jon
> >
> > --
> > 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 ---

Jason Reid wrote:

I suggest paying a visit to www.webhostingtalk.com and search the forums... theres tons of information on the large, and small hosts that might help.
I use www.phpwebhosting.com and have been happy with them so far. $10 a month, but they are generous (and flexible, at least so they say) about space and bandwidth.

jck

--- End Message ---
--- Begin Message ---
On Saturday 16 November 2002 03:49, Lee P. Reilly wrote:

> Can someone suggest a reason for the following? I am trying to INCLUDE
> the JPGraph libraries in my PHP script as follows:

[snip]

> My INCLUDE_PATH is set to /usr/local/lib/php, so the 5 INCLUDED scripts
> are in there. However, this code results in the following error message:
>
> Warning: Failed opening '/www/servers/webGNOM/test.php' for inclusion
> (include_path='.:/usr/local/lib/php') in Unknown on line 0
>
> I also tried changing the include line to
> ../../../www/server/webGNOM/JpGraph_1.9.2/ blah blah... but that gave me
> the same error. Any ideas anyone?

I think this error has something to do with the auto_prepend file. Check 
whether you have one set and search the archives.

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

/*
Nonsense.  Space is blue and birds fly through it.
                -- Heisenberg
*/

--- End Message ---
--- Begin Message ---
Hi people !
Just a few words of thanks. 
This site is now up and going with the help of all of you
Your guidance pointed us towards new learning and discovery.
In the end we needed to use a number of the suggestions made
-- the destination app is somewhat brittle! and the client 
   firewall political !!!
This is what we did:
      o Used readlines() to pull back the pages from the 
        target app site  on port 3000 and echo back on port 80
      o Used redirected the form handler output back to php facade
        pages (pages involving a readlines() call)
Finished 2 hours before target, with all of you helping.

Thanks heaps.
Mike

--- End Message ---
--- Begin Message --- hi,
infact i'm un
able to obtain a copy of my hosting company's php.ini

thanx

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

--- End Message ---
--- Begin Message ---
(B"Khalid El-Kary" <[EMAIL PROTECTED]> wrote:
(B> hi,
(B> infact i'm un
(B> able to obtain a copy of my hosting company's php.ini
(B 
(BThen, perhaps, try running phpinfo() and compare.
(B
(BI think it might even have something to do with "register_globals".
(B
(B- E
--- End Message ---
--- Begin Message --- hi,
the script infact never used register_globals because it's a class that has nothing to do with the direct script input, but there's an idea that came to my mind, maybe the company compiled its own PHP? may this change anything?

generally is Linux different from windows in String functions? encoding for example?

thanx edwin, and sorry for writing so unpercise questions

khalid

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
Hello,
(B
(B"Khalid El-Kary" <[EMAIL PROTECTED]> wrote:
(B
(B> hi,
(B> the script infact never used register_globals because it's a
(B> class that has nothing to do with the direct script input, but
(B> there's an idea that came to my mind, maybe the company
(B> compiled its own PHP? may this change anything?
(B
(BIt's not impossible but I don't think they would really do that. Maybe you
(Bshould ask them. Or, run phpinfo() and check. Did you check? What did you
(Bfind out?
(B
(B> generally is Linux different from windows in String functions?
(B
(BGenerally no, I don't think so.
(B
(B> encoding for example?
(B
(BIt's possible that they are different but you can check phpinfo().
(B
(BAlso, if you're using multi-byte functions there's a possibility that your
(Bthe company you're using did not compile php with this feature enabled.
(B
(B> thanx edwin, and sorry for writing so unpercise questions
(B
(BWell, later when you are ready to ask precise or specific questions, I'm
(Bsure a lot more people will help you :-)
(B
(BAnyway, as I have mentioned earlier, run phpinfo() in Windows and in Linux
(Bthen compare them. THEN, you might just find out what's causing the
(Bproblem...
(B
(B- E
--- End Message ---
--- Begin Message ---
Hello,
I could use some help. 


I have two framed pages, upperframe.html and lowerframe.html.  In upper frame.html:

echo "<table border=1>"; 
echo "<tr><td></td><td>ID</td><td>Subject</td><td>Open</td><td>Close</td></tr>"; 
while($row = MySQL_fetch_array($result)) { 
echo "<tr><td><form><input type=\"checkbox\" method=\"post\" 
name=\"linia\"></form></td>"; 
echo "<td><a href=\"????\" target=\"_parent\">{$row['id']}</a></td>"; ??????????????
echo "<td>{$row['subject']}</td>"; 
echo "<td>{$row['open']}</td>";
echo "<td>{$row['close']}</td></tr>"; 
} 
echo "</table>";

I display the content of the main table, which has an autoincrement index. For every 
index I have another table, something like  tableID. What I want is to press on  the 
id from a row in upperframe table and to display in lowerframe the tableID. How can I 
do that? 



Thanks a lot, 

Adrian
--- End Message ---
--- Begin Message ---
Adrian,

one thing you can do is point the <a> tag to a target of the lower frame and
in the lower frame you can look for the tableID and get the information from
the database.

echo "<tr><td><a href=\"lowerframe.php?tableID=$row['id']\"
target=\"lowerframe\">{$row['id']}</a></td>";

then you could do something like:

if ($tableID) {
    $query = mysql_query("SELECT...    ...WHERE tableID = '$tableID'");
    while ($row = mysql_fetch_array($query)){
        ...  display something  ...
    }
}


--aaron

"Adrian Partenie" <[EMAIL PROTECTED]> wrote in message
004b01c28d67$52fe9880$0bc46150@olimp">news:004b01c28d67$52fe9880$0bc46150@olimp...
Hello,
I could use some help.


I have two framed pages, upperframe.html and lowerframe.html.  In upper
frame.html:

echo "<table border=1>";
echo
"<tr><td></td><td>ID</td><td>Subject</td><td>Open</td><td>Close</td></tr>";
while($row = MySQL_fetch_array($result)) {
echo "<tr><td><form><input type=\"checkbox\" method=\"post\"
name=\"linia\"></form></td>";
echo "<td><a href=\"????\" target=\"_parent\">{$row['id']}</a></td>";
??????????????
echo "<td>{$row['subject']}</td>";
echo "<td>{$row['open']}</td>";
echo "<td>{$row['close']}</td></tr>";
}
echo "</table>";

I display the content of the main table, which has an autoincrement index.
For every index I have another table, something like  tableID. What I want
is to press on  the id from a row in upperframe table and to display in
lowerframe the tableID. How can I do that?



Thanks a lot,

Adrian


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

When I am laoding php as module:
LoadModule php4_module c:/php/sapi/php4apache2.dll

I get the following error:
Apache.exe: module "c:\php4build\snap\sapi\apache2filter\sapi_apache2.c" is not
compatible with this version of Apache (found 20020628, need 20020903).
Please contact the vendor for the correct version.

What I am doing wrong?

Thanx in advance
Horst

--- End Message ---
--- Begin Message ---
In short - looks as if your version of Apache 2 is out of date.

You're using a version from 28th June, the PHP dll was built against a
version from 3rd September.

Danny.

----- Original Message -----
From: "Horst Gassner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 16, 2002 12:06 PM
Subject: [PHP] Apache 2 and PHP 4.2.3.


> Hi!
>
> When I am laoding php as module:
> LoadModule php4_module c:/php/sapi/php4apache2.dll
>
> I get the following error:
> Apache.exe: module "c:\php4build\snap\sapi\apache2filter\sapi_apache2.c"
is not
> compatible with this version of Apache (found 20020628, need 20020903).
> Please contact the vendor for the correct version.
>
> What I am doing wrong?
>
> Thanx in advance
> Horst
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Hello People! I am still struggling to get PHP up and running. I have used
Installshield and all the defaults suggested. I am using Dreamweaver which
in turn uses IIS at LocalHost. I use the suggested code :-
Running under win2000 and IIS.
<html>
<head>
<title>PHP Test 3</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php echo "Hello World<p>"; ?>
</body>
</html>

I receive the following error :-

"Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means
that a page will only be served up if the REDIRECT_STATUS CGI variable is
set, e.g. via an Apache Action directive."

I went to my PHP.INI file (Despite the InstallShield saying I needn't) and
this is what I found:-

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root =

; The directory under which PHP opens the script using /~usernamem used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = ./

; Whether or not to enable the dl() function.  The dl() function does NOT

work
; properly in multithreaded servers, such as IIS or Zeus, and is

automatically
; disabled on them.
enable_dl = On

; cgi.force_redirect is necessary to provide security running PHP as a CGI

under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1
cgi.force_redirect = 0

As we can see I MUST turn cgi.force_redirect to off and indeed it is. I
therefore don't understand the security alert.

The doc_root =  is as InstallShield installed it. I have tried  C:/PHP with
no change in results.

Could someone please explain what I am doing wrong and suggest a solution.

Many thanks Bob G.







--- End Message ---
--- Begin Message ---
Actually, GD2 can be compiled (after a patch) to read/write GIFs with LZW
compression (the LZW algorithm is the root of the legal iffyness), but
(AFAIK) you're only legally allowed to enable it if you live outside the US
& Canada. AFAIK only FreeBSD's ports system does this atm.


----- Original Message -----
From: "Mako Shark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 7:18 PM
Subject: [PHP] Re: GD 1.5


> <<If the OP was concerned about such issues then
> he/she should not be using GIF at all!>>
>
> This is leading me to believe that I can't use GIFs
> because of these issues. Is this true? I know now that
> Unisys (Unisys?) made a fuss about some compression or
> whatever, but someone told me it was still okay to use
> old GDs (am I naive? maybe). Is it now considered
> piracy to use GIFs at all? Does this mean I have to
> switch over to JPGs, even those images that compress
> better with GIFs? I just assumed we were still
> permitted, what with Jasc and everybody still allowing
> it in their products. Is JPEG (or PNG) the way to go?
> I hesitate using PNGs since they seem to be the
> least-supported out of the 'big three'.

--- End Message ---
--- Begin Message ---
Just a note to keep in the back of your mind.  Unless I'm mistaken MapQuest
prints out road miles to a location.  The formula prints out direct (or as
the crow flies) miles.  There will almost always be differences between the
two.
Fred Steinkopf
----- Original Message -----
From: "Aaron Gould" <[EMAIL PROTECTED]>
To: "Edward Peloke" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 11:49 AM
Subject: Re: [PHP] longitude/latitude function


> I got that from http://freshmeat.net/projects/zipdy/?topic_id=66.  It's a
> program called Zipdy that does these calculations.  There's also a similar
> function on the US government census site (can't remember where though),
but
> I liked Zipdy's better.
>
> --
> Aaron Gould
> [EMAIL PROTECTED]
> Web Developer
> Parts Canada
>
>
> ----- Original Message -----
> From: "Edward Peloke" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 15, 2002 11:55 AM
> Subject: RE: [PHP] longitude/latitude function
>
>
> > Thanks Aaron,
> >
> > If you don't mind me asking, where did you get it?  It seems to give a
> > better answer than my function.
> >
> > Thanks!
> > Eddie
> >
> > -----Original Message-----
> > From: Aaron Gould [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 15, 2002 11:04 AM
> > To: Edward Peloke; [EMAIL PROTECTED]
> > Subject: Re: [PHP] longitude/latitude function
> >
> >
> > Try this snippet... I can't vouch for its accuracy since I am not a
> > mathematician:
> >
> > <?
> > // Function takes latitude and longitude  of two places as input
> > // and prints the distance in miles and kms.
> > function calculateDistance($lat1, $lon1, $lat2, $lon2)
> >     // Convert all the degrees to radians
> >     $lat1 = deg2rad($lat1);
> >     $lon1 = deg2rad($lon1);
> >     $lat2 = deg2rad($lat2);
> >     $lon2 = deg2rad($lon2);
> >
> >     // Find the deltas
> >     $delta_lat = $lat2 - $lat1;
> >     $delta_lon = $lon2 - $lon1;
> >
> >     // Find the Great Circle distance
> >     $temp = pow(sin($delta_lat / 2.0), 2) + cos($lat1) * cos($lat2) *
> > pow(sin($delta_lon / 2.0), 2);
> >
> >     $EARTH_RADIUS = 3956;
> >
> >     $distance = ($EARTH_RADIUS * 2 * atan2(sqrt($temp), sqrt(1 - $temp))
*
> > 1.6093);
> >
> >     return $distance;
> > }
> > ?>
> >
> >
> > --
> > Aaron Gould
> > [EMAIL PROTECTED]
> > Web Developer
> > Parts Canada
> >
> >
> > ----- Original Message -----
> > From: "Edward Peloke" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, November 15, 2002 11:20 AM
> > Subject: [PHP] longitude/latitude function
> >
> >
> > > Has anyone ever written a php function to take the longitude and
> latitude
> > of
> > > two destinations and calculate the distance?
> > >
> > > I am working on one but the output is just a little off.
> > >
> > > Thanks,
> > > Eddie
> > >
> > >
> > > --
> > > 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 ---
I am havein troubles gettin my form variables to work.
The "register_globals" in php.ini is set to its default of "off".

code:


<HTML>
<HEAD>
  <TITLE>Form Series - Example One</TITLE>
</HEAD>
<BODY>
<?
 global $PHP_SELF;
 echo $_POST["answered"];
?>
<form name="forma" action="<?php echo $PHP_SELF ?>" method="post">
asdasdasddassad<br>
 <input type="hidden" name="answered" value="fred">
 <input type="submit">
</form>
</body>
</html>


the  <?php echo $PHP_SELF ?> dosent print anything in the action of the form
and the
echo $_POST["answered"]; on the first run gives an error that says that
"answered" is
an undefined variable. but on the second submit this error is gone with the
submitted data
displaying correctly.

Im an experianced ASP developer and im getting frustrated with PHP. why is
it so dificult
to do the simplest things in php?

please help with simple forms in php that is configured by default to have
"register_globals" set to off.
thanks


--- End Message ---
--- Begin Message ---
Because it isn't? Instead of echoing $PHP_SELF, echo $_SERVER['PHP_SELF']. With the $_POST problem, it's complaining that you're using a variable that isn't defined. Use?
<?php
if(array_key_exists('formfieldnamegoeshere',$_POST)){
print $_POST['formfieldnamegoeshere'];
}
?>
Chris Jackson wrote:

Im an experianced ASP developer and im getting frustrated with PHP. why is
it so dificult
to do the simplest things in php?
thanks




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



--- End Message ---
--- Begin Message ---
At 17:36 16.11.2002, Chris Jackson said:
--------------------[snip]-------------------- 
>I am havein troubles gettin my form variables to work.
>The "register_globals" in php.ini is set to its default of "off".
>
>the <?php echo $PHP_SELF ?> dosent print anything in the action of the form

That's because register_globals is off :)
The PHP_SELF value is contained in the $_SERVER superglobal array and you
may access it anytime, everywhere as $_SERVER['PHP_SELF'].

>and the
>echo $_POST["answered"]; on the first run gives an error that says that
>"answered" is
>an undefined variable. but on the second submit this error is gone with the
>submitted data
>displaying correctly.


This is not an error you see but a Notice or Warning that you are using a
variable (or an array index) that has not been defined yet. While this is
not necessary in this siziation it might point out a possible source of
problems under other circumstances, allowing you to spot why your script
doesn't work as expected.

You could either
    if (array_key_exists('answered', $_POST))
to avoid the warning, or
    error_reporting(E_ALL & ~(E_NOTICE|E_WARNING))
to switch off notices or warnings for this script, if you are prepared to
do so...

>Im an experianced ASP developer and im getting frustrated with PHP. why is
>it so dificult
>to do the simplest things in php?

It's not difficult at all, it's just slightly different to ASP. You'll love
PHP, promised...


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
On Sunday 17 November 2002 00:36, Chris Jackson wrote:
> I am havein troubles gettin my form variables to work.
> The "register_globals" in php.ini is set to its default of "off".

[snip]

> the  <?php echo $PHP_SELF ?> dosent print anything in the action of the
> form and the

Because register globals is disabled you have to use $_SERVER['PHP_SELF'], 
that's covered in the manual.

> echo $_POST["answered"]; on the first run gives an error that says that
> "answered" is
> an undefined variable.

That's because the first time you run it you have not submitted a form yet so 
it's undefined.

Various ways to get around this, most straight forward (IMO) being:

  if (isset($_post['answered'])) { echo $_post['answered']; }

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

/*
This is a test of the emergency broadcast system.  Had there been an
actual emergency, then you would no longer be here.
*/

--- End Message ---
--- Begin Message ---
        My header looks just like this:

        HTTP/1.0 200 OK
        Date: Sat, 16 Nov 2002 16:45:29 GMT
        Server: Apache/1.3.20 (Win32) PHP/4.0.6
        Cache-Control: max-age=3600
        Expires: Sat, 16 Nov 2002 17:45:29 GMT
        X-Powered-By: PHP/4.0.6
        Content-Type: text/html 

        And yes, we use sessions. 

        So, setting session_cache_limiter() to "public" should solve my problem?
        The pragma header is what is missing?

        Instead of changing the code, could i use Apache´s mod_header to do the job?

        Thank you for the help!

Luanna 


>Do you use sessions? If so, try using session_cache_limiter() function. 
>Otherwise connect directly to
>apache with telnet and see the headers yourself.

--- End Message ---

Reply via email to