[PHP] PHP 4.1.1 on iPlanet 6 sp1 on XP Home (I'm reaching here)..

2002-01-22 Thread James Hallam

We use iPlanet on Windows for a number of our servers, and have succesfully
installed PHP 4.0.6 on NES 4 on NT, with the NSAPI install.  There was one
step that we had to do, which wasn't in the manual, however - which was
making sure that the domain field in the server's TCP/IP Settings was filled
in.  That field wasn't necessary to make NES 4 run, just PHP.

I'm now trying to put together a demonstration laptop, to take some of our
products on the road, where an internet connection wouldn't be available,
and I've got to do our install on a laptop running XP Home, for the moment.
iPlanet 6 sp1 installed perfectly on XP, and the normal NSAPI configuration
for iPlanet went smoothly, but it won't work.

As before, with NES 4 before we added the domain info to the TCP/IP config,
running a phpinfo() file would crash httpd.exe.  The domain fixed this.

Now, does anyone know why this crash happens, and would anyone have any
suggestions how to stop it from happening on XP Home, which doesn't have the
ability to specify a domain?

James Hallam


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




FW: [PHP] PHP 4.1.1 on iPlanet 6 sp1 on XP Home (I'm reaching here)..

2002-01-23 Thread James Hallam

Sorry to re-post this, but I'm really stuck with this one - does *anyone*
out there use iPlanet on Windows?  Have you encountered a problem like mine?

Thanks,

James

-Original Message-
From: James Hallam [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 22, 2002 2:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP 4.1.1 on iPlanet 6 sp1 on XP Home (I'm reaching
here)..


We use iPlanet on Windows for a number of our servers, and have succesfully
installed PHP 4.0.6 on NES 4 on NT, with the NSAPI install.  There was one
step that we had to do, which wasn't in the manual, however - which was
making sure that the domain field in the server's TCP/IP Settings was filled
in.  That field wasn't necessary to make NES 4 run, just PHP.

I'm now trying to put together a demonstration laptop, to take some of our
products on the road, where an internet connection wouldn't be available,
and I've got to do our install on a laptop running XP Home, for the moment.
iPlanet 6 sp1 installed perfectly on XP, and the normal NSAPI configuration
for iPlanet went smoothly, but it won't work.

As before, with NES 4 before we added the domain info to the TCP/IP config,
running a phpinfo() file would crash httpd.exe.  The domain fixed this.

Now, does anyone know why this crash happens, and would anyone have any
suggestions how to stop it from happening on XP Home, which doesn't have the
ability to specify a domain?

James Hallam


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Generating populated variables from component/content pairs in a database

2002-02-01 Thread James Hallam

I've got a fairly basic website content management system I'm working on,
and I've got the data split up in MySQL by the following: a few columns for
identifiers like language, section and unique keyname, a column for a
component name and a column for the relevant content for that component.  As
follows:


|  component  |   content  |

| foo |   123456   |

| bar |   654321   |


Assuming I've got the right sql statement here (it just looks for the rows
that match the section and subsection provided earlier in the script):

$sql = "SELECT FROM $table_name
WHERE sec = '$sec' AND
WHERE subsec = '$subsec' AND
WHERE name = '$name'
ORDER BY component
";

What can I do to end up with a variable for each component/content pair,
with the variable named with the value of the component, and assigned the
value of the content?:

$foo = 123456;
$bar = 654321;

Is there a simple way to do this?

Thanks,

James Hallam


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Generating populated variables from component/content pairs in a database

2002-02-01 Thread James Hallam

Thanks for your reply..  I guess I should have mentioned my platform:
iPlanet/NT..  The manual says that link() isn't available for Windows
users..  Is there another function I could use?

My second question concerns the .. do stuff here .. portion..  I'm not sure
what I'd actually put there.  My goal is to have a variable for each
component/content pair, regardless of how many pairs there are returned by
the SQL statement, and then to have those variables available for display
later on in the page.  Do you have any suggestions?

James

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:18 PM
To: 'James Hallam'; [EMAIL PROTECTED]
Subject: RE: [PHP] Generating populated variables from component/content
pairs in a database


$sql = "SELECT * FROM $table_name
WHERE sec = '$sec' AND
WHERE subsec = '$subsec' AND
WHERE name = '$name'
ORDER BY component
";

$result = mysql_query($sql) or die("Error: ".mysql_error()."$sql");
while ( link($component,$content) = mysql_fetch_array($result) )
{
...do stuff...
}

The filed values will be in the $component and $content.

-Original Message-
From: James Hallam [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 3:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Generating populated variables from component/content
pairs in a database


I've got a fairly basic website content management system I'm working on,
and I've got the data split up in MySQL by the following: a few columns for
identifiers like language, section and unique keyname, a column for a
component name and a column for the relevant content for that component.  As
follows:


|  component  |   content  |

| foo |   123456   |

| bar |   654321   |


Assuming I've got the right sql statement here (it just looks for the rows
that match the section and subsection provided earlier in the script):

$sql = "SELECT FROM $table_name
WHERE sec = '$sec' AND
WHERE subsec = '$subsec' AND
WHERE name = '$name'
ORDER BY component
";

What can I do to end up with a variable for each component/content pair,
with the variable named with the value of the component, and assigned the
value of the content?:

$foo = 123456;
$bar = 654321;

Is there a simple way to do this?

Thanks,

James Hallam


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Generating populated variables from component/content pairs in a database

2002-02-01 Thread James Hallam

Okay, I stripped the SQL statement down to just select all, as there is only
one set of test data in the DB right now.  $component is renamed as $comp in
the new code, as that is the actual name of the table column.  I've got the
code in as follows, but I'm just getting a blank HTML page with nothing in
the body tag:

//  Connecting Stuff up here

$sql = "SELECT * FROM en_na";  //This is the right table

$result = @mysql_query($sql,$connection)
or die("Couldn't execute query.");

while ( list($comp,$content) = mysql_fetch_array($result) )
{
compDisplay[$comp] = $content;
}

?>

// HTML Stuff in here ..




Grr.  I'm stumped..

James



-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:45 PM
To: 'James Hallam'; [EMAIL PROTECTED]
Subject: RE: [PHP] Generating populated variables from component/content
pairs in a database


MEA CULPA...Big-Time typo on my part.  I am sorry...  I meant "list()" not
"link()":

while ( list($component,$content) = mysql_fetch_array($result) )

This statement will return the number of component/content pairs, regardless
of number that are in the database.

In the place where I say "do stuff", that would be where you would use the
variables, such as displaying them or using them in tables, combo boxes,
etc.


If you wanted to store them in an associated array, you could:

while ( list($component,$content) = mysql_fetch_array($result) )
{
myarray[$component] = $content;
}

Hence, the component is the key.

-Original Message-
From: James Hallam [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Generating populated variables from component/content
pairs in a database


Thanks for your reply..  I guess I should have mentioned my platform:
iPlanet/NT..  The manual says that link() isn't available for Windows
users..  Is there another function I could use?

My second question concerns the .. do stuff here .. portion..  I'm not sure
what I'd actually put there.  My goal is to have a variable for each
component/content pair, regardless of how many pairs there are returned by
the SQL statement, and then to have those variables available for display
later on in the page.  Do you have any suggestions?

James

-Original Message-----
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 2:18 PM
To: 'James Hallam'; [EMAIL PROTECTED]
Subject: RE: [PHP] Generating populated variables from component/content
pairs in a database


$sql = "SELECT * FROM $table_name
WHERE sec = '$sec' AND
WHERE subsec = '$subsec' AND
WHERE name = '$name'
ORDER BY component
";

$result = mysql_query($sql) or die("Error: ".mysql_error()."$sql");
while ( link($component,$content) = mysql_fetch_array($result) )
{
...do stuff...
}

The filed values will be in the $component and $content.

-Original Message-
From: James Hallam [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 3:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Generating populated variables from component/content
pairs in a database


I've got a fairly basic website content management system I'm working on,
and I've got the data split up in MySQL by the following: a few columns for
identifiers like language, section and unique keyname, a column for a
component name and a column for the relevant content for that component.  As
follows:


|  component  |   content  |

| foo |   123456   |

| bar |   654321   |


Assuming I've got the right sql statement here (it just looks for the rows
that match the section and subsection provided earlier in the script):

$sql = "SELECT FROM $table_name
WHERE sec = '$sec' AND
WHERE subsec = '$subsec' AND
WHERE name = '$name'
ORDER BY component
";

What can I do to end up with a variable for each component/content pair,
with the variable named with the value of the component, and assigned the
value of the content?:

$foo = 123456;
$bar = 654321;

Is there a simple way to do this?

Thanks,

James Hallam


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.n

[PHP] stupid URL variable question

2002-02-01 Thread James Hallam

Can anyone explain why this URL and SQL statement won't work?

Media Coverage Test Page

--> And on test_mediacoverage.php ..

$table_name = "$locale";

// ..connection content..

$sql = "SELECT comp, content FROM $table_name
WHERE sec = '$sec' AND
subsec = '$subsec' AND
name = '$name'
ORDER BY comp
";

$result = @mysql_query($sql,$connection)
or die("Couldn't execute query.");

It's giving me the 'Couldn't execute query' result, but the SQL statement
does work with the values hard-coded in..  So it must be something about the
way the values are passed through the URL.

On a furthur note, is this a good idea?  I'm using the URL to determine what
content goes into the the template..  I'm not using sessions or cookies (no
authentication needed..) so is there a better way to do this?

Thanks,

James


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] stupid URL variable question

2002-02-01 Thread James Hallam

I think that was a necessary step, I had missed that one, but it
unfortunately hasn't solved the problem.  Once again the page works fine if
I hard-code the values, but even if I replace en_na with $locale, it
breaks..

James

-Original Message-
From: Girish Nath [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 5:53 PM
To: James Hallam; Php-General
Subject: Re: [PHP] stupid URL variable question


Hi

Try without quotes :

$table_name = $locale;

Your SQL is probably reading "SELECT comp, content FROM $locale instead of
en_na

Regards


Girish



- Original Message -----
From: "James Hallam" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Saturday, February 02, 2002 12:42 AM
Subject: [PHP] stupid URL variable question


Can anyone explain why this URL and SQL statement won't work?

Media Coverage Test Page

--> And on test_mediacoverage.php ..

$table_name = "$locale";

// ..connection content..

$sql = "SELECT comp, content FROM $table_name
WHERE sec = '$sec' AND
subsec = '$subsec' AND
name = '$name'
ORDER BY comp
";

$result = @mysql_query($sql,$connection)
or die("Couldn't execute query.");

It's giving me the 'Couldn't execute query' result, but the SQL statement
does work with the values hard-coded in..  So it must be something about the
way the values are passed through the URL.

On a furthur note, is this a good idea?  I'm using the URL to determine what
content goes into the the template..  I'm not using sessions or cookies (no
authentication needed..) so is there a better way to do this?

Thanks,

James


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] trouble passing variables through a URL

2002-02-04 Thread James Hallam

This is the URL in its  tag:

Media Coverage Test Page


Those variables are supposed to be used to populate this SQL statement:


-Original Message-
From: mike cullerton [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 04, 2002 12:03 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Why does heredoc fail in this instance?


on 2/4/02 11:32 AM, Peter J. Schoenster at [EMAIL PROTECTED] wrote:

> Hi
>
> If I use $snippet = ""; and escape the quotes in the block then it
> works. But if I use it as is below, it fails with no useful error
> message. Why?

not sure if this is it or not, but from the manual

 http://www.php.net/manual/en/language.types.string.php

 Variables are expanded, but the same care must be taken when expressing
complex variables inside a here doc as with strings.


i wonder if $this->this_cgi is causing the problem

>
> Thanks,
>
> Peter
>
> function GetAddCommentSnippet($args) {
> $topic_id= $args[id];
> $return_page= $args[return_page];
>
> $snippet = << 
> Your First Name: 
> Your Last Name: 
> Your Email Address: 
> Your Comments:
> 
> 
> 
> 
> 
> 
> 
> 
> EOS;
>
> return $snippet;
>
>
> } // END GetAddCommentSnippet
>
>
> ---
> "Reality is that which, when you stop believing in it, doesn't go
> away".
> -- Philip K. Dick


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


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




RE: [PHP] trouble passing variables through a URL

2002-02-04 Thread James Hallam

(try again - Sorry for the double)

my config: PHP 4.1.1/NT/iPlanet 6.1

This is the URL in its  tag:

Media Coverage Test Page


Those variables are supposed to be used to populate this SQL statement:

$sql = "SELECT comp, content FROM $locale
WHERE sec = '$sec' AND
subsec = '$subsec' AND
name = '$name'
ORDER BY comp
";

If I hard code the variables in on the page it works, but if I leave it as
is, I get this:

You have an error in your SQL syntax near 'WHERE sec = '' AND subsec = ''
AND name = '' ORDER BY comp ' at line 2

Any idea why these aren't being passed?

James Hallam


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




RE: [PHP] trouble passing variables through a URL

2002-02-04 Thread James Hallam

That was *exactly* it..  I copied that code in and everything worked!
Thanks so much - my head was getting sore from beating it on my desk!

I still have much to get used to with 4.1.x ..

James

-Original Message-
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]]On Behalf Of Lars
Torben Wilson
Sent: Monday, February 04, 2002 1:36 PM
To: James Hallam
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] trouble passing variables through a URL


On Mon, 2002-02-04 at 11:49, James Hallam wrote:
> (try again - Sorry for the double)
>
> my config: PHP 4.1.1/NT/iPlanet 6.1
>
> This is the URL in its  tag:
>
> 
HREF="test_mediacoverage.php?locale=en_na&sec=news&subsec=media&name=infowee
> k1">Media Coverage Test Page
>
>
> Those variables are supposed to be used to populate this SQL statement:
>
> $sql = "SELECT comp, content FROM $locale
>   WHERE sec = '$sec' AND
>   subsec = '$subsec' AND
>   name = '$name'
>   ORDER BY comp
>   ";
>
> If I hard code the variables in on the page it works, but if I leave it as
> is, I get this:
>
> You have an error in your SQL syntax near 'WHERE sec = '' AND subsec = ''
> AND name = '' ORDER BY comp ' at line 2
>
> Any idea why these aren't being passed?
>
> James Hallam

Dollars to donuts you have register_globals turned off; that's the
default in PHP 4.1.x+. It's safer not to use it. :)

Try this:

$sql = "SELECT comp, content FROM $_REQUEST[locale]
WHERE sec = '$_REQUEST[sec]' AND
subsec = '$_REQUEST[subsec]' AND
name = '$_REQUEST[name]'
ORDER BY comp
";


Hope this helps,

Torben

--
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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


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




RE: [PHP] PHP/Java/SOAP

2002-02-21 Thread James Hallam

We use iPlanet here, and it has Servlet support built in.  (nice config
menus, too).  PHP works fine too, it just takes a little brain power to
install it correctly..  Anyway, we do have a little servlet guarding a
secure directory, and it uses the PHP engine to grab the templates, same as
every other page on the site.  I'm sorry I can't give you the servlet code,
as I didn't develop it myself, but I just wanted to let you know that it's
been done.  It just needed a little code somewhere in the servlet telling it
to push included .php files through the engine first, before displaying
them..


-Original Message-
From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 21, 2002 1:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP/Java/SOAP



Is there a webserver (Tomcat?) that supports both servlets/JSP and PHP? If
so, is it possible to have PHP and servlet/JSP code collaborating? I'm
looking into using SOAP (apache project's implementation) but I need some of
PHP's functionality.

thanks in advance,
thalis


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


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




RE: [PHP] Checking for and @ and a .

2002-02-27 Thread James Hallam

Use a regular expression to test the variable submitted by the form.  This
is an excerpt from my usual validation script using ereg()..  I'm sure you
can adapt this for your purposes..

if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.

'@'.

'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.

'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email_address)) {

$send = "no";
}

HTH
james

-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 27, 2002 2:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Checking for and @ and a .


I'm trying to make an email field and I would like to check that its valid
by checking for an @ and a . can someone point me in the right direction for
this.

THanks


Philip J. Newman
Philip's Domain - Internet Project.
http://www.philipsdomain.com/
[EMAIL PROTECTED]
Phone: +64 25 6144012




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