[PHP] PHP, LDAP and SASL

2002-04-12 Thread Quinn Perkins

I have an OS X box that has been running PHP 4.1.2 and OpenLDAP 2.0.23 
without any problems. I can bind to the LDAP database from PHP and 
everyone is happy.

I wanted to build a new box with Cyrus-IMAP, Cyrus-SASL and OpenLDAP, 
moving my mail and authentication to it and leave the first box to just 
Apache and PHP. The second box appears to work fine.

Where I'm having problems is binding from my PHP/Apache box to the new 
OpenLDAP box. With identical schema and data, I get errors trying to 
bind to the SASL/LDAP box from my PHP/Apache box that I don't get trying 
to bind to the local LDAP database. I can authenticate locally using the 
LDAP tools with a password against the SASL system.

Does anyone have any idea if any of the following are true:

1) Do I have to build SASL and rebuild LDAP and then build a PHP against 
that LDAP to enable my PHP to bind to my Cyrus/SASL/LDAP box?
2) Is there something special on has to do to bind to a OpenLDAP/SASL 
rather than just OpenLDAP with PHP?

Quinn



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




Re: [PHP] Error accessing class

2002-04-12 Thread Tyler Longren

Hi Andrew,

This error indicates that your path to class.Htpasswd.php3 is wrong.
use this:
include("path/to/class.Htpasswd.php3");

Right now, it's set to look in the php/includes dir.  If the file is
actually in there, then apache might not have perms to read the file (IE:
it's owned by root).

Good luck,
Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message -
From: "Andrew Schoenherr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 13, 2002 12:54 AM
Subject: [PHP] Error accessing class


> Hello,
>
> PHP Version: 4.1.0, Apache Version: 1.3.12, Server: Linux 7.0
> Class name: class.Htpasswd.php3
>
> Thanks to Jason Wong for pointers on posting to the list, the parse
> error was a simple omission of a quotation mark on my part.
>
> This is the error I am getting...
>
> Warning: Failed opening 'class.Htpasswd.php3' for inclusion
> (include_path='.:/php/includes') in /var/www/html/php/dev/valid_user.php
> on line 9
>
> Fatal error: Cannot instantiate non-existent class: htpasswd in
> /var/www/html/php/dev/valid_user.php on line 10
>
> 7 
> 8   9   include("class.Htpasswd.php3");
> 10  $aHTPasswd = new Htpasswd("/var/www/html/private/.htpassd");
> 11  if (!$aHTPasswd->EXISTS)
> 12   {
> 13 print("authentication error);
> 14   }
> 15   else
> 16   {
> 17if ( $aHTPasswd->verifyUser( "phpbook", "phpbook" ) )
> 18{
> 19  print( "phpbook is a valid user" );
> 20}
> 21else
> 22{
> 23  print( "phpbook is not a valid user" );
> 24}
> 25  }
> 26 ?>
> 27 
> 28 
>
> Any ideas on the error?
>
> Thank you,
>
> Regards,
>
> Andrew Schoenherr
>
>
> --
> 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] Error accessing class

2002-04-12 Thread Andrew Schoenherr

Hello,

PHP Version: 4.1.0, Apache Version: 1.3.12, Server: Linux 7.0
Class name: class.Htpasswd.php3

Thanks to Jason Wong for pointers on posting to the list, the parse
error was a simple omission of a quotation mark on my part.

This is the error I am getting...

Warning: Failed opening 'class.Htpasswd.php3' for inclusion 
(include_path='.:/php/includes') in /var/www/html/php/dev/valid_user.php 
on line 9

Fatal error: Cannot instantiate non-existent class: htpasswd in 
/var/www/html/php/dev/valid_user.php on line 10

7 
8  EXISTS)
12   {
13 print("authentication error);
14   }
15   else
16   {
17if ( $aHTPasswd->verifyUser( "phpbook", "phpbook" ) )
18{
19  print( "phpbook is a valid user" );
20}
21else
22{
23  print( "phpbook is not a valid user" );
24}
25  }
26 ?>
27 
28 

Any ideas on the error?

Thank you,

Regards,

Andrew Schoenherr


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




Re: [PHP] How can I read client-side files or upload them to aserver?

2002-04-12 Thread Justin French

To the best of my knowledge, the only files you should be able to read off
the client side are cookies originating from the same domain.*

Otherwise, it'd be a massive breach of privacy.

The only other option is for the user to browse their hard drive, select a
file via a web based form, and upload it to the server with the aid of PHP.


This topic has been discussed millions of times on the list, and should be
easy to search for.


* MSIE security bugs excluded :)


Justin French


Creative Director
http://Indent.com.au





on 13/04/02 2:35 PM, Don ([EMAIL PROTECTED]) wrote:

> Is there a way, in PHP, for me to read client-side files or upload them to a
> server?
> 
> Thanks,
> Don
> 


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




[PHP] Cannot enter single quotation marks in fields

2002-04-12 Thread Denis L. Menezes

Hello friends ,

 I cannot enter single quotation marks in fields. Is this a standard feature
? Is there a workaround?

I am using mysql + php4 on unix.

Thanks
Denis


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




[PHP] Re: Local Test | Different folder - Help!! (part2)

2002-04-12 Thread phplists

My mistake, you have the directory line correctly written with the forward
slash.. But the hosts file should not have any extension..

Bob
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You need to make sure the hosts file in c:\windows is called just hosts
with
> no extension.. Just rename it.. It may also take a reboot and/or some time
> for windows to start using it properly.. And it may help to change the
> forward slash in  to a backslash..
>
> Later,
> Bob
>
> "Tiago SimõEs" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > For those that haven't read my previous posts, i'm trying to be able to
> test
> > locally my php site. My installation (both apache and php) went
smoothly.
> > But instead of using the htdocs folder for the test i wanted to use the
> > c:\website folder. So with some help from you guys i manage to configure
> the
> > httpd.conf file (in the conf Apache subfolder) like this:
> >
> > #this is the bottom part of the conf file
> >
> > 
> > DocumentRoot "C:\website"
> > ServerName website.localhost
> > 
> >
> > 
> > AddType application/x-httpd-php .php
> > AddType application/x-httpd-php .php4
> > #Next line is optional (for viewing source)
> > AddType application/x-httpd-php-source .phps
> > 
> >
> >
> > and in the hosts.sam file in the C:\Windows\
> >
> > 127.0.0.1   localhost
> > 127.0.0.1   website.localhost
> >
> > It "sounds good to me. So why it doesn't work? Any ideas?
> >
> >
> >
> >
> >
>
>



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




[PHP] How can I read client-side files or upload them to a server?

2002-04-12 Thread Don

Is there a way, in PHP, for me to read client-side files or upload them to a server?

Thanks,
Don



[PHP] Re: Pass variables via URL

2002-04-12 Thread phplists

This works:

" width=150 height=100 border=0>

This works too if you're not opposed to using straight php:

\n\nImage Switch\n";
print "\n";
print "\n";

?>

Later,

Bob Weaver

"Craig Westerman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to set $image = imageA via a URL:
>
> http://www.abc123.com/php001/image_switch.php?image=imageA
>
> Script is:
>
> 
> 
>Image Switch
> 
> 
>
>  border="0">
>
> 
> 
>
>
> Image link ends up as:
> http://www.abc123.com/php001/.gif
>
> Link needs to be:
> http://www.abc123.com/php001/imageA.gif
>
> What am I doing wrong?
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]
>



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




[PHP] Re: Local Test | Different folder - Help!! (part2)

2002-04-12 Thread phplists

You need to make sure the hosts file in c:\windows is called just hosts with
no extension.. Just rename it.. It may also take a reboot and/or some time
for windows to start using it properly.. And it may help to change the
forward slash in  to a backslash..

Later,
Bob

"Tiago SimõEs" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> For those that haven't read my previous posts, i'm trying to be able to
test
> locally my php site. My installation (both apache and php) went smoothly.
> But instead of using the htdocs folder for the test i wanted to use the
> c:\website folder. So with some help from you guys i manage to configure
the
> httpd.conf file (in the conf Apache subfolder) like this:
>
> #this is the bottom part of the conf file
>
> 
> DocumentRoot "C:\website"
> ServerName website.localhost
> 
>
> 
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php .php4
> #Next line is optional (for viewing source)
> AddType application/x-httpd-php-source .phps
> 
>
>
> and in the hosts.sam file in the C:\Windows\
>
> 127.0.0.1   localhost
> 127.0.0.1   website.localhost
>
> It "sounds good to me. So why it doesn't work? Any ideas?
>
>
>
>
>



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




[PHP] form mail with attachment

2002-04-12 Thread mm fernandez



i have this code for my form mail:



i need to add an attachment file with the variable $file. what do i need to 
add in the code so that i will also be able to receive the attached file 
sent from the website?

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


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




[PHP] Re: Closing curly brackets?

2002-04-12 Thread Jennifer Downey

My apologies for putting this in the wrong list.

Jennifer

"Jennifer Downey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi everyone,
>
> I have a question about this code. The way it sits now it always shows the
> last record in the table.
> in other words if the user has 6 items, like:
> item id 1
> item id 2
> item id 5
> item id 6
> item id 7
> item id 8
>
> it will only show the last record item id 8.
>
> I believe it has something to do with the first while statement's closing
> curly bracker
> But I can't seem to get it in the right place.
>
> Can someone spot the mistake and show me how to fix it.
> see also comments in code.
>
>
>
> $id = $HTTP_GET_VARS["id"];
>
>
> $query = "SELECT id, name, image, quantity, type FROM
> {$config["prefix"]}_my_items WHERE uid={$session["uid"]} ORDER BY id";
> $ret = mysql_query($query);
>  while($row = mysql_fetch_array($ret))
> {
> $iid = $row['id'];
> $image = $row['image'];
> $name = $row['name'];
> $quantity = $row['quantity'];
> $type = $row['type'];
>
>
> if($iid == $id)
> {
> $display_block =" 2>$name$quantity$type";
> echo "$display_block";
> if($type == "food")
> //if book or weapon is present then set an option and include in the form
> later
> {$thisoption="Feed my pet\n";
> }else{
> //if any other type is present then set a blank
> $thisoption="";}
> }
> }
>
>
>
> //check if form has been submitted
> if($submit){
>
>if($sort == 'shop')
>  {
>  echo "This item has been taken care of";
>
> // We are selecting user id to insert into the users items.
> $db="SELECT  uid FROM {$config["prefix"]}_users WHERE
> uid={$session["uid"]}";
> $ret = mysql_query($db);
> while(list($db)=mysql_fetch_row($ret))
> { $user = $db;
> echo "Your user ID is $user";
> }
>
>
> echo "You have $quantity of this item and it's id is $iid";
>
>
> }
> // it seems like the first while statement's closing curly bracket should
go
> here but if I put it here I get a pars error.
> }else{
> //if the form has not been submitted run the following
>
>
> ?>
> " METHOD="post">
> 
> 
> Put in my shop
> Put into my Footlocker
> Discard this item
> Donate this item
> 
> 
> 
>  }
> //if I put the first while statement's closing curly bracket here it works
> great except it prints multiple dropdown lists on the page.
>
> I have tried the bracket in numerous places but I can't find the right
spot.
>
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



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




Re: [PHP] using php for keywords

2002-04-12 Thread olinux

Here's a start.

http://www.phpbuilder.com/columns/tim2526.php3

olinux


--- Marc <[EMAIL PROTECTED]> wrote:
> hi
> 
> how can i use php to list keywords in search engines
> ?!?
> how to index a website keywords via php =)
> 
> plz mail
> 
> thx
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP] quotes

2002-04-12 Thread Analysis & Solutions

> From: "Heidi Belal" <[EMAIL PROTECTED]>
On Fri, Apr 12, 2002 at 03:15:13PM -0700, hugh danaher wrote:

> >  > like this.">

> addslashes()
> stripslashes()

Nay.  She's asking about HTML.  Slashes aren't going to solve that.  All 
output from databases, or wherever, needs to go through 
htmlspecialchars().  That'll change " to " so your HTML stay 
healthy.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Closing curly brackets?

2002-04-12 Thread Jennifer Downey

Hi everyone,

I have a question about this code. The way it sits now it always shows the
last record in the table.
in other words if the user has 6 items, like:
item id 1
item id 2
item id 5
item id 6
item id 7
item id 8

it will only show the last record item id 8.

I believe it has something to do with the first while statement's closing
curly bracker
But I can't seem to get it in the right place.

Can someone spot the mistake and show me how to fix it.
see also comments in code.



$id = $HTTP_GET_VARS["id"];


$query = "SELECT id, name, image, quantity, type FROM
{$config["prefix"]}_my_items WHERE uid={$session["uid"]} ORDER BY id";
$ret = mysql_query($query);
 while($row = mysql_fetch_array($ret))
{
$iid = $row['id'];
$image = $row['image'];
$name = $row['name'];
$quantity = $row['quantity'];
$type = $row['type'];


if($iid == $id)
{
$display_block ="$name$quantity$type";
echo "$display_block";
if($type == "food")
//if book or weapon is present then set an option and include in the form
later
{$thisoption="Feed my pet\n";
}else{
//if any other type is present then set a blank
$thisoption="";}
}
}



//check if form has been submitted
if($submit){

   if($sort == 'shop')
 {
 echo "This item has been taken care of";

// We are selecting user id to insert into the users items.
$db="SELECT  uid FROM {$config["prefix"]}_users WHERE
uid={$session["uid"]}";
$ret = mysql_query($db);
while(list($db)=mysql_fetch_row($ret))
{ $user = $db;
echo "Your user ID is $user";
}


echo "You have $quantity of this item and it's id is $iid";


}
// it seems like the first while statement's closing curly bracket should go
here but if I put it here I get a pars error.
}else{
//if the form has not been submitted run the following


?>
" METHOD="post">


Put in my shop
Put into my Footlocker
Discard this item
Donate this item



http://www.grisoft.com).
Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002



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




Re: [PHP] Regilar expressions problem

2002-04-12 Thread Oliver Beddows

On Saturday 13 April 2002 2:13 am, you wrote:
> I have an interactive website, with forums programmed by me.  They have
> smilies, and I'm trying to make a way  for users to be able to type smilies
> without them changing to images if they want.  I'm trying to make it so if
> they type "NOSMILE:)" it will remove the NOSMILE and not display the
> smiley. I use "(NOSMILE){0}:)".  The smiliey still displays if it has
> NOSMILE in front of it.  Any ideas?

Hi,
I think this should work...



Regards,
Oliver

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




Re: [PHP] how to detect error

2002-04-12 Thread Rasmus Lerdorf

Read the chapter on connection handling in the manual.  Basically you need
to register a shutdown function using register_shutdown_function() and
check connection_status() from that.

-Rasmus

On Fri, 12 Apr 2002, Charmaine Tian wrote:

> Hi,
>
> If a PHP script is terminated due to time out (defined by
> max_execution_time) or memory error (memory_limit exceeds), how can I detect
> the error in code?
>
> connection_timeout() is deprecated as of 4.0.5, and connection_status() does
> not return the correct value when time out happens.
>
> Any solutions? Thanks in advance.
>
> --Charmaine
>
>
>
> --
> 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] variable scoping...

2002-04-12 Thread Rasmus Lerdorf

The documentation is outdated.  That restriction has been lifted as of PHP
version 4.0.6.

(cc'ing phpdoc to fix)

-Rasmus

On Fri, 12 Apr 2002, Aric Caley wrote:

> but the virtual() documentation says you can't use it on a php script?
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I guess the only real way is to use virtual() in this case.  That's a bit
> > clunky as well, but it isn't quite as bad as going through CGI or all the
> > way out to the port 80 level.
> >
> > -Rasmus
> >
> > On Fri, 12 Apr 2002, Aric Caley wrote:
> >
> > > Is it possible to keep the variable name-space separate between, say,
> two
> > > files (one included into the other) to avoid name collisions?  I'm
> trying to
> > > get two scripts to work together on the same page.  Each script defines
> some
> > > classes that have the same names but work differently (ex., class
> Template).
> > > All I need is to embed the output of one script into the other.
> > >
> > > Now, I could do this by just getting the output from a URL but that
> seems
> > > really inefficient.  Or I could run the script from the CGI version of
> PHP
> > > using exec() but that also seems like it could be really slow and
> clunky.
> > >
> > > Is there some efficient way of doing this?
> > >
> > > It would be cool if you could just put the include() inside of a
> function
> > > and have all the classes and variable names be local inside that
> function
> > > but that didnt seem to work...  plus the scripts explicitly access
> global
> > > variable names.
> > >
> > >
> > >
> > > --
> > > 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] inclusion of class definitions with unserialize_callback_func in php.ini

2002-04-12 Thread Ian

 i am using the following to try to pull in php classes from separate files
 based on their names using unserialize_callback_func.
 I cant seem to get it
 to work with cgi php 4.1.6 on apache/redhat .
 I notice that it isnt shown under variables available for ini_set() but it
 is shown for unserialize() from which Ive adapted the following script:

ini_set('unserialize_callback_func','thecallback');

function thecallback($classname) {
  echo "calling back";
  $filename="includez/".$classname.".cls.php";
  include($filename);
 }

I would think i'd atleast get an acknowledgement that the function indeed
  fired. Has this feature not yet been implemented?







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




Re: [PHP] variable scoping...

2002-04-12 Thread Aric Caley

but the virtual() documentation says you can't use it on a php script?

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I guess the only real way is to use virtual() in this case.  That's a bit
> clunky as well, but it isn't quite as bad as going through CGI or all the
> way out to the port 80 level.
>
> -Rasmus
>
> On Fri, 12 Apr 2002, Aric Caley wrote:
>
> > Is it possible to keep the variable name-space separate between, say,
two
> > files (one included into the other) to avoid name collisions?  I'm
trying to
> > get two scripts to work together on the same page.  Each script defines
some
> > classes that have the same names but work differently (ex., class
Template).
> > All I need is to embed the output of one script into the other.
> >
> > Now, I could do this by just getting the output from a URL but that
seems
> > really inefficient.  Or I could run the script from the CGI version of
PHP
> > using exec() but that also seems like it could be really slow and
clunky.
> >
> > Is there some efficient way of doing this?
> >
> > It would be cool if you could just put the include() inside of a
function
> > and have all the classes and variable names be local inside that
function
> > but that didnt seem to work...  plus the scripts explicitly access
global
> > variable names.
> >
> >
> >
> > --
> > 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] Re: variable scoping...

2002-04-12 Thread Aric Caley

Believe me, I'm not doing it on purpose.  I'm trying to get two different
script packages to play nice with each other and I want to keep the
modifications at a minumum to make it easier to update the software.
Specificaly I'm talking about a weblog package (phpslash) and forums package
(phpbb), as well as a shopping cart (phpshop), initialy... maybe others as
well.

the class name problem isnt that bad, really.  But there's global variables
as well that need to be isolated.  get/post vars, session vars, etc.

My idea is to isolate each script, pass in the global vars that it expects
to see.  The overall, "parent" script would keep the variables for all the
scripts under different names that dont conflict, converting them on entry
to each script.

"Michael Virnstein" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> why do you have more than one class with the same name?
> would be easier using different names for different classes.
> or define a base class template
> and extend it in the files as desired, but give them unique names.
> how do you know later, which class does what in which way, when they have
> the same
> name. not very good imo.
>
> "Aric Caley" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Is it possible to keep the variable name-space separate between, say,
two
> > files (one included into the other) to avoid name collisions?  I'm
trying
> to
> > get two scripts to work together on the same page.  Each script defines
> some
> > classes that have the same names but work differently (ex., class
> Template).
> > All I need is to embed the output of one script into the other.
> >
> > Now, I could do this by just getting the output from a URL but that
seems
> > really inefficient.  Or I could run the script from the CGI version of
PHP
> > using exec() but that also seems like it could be really slow and
clunky.
> >
> > Is there some efficient way of doing this?
> >
> > It would be cool if you could just put the include() inside of a
function
> > and have all the classes and variable names be local inside that
function
> > but that didnt seem to work...  plus the scripts explicitly access
global
> > variable names.
> >
> >
>
>



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




[PHP] Regilar expressions problem

2002-04-12 Thread Leif K-Brooks

I have an interactive website, with forums programmed by me.  They have
smilies, and I'm trying to make a way  for users to be able to type smilies
without them changing to images if they want.  I'm trying to make it so if
they type "NOSMILE:)" it will remove the NOSMILE and not display the smiley.
I use "(NOSMILE){0}:)".  The smiliey still displays if it has NOSMILE in
front of it.  Any ideas?


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




Re: [PHP] Monitoring a SSL Auth'd page

2002-04-12 Thread Rasmus Lerdorf

See the curl extension.  http://php.net/curl

And as of PHP 4.3 you will be able to open an https page directly with
fopen().

-Rasmus

On Fri, 12 Apr 2002, Ninety-Nine Ways To Die wrote:

> Ok I got a question for you guys and gals, I am not sure how to go about this, 
>looking for opinions.
>
> I am trying to open a secured url, we'll say 
>https://www.bob.com/test/index.php?blah=freak
>
> Also, it's got http-auth in it, say user=abc and password=123, so how would I go 
>about using php to download the page, compare it, then generate a, say, snmp trap 
>based on the findings (say I downloaded the page or have search text in the page), 
>and if it can't get to it, or gets an error, etc... it generates the trap.
> Just curious how I should go about this, fopen doesn't seem to support https, not 
>sure if I could use AUTH with that anyway, but any suggestions are welcome...
>
> -Matt
>
>
> See Dave Matthews Band live or win a signed guitar
> 
>http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp
>
> --
> 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] session_is_registered

2002-04-12 Thread Oliver Beddows

Sorry...I must get some sleep.





Regards,
Oliver


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




[PHP] Re: country ip recognition and php

2002-04-12 Thread Manuel Lemos

Hello,

Nick Wilson wrote:
> What functions do I need to be looking at if I want to determine from
> what country a visitor is from?
> 
> Is this problematical, I look at my logs shows that not all visitors
> form .dk have that at the end of the refferer string...

You may use GetEnv("REMOTE_HOST") to return the user address domain. If
this is not resolved, you may try gethostbyaddr(GetEnv("REMOTE_ADDR")) .

With the domain, you may pick the top level domain (TLD) part just
keeping the domain string after the last dot. If the TLD has 2
characters it is the country code.

If this fails, you may want to resort to a IP address location service
like NetGeo.

If you do not want to reinvent the wheel, you may want to try to use
this ready to use PHP class that does that for you to get not only the
country, but also the location and coordinates (latitude and longitude).

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


Here you may find an application of this class to rank all the countries
from where the users log in this site:

http://www.phpclasses.org/browse.html/statistics/statistics.html#user-countries


An even cooler application of this class is this page for the users to
pick the mirror site that is closer from the user computer network with
distances in Kilometers computed by the same class:

http://www.phpclasses.org/mirrors.html?closest=1

Regards,
Manuel Lemos

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




Re: [PHP] session_is_registered

2002-04-12 Thread Oliver Beddows

On Saturday 13 April 2002 1:19 am, you wrote:
> Sorry it still does not work. Can it be because I have HEADER(Location:
> ...) redirection after the session_registered('var1')?
>
> Regards,
> Norman

Okay,
This worked on my machine, PHP v4.1.2.



Regards,
Oliver

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




Re: [PHP] passing array from one page to itself?

2002-04-12 Thread Richard Baskett

If you are passing it through a posted form, just name your array variable
name[]  So for example:




When it is posted php will realize it's an array and treat it such.

Or if you are just passing it through a link, you can do the same thing..

link

Or you can serialize/deserialize.. Or you could use cookies, sessions, etc
etc etc..

If you give us a little more info on exactly what you are doing we could
probably help you with the best way of doing it :)

Cheers!

Rick

"The greatest trick the devil ever played was convincing the world he didn't
exist." - Unknown

> From: sundogcurt <[EMAIL PROTECTED]>
> Date: Fri, 12 Apr 2002 17:14:14 -0700
> To: GENERAL PHP LIST <[EMAIL PROTECTED]>
> Subject: [PHP] passing array from one page to itself?
> 
> Hi again guys, I'm having trouble finding documentation on passing an
> array. Here is what I am doing.
> 
> I have one page that calls itself, I want to pass an array that is setup
> the first time it's called to itself the second time it's called.
> I'm running out of both time AND hair (both of which are a rare comodoty
> these days).
> 
> Any hint will be a HUGE help!
> 
> Thanks in advance.
> 
> 
> -- 
> 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] passing array from one page to itself?

2002-04-12 Thread sundogcurt

You didn't by any chance go by the name 99ways2die at one time did you?

I thought of that but when the second page loads the values are dumped 
into a db and I have it written already and it uses an array, I would 
like to keep it that way

(Gru)

[EMAIL PROTECTED] wrote:

>You could do something like the following:
>
>$array = array("value1","value2","value3");
>for($i=0;$iecho "";
>}
>--
>
>On Fri, 12 Apr 2002 17:14:14  
> sundogcurt wrote:
>
>>Hi again guys, I'm having trouble finding documentation on passing an 
>>array. Here is what I am doing.
>>
>>I have one page that calls itself, I want to pass an array that is setup 
>>the first time it's called to itself the second time it's called.
>>I'm running out of both time AND hair (both of which are a rare comodoty 
>>these days).
>>
>>Any hint will be a HUGE help!
>>
>>Thanks in advance.
>>
>>
>>-- 
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>See Dave Matthews Band live or win a signed guitar
>http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp
> 
>




[PHP] New to web / PHP development. Please take pity on me.

2002-04-12 Thread Marc Shlaes

I made the simplest program I could to try to figure out why my
session_start() isn't working.

PHPINFO tells me that
1. Sessions are enabled.
2. The path c:/temp is shown so php.ini is doing the right thing

The path exists and can be successfully written to from the OS

The OS is WIN98 running Apache.

What is wrong?/

code 
--


output---
-

Warning: open(/temp/sess_66ae6b55dc3e157c00345e53b72c8a0e, O_RDWR) failed: m
(2) in d:\testsite\test.php on line 2

Session Save Path is: c:/temp



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




Re: [PHP] session_is_registered

2002-04-12 Thread Norman Zhang

Sorry it still does not work. Can it be because I have HEADER(Location: ...)
redirection after the session_registered('var1')?

Regards,
Norman

"Oliver Beddows" <[EMAIL PROTECTED]> wrote in message
20020412235134.QNTP29761.mta05-svc.ntlworld.com@there">news:20020412235134.QNTP29761.mta05-svc.ntlworld.com@there...
On Saturday 13 April 2002 12:01 am, you wrote:
> Hi,
>
> If I have register_globals=off, how do I pass session variables? I tried
> session_register("var1"). session_is_registered("var1") appears
successful,
> but if I tried to echo the $var1". Nothing shows. How do I pass session
> variables?
>
> Thanks,
> Norman

Try this:


Also read the manual for more information on session handling functions.
http://www.php.net/manual/en/ref.session.php

Regards,
Oliver.



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




[PHP] Monitoring a SSL Auth'd page

2002-04-12 Thread Ninety-Nine Ways To Die

Ok I got a question for you guys and gals, I am not sure how to go about this, looking 
for opinions.

I am trying to open a secured url, we'll say 
https://www.bob.com/test/index.php?blah=freak

Also, it's got http-auth in it, say user=abc and password=123, so how would I go about 
using php to download the page, compare it, then generate a, say, snmp trap based on 
the findings (say I downloaded the page or have search text in the page), and if it 
can't get to it, or gets an error, etc... it generates the trap. 
Just curious how I should go about this, fopen doesn't seem to support https, not sure 
if I could use AUTH with that anyway, but any suggestions are welcome...

-Matt


See Dave Matthews Band live or win a signed guitar
http://r.lycos.com/r/bmgfly_mail_dmb/http://win.ipromotions.com/lycos_020201/splash.asp
 

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




[PHP] passing array from one page to itself?

2002-04-12 Thread sundogcurt

Hi again guys, I'm having trouble finding documentation on passing an 
array. Here is what I am doing.

I have one page that calls itself, I want to pass an array that is setup 
the first time it's called to itself the second time it's called.
I'm running out of both time AND hair (both of which are a rare comodoty 
these days).

Any hint will be a HUGE help!

Thanks in advance.


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




[PHP] Re: mysql question --

2002-04-12 Thread Jason Caldwell

Got it figured out --

To export table structure:

C:> mysqldump -d {database name} {tables} >sqltextfile.sql
Then to import the new Table Structure:

To import table structure / data
C:> mysql {database name}  mysqldump -d mydb subscribers >subscribers.sql

** edit the "subscribers.sql" text file and change the following line:
CREATE TABLE subscribers

to

CREATE TABLE subscribers2  (or whatever)

save... then

C:> mysql mydb http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] including class files with unserialize_callback_func

2002-04-12 Thread Ian

i am using the following to try to pull in php classes from separate files
based on their names using unserialize_callback_func.
I cant seem to get it
to work with cgi php 4.1.6 on apache/redhat .
I notice that it isnt shown under variables available for ini_set() but it
is shown for unserialize() from which Ive adapted the following script:

ini_set('unserialize_callback_func','thecallback');

function thecallback($classname) {
 echo "calling back";
 $filename="includez/".$classname.".cls.php";
 include($filename);
}

I would think i'd atleast get an acknowledgement that the function indeed
 fired. Has this feature not yet been implemented?





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




Re: [PHP] session_is_registered

2002-04-12 Thread Oliver Beddows

On Saturday 13 April 2002 12:01 am, you wrote:
> Hi,
>
> If I have register_globals=off, how do I pass session variables? I tried
> session_register("var1"). session_is_registered("var1") appears successful,
> but if I tried to echo the $var1". Nothing shows. How do I pass session
> variables?
>
> Thanks,
> Norman

Try this:


Also read the manual for more information on session handling functions.
http://www.php.net/manual/en/ref.session.php

Regards,
Oliver.

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




[PHP] XHTML tag attribute quoting (Was Re: Forms in PHP)

2002-04-12 Thread Andrew Chase

Are single quotes valid around tag attributes in XHTML?  I skimmed over the
W3C XHTML 1.0 spec before posting the previous message and got the
impression all attributes had to be double quoted.  It would be great if
single quotes were valid, since I've fallen into the habit of using
them for the same exact reason this thread got started... easier to read and
faster to type than \" :)

Oops, and shame on me - tag and attribute names in my previous code snippets
should all be lower case,
too, IE:

echo "$option_text\n";

Of course, a page will render just fine in any modern browser whether tag
attribute values are single or double quoted (or in most cases, even if
they're not quoted at all.)  But if everyone got in the habit of adhering to
standards, and browsers implemented standards correctly (without extending
them with propietary junk), what a nice world it would be. Oh, and world
peace would be great too. :P

Of course, I'm just as guilty of lax coding.  The next time I begin a site
from scratch my plan is to use PSGML mode in emacs, and edit against the
XHTML 1.0 DTD.  Strict? Yes, but clean and compliant :)  (And PSGML does
great code formatting as you go.)

-Andy


> Unfortunately, if you want to maintain XHTML
> : compliance the tag attributes have to be double-quoted too...
> :
> : echo "$option_text\n";
>
> Why stick with quotation marks?
>
>   echo "$option_text\n";>


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




Re: [PHP] Wanting a better understanding of classes in PHP...

2002-04-12 Thread Shu Chow

I recently finished a great book on OO theory called 
Beginning Java Objects by Jacquie Barker.  It's published 
by Wrox.  The book is a Java book and there are Java code 
snippets, but it's OO theories will work for all OO 
languages.  Java is C style coding like PHP, so you 
shouldn't have any problem reading the code.  Still the 
author doesn't presume even basic knowledge of Java.  I 
use this book in my transformation to be a Java developer, 
it's certainly helped me design better PHP apps.

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




[PHP] how to detect error

2002-04-12 Thread Charmaine Tian

Hi,

If a PHP script is terminated due to time out (defined by
max_execution_time) or memory error (memory_limit exceeds), how can I detect
the error in code?

connection_timeout() is deprecated as of 4.0.5, and connection_status() does
not return the correct value when time out happens.

Any solutions? Thanks in advance.

--Charmaine



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




[PHP] PHP 4.0.6 and xsl-transformation

2002-04-12 Thread K. Pihl

Hey PHP-gurus!

How do I run and invoke PHP XSL-parsing and
transformation using PHP version 4.0.6.?

Here is the sample code I want to run.

files included:
  PHP-script
  XML-file and XSL-file:They are formatted nicely
client-side by IE6.0.
  (Please disregard the stupid text in the XML-file,
it is an extract from a database with a lot of test
postings)

When I run the script (post.php) I get an 'empty'
XHTML-document, which is probably the result of
applying the 
XSL-stylesheet(standard.xsl) on the XML-document
(writeout.xml), and getting nothing -> a 'bad'
transformation.

The script doen't display any errors, and the logging
does not seem to work.
Please help.

PS : I didn't do the server setup myself, how can I
check if the XSL-parser is configured correctly?

YT
Karsten Pihl, denmark




__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

');  
define(XMLHEAD, ''."\n".XMLLINK);
define(XMLFILE, "writeout.xml");
define(LOG, 'transform.log');

// ## executing
transform();

// functions
function load($fromFile){
  //returns file $fromFile as string $str
  $fh = fopen($fromFile, "r") or die("Can't open file ".$fromFile);
  $str = fread($fh, filesize($fromFile));
  fclose($fh);
  return $str;
}//load

function save($str, $toFile){
// writes string $str to file $toFile, returns boolean for succes
  $fh = fopen($toFile, "wb") or die("Can't open file ".$toFile);
  $bf = fwrite($fh, $str);
  fclose($fh);
  // 
  if ($bf == -1) return false;
  else return true;
}//save


function transform(){
  // echo 'valid: ', $valid_user; 
  // almindelige brugere må gerne se nyheder
  // filtrerer(parser) xml dokumentet igennem stylesheet'et.
 
  $myxml = load(XMLFILE);
  $mystyle = load(XSL1);
 
  $handle = @xslt_create() or die("Can't create XSLT handle!");
  
  xslt_set_log($handle, true);
  xslt_set_log($handle, getcwd().LOG);

   // $xsltproc = xslt_create();
  
  // create processer handle 
  
  echo $handle;

  // do transformation
  $result = xslt_process($handle, $myxml, $myxsl);
  // echo $out; 
  // echo 'res', $result;
  if ($result){
echo $result; 
// pre($result);
$res = $result;
  }
  else{ 
   $res = "error occurred during transformation : ".xslt_error($handle); 
   $res.= " with error code: ".xslt_errorno($handle); 
  }
  // Free ressources
  @xslt_free($handle);
  return $res;
} // transform;


?>





7/4/2002
22:48
Sunday
comment
Sunday evening is quit

30/3/2002
13:47
Sunday
weather
The weather is beutifull today

4/4/2002
18:45
Thursday
comment
Databasesystems

4/4/2002
18:46
Monday
comment
Advanced Object-oriented programming.
A very interesting subject

4/4/2002
18:46
Thuesday
calender
At tuesdays: webprogramming

30/3/2002
13:52
Saturday
comment
I am happy today.

4/4/2002
20:25
Sunday
comment
Sunday evening is quit yes yes yes yes





http://www.w3.org/1999/XSL/Transform"; xmlns="http://www.w3.org/1999/xhtml";>
  


  
  My news
  

  
  



 
 
   

   
   

   
   
 
   
  
  
  
  

 











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


[PHP] session_is_registered

2002-04-12 Thread Norman Zhang

Hi,

If I have register_globals=off, how do I pass session variables? I tried
session_register("var1"). session_is_registered("var1") appears successful,
but if I tried to echo the $var1". Nothing shows. How do I pass session
variables?

Thanks,
Norman



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




Re: [PHP] HTML form element

2002-04-12 Thread Chris Wesley

Name your select element "majors[]" and when the form is submitted, your
form handler will get an array, not a scalar, called $majors.  Step
through the array, and you'll get all the options that were selected.

~Chris /"\
   \ / Microsoft Security Specialist:
X  The moron in Oxymoron.
   / \ http://www.thebackrow.net

On Fri, 12 Apr 2002, Brian McLaughlin wrote:

> I have a tag like this on a php-generated web page.
>
> 
>   Art
>   Biology
>   Business and Economics"
>etc.
>etc.
> 
>
> My question is...  since this is a multiple-select list, in the php script
> that this form calls on a submit, how do I determine which options have been
> selected?  If I look at $majors, it is a string whose value is one of the
> several options that were selected.


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




[PHP] Re: HTML form element

2002-04-12 Thread Julio Nobrega


  Art
  Biology
  Business and Economics"
   etc.
   etc.


  Note the [] after majors. Now majors is an array with the selected values.

--
Julio Nobrega.

Tô chegando:
http://www.inerciasensorial.com.br
"Brian McLaughlin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all.
>
> I have a tag like this on a php-generated web page.
>
> 
>   Art
>   Biology
>   Business and Economics"
>etc.
>etc.
> 
>
> My question is...  since this is a multiple-select list, in the php script
> that this form calls on a submit, how do I determine which options have
been
> selected?  If I look at $majors, it is a string whose value is one of the
> several options that were selected.
>
> Thanks,
>
> Brian
>
>



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




[PHP] HTML form element

2002-04-12 Thread Brian McLaughlin

Hi all.

I have a tag like this on a php-generated web page.


  Art
  Biology
  Business and Economics"
   etc.
   etc.


My question is...  since this is a multiple-select list, in the php script
that this form calls on a submit, how do I determine which options have been
selected?  If I look at $majors, it is a string whose value is one of the
several options that were selected.

Thanks,

Brian



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




Re: [PHP] quotes

2002-04-12 Thread hugh danaher

Heidi,

to your input:
addslashes()
to your output:
stripslashes()

Hope this helps,
Hugh
- Original Message -
From: "Heidi Belal" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>; "Egypt Developers"
<[EMAIL PROTECTED]>; "Egypt Programmers"
<[EMAIL PROTECTED]>; "js-jive mailing list"
<[EMAIL PROTECTED]>; "Php" <[EMAIL PROTECTED]>
Sent: Friday, April 12, 2002 3:06 PM
Subject: [PHP] quotes


> Dear All,
> I'm facing a problem and can't figure out the solution
> and would love anyones help.
> the situation is this:
> i have a form for users to fill, i take their entry
> and enter it in the database, then i take it and
> display it in a form so they can edit it.
> the problem is this:
> if uses enter double quotes my html gets mixed up and
> considers the users quote to be the end of the output
> value for the input field.
> Example:
>
> 
>
> 
> myvalue is a variable which is read from the DB and
> contains a double quote now if
> myvalue = this is a double quote " like this.
>
> the output html will look like this:
>  like this.">
>
> and the output like this:
> this is a double quote
>
> and that's it..cause it took the double quote as the
> end of the value field.
>
> now what do i do?  how can i prevent that from
> happing?
> Thanks,
>
>
>
> =
> Heidi Belal
> www.code-corner.com
> ICQ# 32127109
>
> A bus stops at a bus station.
> A train stops at a train station.  On my desk
> I have a work station...
>
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] quotes

2002-04-12 Thread Erik Price


On Friday, April 12, 2002, at 06:06  PM, Heidi Belal wrote:

> if uses enter double quotes my html gets mixed up and
> considers the users quote to be the end of the output
> value for the input field.

...

> now what do i do?  how can i prevent that from
> happing?

As a rule of thumb, you should never ever cross-post to so many 
newsgroups or mailing lists!  Just asking here on the PHP list alone 
will get you the answer to this question.

That said, the PHP developers have created a function that can escape 
the quotes for you -- it is called "addslashes()".  Read the man pages 
for addslashes() and stripslashes() at www.php.net for information on 
their usage.

You may also be able to set the gpc_magic_quotes setting in your php.ini 
on your server, but using addslashes() and stripslashes() allows you to 
fine-tune your control.


Erik







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] Re: alphabetizing titles when first word begins with 'The','A',etc.

2002-04-12 Thread Julio Nobrega

  I would go with this. If there's a title like:

"A title begins with a vowel".

  I guess it's better to store:

"title begins with a vowel, A".

  Now how to transform INSERT-SELECT to a temp table where you will
format, delete the original's records, and INSERT-SELECT from temp to
original...

--
Julio Nobrega.

Tô chegando:
http://www.inerciasensorial.com.br
"Analysis & Solutions" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > On Wed, 12 Apr 2000, Steph wrote:
> >
> > > Hi. Im using MySQL and as part of my tables I have titles (of
stories). My
> > > question os in regards to outputing those titles. Some of the titles
begin
> > > with words such as 'The', 'A', 'An', etc. Is there a way to order
these
> > > particular titles based on the second word in the title??
>
> Why not do what libraries do.  Store the data correctly in the first
> place?
>
> --Dan
>
> --
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409



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




[PHP] quotes

2002-04-12 Thread Heidi Belal

Dear All,
I'm facing a problem and can't figure out the solution
and would love anyones help.
the situation is this:
i have a form for users to fill, i take their entry
and enter it in the database, then i take it and
display it in a form so they can edit it.
the problem is this:
if uses enter double quotes my html gets mixed up and
considers the users quote to be the end of the output
value for the input field. 
Example:


   

myvalue is a variable which is read from the DB and
contains a double quote now if 
myvalue = this is a double quote " like this.

the output html will look like this:


and the output like this:
this is a double quote

and that's it..cause it took the double quote as the
end of the value field.

now what do i do?  how can i prevent that from
happing?
Thanks,



=
Heidi Belal
www.code-corner.com
ICQ# 32127109

A bus stops at a bus station.
A train stops at a train station.  On my desk
I have a work station...

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP] update entries in a table

2002-04-12 Thread Norman Zhang

Thank you so much.

Norman




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




Re: [PHP] update entries in a table

2002-04-12 Thread Erik Price


On Friday, April 12, 2002, at 05:35  PM, Erik Price wrote:

>> How do I update entries in MySQL? Say for example, I checked some 
>> fields to
>> a table, and decided to make update to a particular field. How do I do 
>> that
>> in PHP?
>
> // $db = database connection handler
> $update_sql = "UPDATE tablename SET tablename.columname = '$value'";
>
> if (!mysql_query($update_sql, $db)) {
>   die("Could not process update SQL query");
> }
>

Of course, as an afterthought, you might want to qualify that with a 
WHERE clause, lest you update every row of your table...


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] update entries in a table

2002-04-12 Thread Erik Price


On Friday, April 12, 2002, at 05:23  PM, Norman Zhang wrote:

> How do I update entries in MySQL? Say for example, I checked some 
> fields to
> a table, and decided to make update to a particular field. How do I do 
> that
> in PHP?

// $db = database connection handler
$update_sql = "UPDATE tablename SET tablename.columname = '$value'";

if (!mysql_query($update_sql, $db)) {
die("Could not process update SQL query");
}

Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] update entries in a table

2002-04-12 Thread Richard Baskett

Take a look at:

http://www.mysql.com/doc/U/P/UPDATE.html

It'll have everything you'll ever want to know about UPDATE :)

Rick

"There is no such thing as a sudden heart-attack. It takes years of
preparation." - Unknown

> From: "Norman Zhang" <[EMAIL PROTECTED]>
> Date: Fri, 12 Apr 2002 14:23:28 -0700
> To: [EMAIL PROTECTED]
> Subject: [PHP] update entries in a table
> 
> Hi,
> 
> How do I update entries in MySQL? Say for example, I checked some fields to
> a table, and decided to make update to a particular field. How do I do that
> in PHP?
> 
> Regards,
> Norman
> 
> 
> 
> -- 
> 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] update entries in a table

2002-04-12 Thread Norman Zhang

Hi,

How do I update entries in MySQL? Say for example, I checked some fields to
a table, and decided to make update to a particular field. How do I do that
in PHP?

Regards,
Norman



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




[PHP] mysql question --

2002-04-12 Thread Jason Caldwell

does anyone know how to copy a tables structure (only) within mysql?

thanks.
jason



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




Re: [PHP] IMPORTANT question for anyone using XSLT

2002-04-12 Thread Erik Price


On Friday, April 12, 2002, at 04:42  PM, Jeff Levy wrote:

> Have you considered using sablotron's Excellent Named Buffer support?

No, and it is perhaps due to my lack of familiarity with XSLT, but I'm 
not sure how to use this technique... even with the example you've 
provided.  I haven't actually found a general PHP->XSLT reference (for 
instance, the PHP man pages on a lot of the XSLT functions seem 
unfinished).  Do you know of a resource I can go to learn more?

Thanks,

Erik

> I do this all the time.
>
> ie: $addl_buffers['MySecondBuffer'] = " version='1.0'?>Blah"
> $addl_buffers['MyThirdArbitraryBuffer'] = ... etc etc etc...
>
> then, in stylesheet, for instance:
>
>  select="document('arg:/MySecondBuffer')/MyNode"/>
>
> etc, etc.






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] IMPORTANT question for anyone using XSLT

2002-04-12 Thread Jeff Levy

Have you considered using sablotron's Excellent Named Buffer support?

I do this all the time.

ie: $addl_buffers['MySecondBuffer'] = "Blah"
$addl_buffers['MyThirdArbitraryBuffer'] = ... etc etc etc...

then, in stylesheet, for instance:



etc, etc.

On Mon, 01 Apr 2002 11:08:12 -0500, Erik Price wrote:


> On Friday, March 29, 2002, at 01:56  PM, Erik Price wrote:
> 


> 
> 
> Much thanks to Sean Scanlon for showing me how to create HTML attributes
> from XML with XSLT.
> 
> 
> 
> Erik
> 
> 
> 
> 
> 
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
> 
>> From: Erik Price <[EMAIL PROTECTED]> Date: Fri Mar 29, 2002  01:56:55
>> PM US/Eastern To: [EMAIL PROTECTED] Subject: [PHP] IMPORTANT
>> question for anyone using XSLT
>>
>> My, there have been a lot of questions about XSLT in the past 24 hrs...
>> admittedly most of them coming from me.  In addition to my first
>> question (repeated below for clarity), I have a second one -- how do I
>> perform an XSLT transformation on multiple XML documents?  Do I need to
>> perform a separate XSLT transformation on each one?  The reason I ask
>> is b/c I am pulling my XML from a DB, so there may be more than one
>> based on the results from the query.  If anyone can answer this, that'd
>> be great.
>>
>> If not, perhaps you can help with this situation, which I believe will
>> probably plague just about any PHP programmer who will ever use XSLT
>> with PHP (or possibly any other language):
>>
>> I am still unsure of the best way to mix PHP & [X]HTML together in an
>> XSLT stylesheet, because regardless of whether you specify the output
>> method as "text" or "xml", if you are using HTML tags they must be
>> well-formed, because Sablotron or expat (not sure which) will want the
>> XSLT stylesheet to be a well-formed document.  Only, we often interrupt
>> our HTML code when using PHP, like this:
>>
>> $output_to_browser = "Go"; $output_to_browser .=
>> "home";
>>
>> (of course, the output to the browser will by a hyperlink to index.php
>> that says "Go home".)
>>
>> The above looks fine as PHP code, but if you try to manipulate the data
>> from an XSLT process in this fashion, you won't be able to use HTML
>> tags -- the greater-than and less-than symbols can't be used, since an
>> XSLT sheet is technically an XML document and these are not well-formed
>> tags.  In the XSLT sheet, the above might look like:
>>
>> 
>>  ">Go Home
>> 
>>
>> I thought that perhaps if I specified text as the output method, then
>> the greater-than and less-than signs wouldn't be parsed, so I could use
>> them as such:
>>
>> 
>>
>> 
>>  
>>
>>  
>>">Go Home
>>  
>> 
>>
>> See what's happening in the above?  I thought I had "escaped" my 
>> tags by placing them within the  tags, but this is not so --
>> they are parsed, and the document is then interpreted as not being
>> well-formed.
>>
>>
>> So unless you want to do a straight XML-to-XML or XML-to-XHTML
>> transformation, OR you don't want to use ANY XML or XHTML tags in your
>> output document, you're kind of up a river.  Unless someone on this
>> list can help me find a way to "escape" the HTML tags when creating PHP
>> code.
>>
>> And the only way I can think of doing it (which I still haven't tested,
>> but might have to use) is to use variables to represent the HTML tags
>> so that instead of
>>
>> Go Home
>>
>> I could use
>>
>> $astartag = "Go Home";
>>
>> and then make the style sheet like this:
>>
>> 
>>
>> 
>>  
>>$astartag
>>  
>> 
>>  
>>$aendtag
>>  
>> 
>>
>>
>> That should work in theory.  But it's incredibly crude.
>>
>>
>> What do you all think?
>>
>>
>>
>>
>>
>> Erik
>>
>>
>>
>>
>>
>>
>>
>> 
>>
>> Erik Price
>> Web Developer Temp
>> Media Lab, H.H. Brown
>> [EMAIL PROTECTED]
>>
>>
>> -- PHP General Mailing List (http://www.php.net/) To unsubscribe,
>> visit: http://www.php.net/unsub.php
>>
>>

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




Re: [PHP] embedd avi into page?

2002-04-12 Thread Erik Price


On Friday, April 12, 2002, at 03:00  PM, Hawk wrote:

> maybe this is not a php question but I thought I might ask here to, 
> since
> someone might know..¥
>
> is it possible to make a avi movie play inside an explorer window?
> I just get it to open up in windows media player..

Nope, not a PHP question.





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] embedd avi into page?

2002-04-12 Thread Hawk

maybe this is not a php question but I thought I might ask here to, since
someone might know..´

is it possible to make a avi movie play inside an explorer window?
I just get it to open up in windows media player..



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




[PHP] Re: passed val compare to array val

2002-04-12 Thread Joel Colombo


"Sundogcurt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi guys, like every other problem I have this one is SURE to be
> painfully simple to fix and make me look g0ofy again.
>
> I have an edit user form with checkboxes like the one below :
>
>  >
>
> When the form loads I grab the users relevant information and display
> it, I am having trouble checking checkboxes that should be checked
> though. Here is how I am attempting to do it.
>
> Prior to the form loading I load an array with the required checkbox
> VALUES, not names, I did it this way because I reference the checkbox
> values as an array to write to a database.
>
> As the form loads I call a function "docheck()" and pass $inputvalue
> (the value of the checkbox) compare the values pulled from the database
> and if there is a match, I write "CHECKED" to indicate that the user had
> previously chosen this.
>
> The function is below :
>

*
right here..
u need to pass that array of activity to the function too its not
global.

> function docheck($inputvalue){
> $flag = 0;
> $tempcnt = 0;
> $temptotal = count($editActivity);
> while($tempcnt != $temptotal){
> if($inputvalue == $editActivity[$tempcnt]){
> $flag = 1;
> }
> $tempcnt++;
> }
> if($flag == 1){
> print "CHECKED";
> }
> }
>
> The problem seems to be that a "match" never occurs, I tried passing
> "Boating" and re-wrote the function as such...
>
> $flag = 0;
> if($inputvalue == 'Boating'){
> $flag = 1;
> }
> if($flag == 1){
> print "CHECKED";
> }
>
>
> and it worked just fine, so I am of a mind that I am doing something
> wrong while attempting to match my passed value with the values in my
> array.
>
> Please help!
>
> --
> Curtis Gordon
> Groovy Web Developer
>  168th Street
> White Rock
>



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




[PHP] Using php_auto_prepend With Cgi Files

2002-04-12 Thread Shaun Martinec

Is is possible to use php_auto_prepend and php_auto_append with .cgi files
located in the cgi-bin? I wanted to wrap a header and footer around a few
files. I am specifying the config directives in the .htaccess file.
AllowOverride All is on in the httpd.conf. Anyone have any ideas?

-Shaun



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




[PHP] passed val compare to array val

2002-04-12 Thread sundogcurt

Hi guys, like every other problem I have this one is SURE to be 
painfully simple to fix and make me look g0ofy again.

I have an edit user form with checkboxes like the one below :

>

When the form loads I grab the users relevant information and display 
it, I am having trouble checking checkboxes that should be checked 
though. Here is how I am attempting to do it.

Prior to the form loading I load an array with the required checkbox 
VALUES, not names, I did it this way because I reference the checkbox 
values as an array to write to a database.

As the form loads I call a function "docheck()" and pass $inputvalue 
(the value of the checkbox) compare the values pulled from the database 
and if there is a match, I write "CHECKED" to indicate that the user had 
previously chosen this.

The function is below :

function docheck($inputvalue){
$flag = 0;
$tempcnt = 0;
$temptotal = count($editActivity);
while($tempcnt != $temptotal){
if($inputvalue == $editActivity[$tempcnt]){
$flag = 1;
}
$tempcnt++;
}
if($flag == 1){
print "CHECKED";
}
}

The problem seems to be that a "match" never occurs, I tried passing 
"Boating" and re-wrote the function as such...

$flag = 0;
if($inputvalue == 'Boating'){
$flag = 1;
}
if($flag == 1){
print "CHECKED";
}


and it worked just fine, so I am of a mind that I am doing something 
wrong while attempting to match my passed value with the values in my 
array.

Please help!

-- 
Curtis Gordon
Groovy Web Developer
 168th Street
White Rock


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




[PHP] Local Test | Different folder - Help!! (part2)

2002-04-12 Thread Tiago Simões

For those that haven't read my previous posts, i'm trying to be able to test
locally my php site. My installation (both apache and php) went smoothly.
But instead of using the htdocs folder for the test i wanted to use the
c:\website folder. So with some help from you guys i manage to configure the
httpd.conf file (in the conf Apache subfolder) like this:

#this is the bottom part of the conf file


DocumentRoot "C:\website"
ServerName website.localhost



AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
#Next line is optional (for viewing source)
AddType application/x-httpd-php-source .phps



and in the hosts.sam file in the C:\Windows\

127.0.0.1   localhost
127.0.0.1   website.localhost

It "sounds good to me. So why it doesn't work? Any ideas?






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




Re: [PHP] Wanting a better understanding of classes in PHP...

2002-04-12 Thread Steve Cayford

Well, start here probably:

http://www.php.net/manual/en/language.oop.php

-Steve

On Friday, April 12, 2002, at 12:50  PM, Chuck "PUP" Payne wrote:

> Hi, I was up on freshmeat and I saw a TON of php classes. I like to 
> know how
> can I use them? And is a class a bit of code that you are always using? 
> If
> so, how can I create my own classes.
>
> Chuck "PUP" Payne
> Sr. System Administrator
> GDI Engineering, Inc.
> 2075-E West Park Place Blvd.
> Stone Mountain, GA 30087
> ---
> (678) 476-0747 ext. 18 (Phone)
> (770) 498-1590 (Fax)
> (404) 451-3579 (Mobile)
> (800) 631-1371 (Alpha Page)
> [EMAIL PROTECTED]  (Text Pager)
> [EMAIL PROTECTED] (E-Mail)
> ---
> http://www.gdieng.com
> http://www.gditelecommunication.com
> http://www.softmeta.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Wanting a better understanding of classes in PHP...

2002-04-12 Thread Erik Price




On Friday, April 12, 2002, at 01:49  PM, Chuck "PUP" Payne wrote:

> Hi, I was up on freshmeat and I saw a TON of php classes. I like to 
> know how
> can I use them? And is a class a bit of code that you are always using? 
> If
> so, how can I create my own classes.

A class is a definition for an object.  You can use classes with PHP to 
write object-oriented code.  But each class has its own interface, so I 
couldn't tell you how to use all classes -- and you can of course write 
your own, which you will no doubt do if you learn how to use PHP's 
object-oriented features.

If you are already comfortable with object-oriented programming, all you 
have to do is read the object-oriented programming pages in the PHP 
manual:  http://www.php.net/manual/en/language.oop.php

If you have never used object-oriented programming, it's not that hard, 
but you should have a better introduction to the theory.  I haven't seen 
many good introductions to OOP for PHP, but the theory applies to all 
object-oriented programming languages.  I am reading Bruce Eckels' 
online book "Thinking in Java", and have found that it's got a good 
introduction to the theory.

I've attached the first chapter of the book (in HTML) to this message -- 
you will get it, but the list won't since the mailing list doesn't 
forward attachments.  If you're interested, the book is freely available 
at http://www.mindview.com .

Once you've read a bit more about it, read the PHP manual pages on OOP 
and try it out.


Erik




Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] How to sort by 3rd row in an 2d-Array

2002-04-12 Thread Steve Cayford

Or try the usort() function?



-Steve

On Friday, April 12, 2002, at 12:26  PM, Kevin Stone wrote:

> This is a terribly inneficient way of handling your situation but I 
> believe
> it would work.
>
> // First we're going to make a list of all company values
> for($i=0; $i {
> $company_values[] = $myarray[$i][company];
> }
>
> // Then we're going to order the array using a standard function.
> natsort($company_values);
>
> // Then we're going to go through $myarray  looking for each matching
> // value and build a new array based on the order of the sorted list.
> for($i=0; $i {
> for ($j=0; $j= {
> if ($company_values[$i] == $myarray[$j][company])
> {
> $mynewarray[] = $myarray[$j];
> }
> }
> }
>
> // bada bing bada boom you gots your company sorted list... I think
> $myarray = $mynewarray;
>
> I wrote this off the top of my head in like three minutes so any and all
> corrections would be most welcome.  ;)
> -Kevin
>
> - Original Message -
> From: "SED" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 12, 2002 10:25 AM
> Subject: [PHP] How to sort by 3rd row in an 2d-Array
>
>
>> Hi,
>>
>> I'm trying to sort an array like following
>>
>> myArray[1][firstname] = "Joe";
>> myArray[1][lastname] = "Smith";
>> myArray[1][company] = "Bullock";
>> myArray[1][email] = "[EMAIL PROTECTED]";
>> myArray[2][firstname] = "Jim";
>> myArray[2][lastname] = "Cords";
>> myArray[2][company] = "Jamen";
>> myArray[2][email] = "[EMAIL PROTECTED]";
>> etc...
>>
>> by the company name. How can I do it?
>>
>> I found the solution on php.net
>> (http://www.php.net/manual/en/function.array-multisort.php) but it 
>> sorts
>> only the first row:
>>
>> foreach ($myArray as $val) {
>> $sortarray[] = $val['nafn'];
>> echo $val['stadur'];
>> }
>> array_multisort($myArray, $sortarray);
>>
>> Thanks in advance!
>>
>> SED
>>
>>
>> --
>> 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] Wanting a better understanding of classes in PHP...

2002-04-12 Thread Chuck \"PUP\" Payne

Hi, I was up on freshmeat and I saw a TON of php classes. I like to know how
can I use them? And is a class a bit of code that you are always using? If
so, how can I create my own classes.

Chuck "PUP" Payne
Sr. System Administrator
GDI Engineering, Inc.
2075-E West Park Place Blvd.
Stone Mountain, GA 30087
---
(678) 476-0747 ext. 18 (Phone)
(770) 498-1590 (Fax)
(404) 451-3579 (Mobile)
(800) 631-1371 (Alpha Page)
[EMAIL PROTECTED]  (Text Pager)
[EMAIL PROTECTED] (E-Mail)
---
http://www.gdieng.com
http://www.gditelecommunication.com
http://www.softmeta.com



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




[PHP] Wanting a better understanding of classes in PHP...

2002-04-12 Thread Chuck \"PUP\" Payne

Hi, I was up on freshmeat and I saw a TON of php classes. I like to know how
can I use them? And is a class a bit of code that you are always using? If
so, how can I create my own classes.

Chuck "PUP" Payne
Sr. System Administrator
GDI Engineering, Inc.
2075-E West Park Place Blvd.
Stone Mountain, GA 30087
---
(678) 476-0747 ext. 18 (Phone)
(770) 498-1590 (Fax)
(404) 451-3579 (Mobile)
(800) 631-1371 (Alpha Page)
[EMAIL PROTECTED]  (Text Pager)
[EMAIL PROTECTED] (E-Mail)
---
http://www.gdieng.com
http://www.gditelecommunication.com
http://www.softmeta.com



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




Re: [PHP] How to sort by 3rd row in an 2d-Array

2002-04-12 Thread Kevin Stone

This is a terribly inneficient way of handling your situation but I believe
it would work.

// First we're going to make a list of all company values
for($i=0; $i
To: <[EMAIL PROTECTED]>
Sent: Friday, April 12, 2002 10:25 AM
Subject: [PHP] How to sort by 3rd row in an 2d-Array


> Hi,
>
> I'm trying to sort an array like following
>
> myArray[1][firstname] = "Joe";
> myArray[1][lastname] = "Smith";
> myArray[1][company] = "Bullock";
> myArray[1][email] = "[EMAIL PROTECTED]";
> myArray[2][firstname] = "Jim";
> myArray[2][lastname] = "Cords";
> myArray[2][company] = "Jamen";
> myArray[2][email] = "[EMAIL PROTECTED]";
> etc...
>
> by the company name. How can I do it?
>
> I found the solution on php.net
> (http://www.php.net/manual/en/function.array-multisort.php) but it sorts
> only the first row:
>
> foreach ($myArray as $val) {
> $sortarray[] = $val['nafn'];
> echo $val['stadur'];
> }
> array_multisort($myArray, $sortarray);
>
> Thanks in advance!
>
> SED
>
>
> --
> 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] register_globals

2002-04-12 Thread Michal Dvoracek

Hello,

in php 4.0.6 on the begin of the script include file called config.php.
In config file i have ini_set('register_globals', 'off');
i setup session via session_register('variable') and redirect to
another page, where i include the same config (config.php) and call
session_start(); but when i make print_r($HTTP_SESSION_VARS); array is
empty. When i disable line with ini_set in config file all is ok.

It's bug ?

I must using two versions of PHP 4.0.6 and 4.1.2. On 4.1.2 is
everything OK but on 4.0.6 not. So where is problem ? In myself or
between keyboard and chair (that's myself too :))

Regards
Michal Dvoracek  [EMAIL PROTECTED]


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




[PHP] DATES in DIFFERENT LANGUAGES

2002-04-12 Thread Declan Kenny

Hi all,

Is it possible to get dates in different languages
i.e. date ("j F") would usually return, in the case, 13 April can I make it
display the date in French for example??

Thanks
Declan



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




Re: [PHP] Re: Forms in PHP

2002-04-12 Thread Eugene Lee

On Fri, Apr 12, 2002 at 09:36:42AM -0700, Andrew Chase wrote:
: 
: foreach(array_keys($menu_options) as $option_value){
:   $option_text = $menu_options[$option_value];
:   echo '$option_text';
: }
: 
: would just output
: 
: $option_text
: $option_text
: $option_text
: 
: which is probably not the desired output :)  You need to use double quotes
: for variable substitution. Unfortunately, if you want to maintain XHTML
: compliance the tag attributes have to be double-quoted too...
: 
: echo "$option_text\n";

Why stick with quotation marks?

echo "$option_text\n";


-- 
Eugene Lee
[EMAIL PROTECTED]

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




RE: [PHP] Re: Forms in PHP

2002-04-12 Thread Andrew Chase

>May I also suggest that you rewrite your echo statements as:
>
>  echo 'Donate this item';
>
>Vastly improves legibility.

It's a problem, however, if you want to include a PHP variable in that echo
statement, if you're populating a SELECT menu with a loop, for instance;

$menu_options = array("A" => "Option 1", "B" => "Option 2", "C" => "Option
3");

foreach(array_keys($menu_options) as $option_value){

  $option_text = $menu_options[$option_value];

  echo '$option_text';

}

would just output

$option_text
$option_text
$option_text

which is probably not the desired output :)  You need to use double quotes
for variable substitution. Unfortunately, if you want to maintain XHTML
compliance the tag attributes have to be double-quoted too...

echo "$option_text\n";

(Might as well add a "\n" at the end of the line for readability in the
browser's 'View Source' window!)


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




[PHP] How to sort by 3rd row in an 2d-Array

2002-04-12 Thread SED

Hi,

I'm trying to sort an array like following

myArray[1][firstname] = "Joe";
myArray[1][lastname] = "Smith";
myArray[1][company] = "Bullock";
myArray[1][email] = "[EMAIL PROTECTED]";
myArray[2][firstname] = "Jim";
myArray[2][lastname] = "Cords";
myArray[2][company] = "Jamen";
myArray[2][email] = "[EMAIL PROTECTED]";
etc...

by the company name. How can I do it?

I found the solution on php.net
(http://www.php.net/manual/en/function.array-multisort.php) but it sorts
only the first row:

foreach ($myArray as $val) {
$sortarray[] = $val['nafn'];
echo $val['stadur'];
}
array_multisort($myArray, $sortarray);

Thanks in advance!

SED


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




[PHP] Re: Using Google's new SOAP based API in PHP

2002-04-12 Thread Simon Willison

Stefen Lars wrote:
> Hello all
> 
> CodingTheWeb.com has several reports of Google's new SOAP based 
> application programming interface:
> 
> http://www.codingtheweb.com/projects/newslog/index.php?filter=Google
> 
> Has anyone tries using this in PHP yet???

Yup - http://toys.incutio.com/php/php-google-web-api.html


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




Re: [PHP] Different directory/test locally

2002-04-12 Thread heinisch

At 12.04.2002  14:48, you wrote:
>Hello.
>
>I still can't manage to test locally the pages in my notebook, without using
>the htdocs directory. As i told you, i managed to install the all the stuff
>correctly, made my first test with a php script in the htdocs Apache
>instalation folder, but when  i tried to put that new directory path in the
>httpd.conf file i couldn't see the php script on the designated folder. I
>know that in the other case i had to access via http://localhost/test.php
>path. How do i test a page that is, let's say, in the c:\website\ folder?
>(after i configured its path in httpd.conf file, of course)
>
>i know that i should put something like this in the httpd.conf file
>
>
>AddType application/x-httpd-php .php .phtml .php3
>#Next line is optional (for viewing source)
>AddType application/x-httpd-php-source .phps
>
>
>but after that, what path i put in the browser?
Following Information may not work under WIN*. Probably you should ask
this question on the window-list, but maybe something works equal to WIN
Set up a local DNS-server, (I think it could be emulated by 
c:/windows/hosts.sam)
her you add your new domainname f.e. "iww.foo.com"
in httpd.conf add a new

DocumentRoot c:/myfiles/foocomfiles
Servername iww.foo.com

and something like:

Options Indexes FollowSymLinks
AllowOverride Limit

after restarting apache, the new virtual server should be available ??
HTH Oliver


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




[PHP] PHP --with-java problem

2002-04-12 Thread Dmitri Zakharov

I am trying to configue PHP with Java support.
with PHP-4.1.2, JDK1.3.1_01

The installation goes smoothly. My php.ini file 
contains the follwing section for Java



[Java]
java.class.path = /usr/local/src/php-4.1.2/ext/java/php_java.jar
java.home = /usr/local/jdk1.3.1_01
java.library = /usr/local/jdk1.3.1_01/jre/lib/i386/server/libjvm.so
;java.library.path = .\
extension_dir = /usr/lib/php4
extension = libphp_java.so



phpinfo() function output shows me Java section OK.
BUT, when I run a simple example from 'ext/java/jver.php'
(available with PHP distribution), Netscape gives me an 
error box with a message:

"The document contained no data.
Try again later or contact the server's administrator."

Here's the code for jver.php I'm trying to run:


test

Java Test
Java Test
  $system = new Java("java.lang.System");
  print "Java version=".$system->getProperty("java.version")." \n";
  print "Java vendor=".$system->getProperty("java.vendor")." \n\n";
  print "OS=".$system->getProperty("os.name")." ".
  $system->getProperty("os.version")." on ".
  $system->getProperty("os.arch")." \n";

  $formatter = new Java("java.text.SimpleDateFormat",
",  dd,  'at' h:mm:ss a ");

  print $formatter->format(new Java("java.util.Date"))."\n";
// - */

?>



Obviously, there's somthing still wrong with PHP/Java configuration
Anybody has the same problem?  Any suggestions?

Any help is appreciated,
Thanks

-- 
zakd

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




RE: [PHP] Re: Assigning the contents of a file to a variable

2002-04-12 Thread Edward R. Bailey

Thanks for helping a newbie out - fread() worked perfectly:)

Ed

> -Original Message-
> From: CC Zona [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, April 11, 2002 5:21 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Assigning the contents of a file to a variable
> 
> 
> In article <00bc01c1e131$7a7bb7e0$[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Edward R. Bailey) wrote:
> 
> >  I want to assign the contents of a separate file (a web page) to
> >  $message instead of inserting the contents of the file as 
> a string in 
> >  the actual script. I want the body of the email to come 
> from a separate 
> >  file to help make changing the body of the email easier 
> too. I tried 
> >  using - 
> > 
> > readfile("includes/news.html")
> > 
> > But that did not work and instead inserted file into the actual 
> > webpage
> > instead of the email.
> > 
> > Does anyone have an idea or suggestion?
> 
 or 

-- 
CC

-- 
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] Differences in old php/apach. to new php/apach. cookie process?

2002-04-12 Thread heinisch

Hi Folks,
Does anybody know if there are differences in cookieprocessing
between
A.Suse 2.2.14-SMP/apache 1.3.12 / PHP 3.0.16 and
B.Suse  2.4.9 /apache 1.3.20 / PHP 4.0.6
I have moved "working pages" from A to B, and now (Win)Opera 6.01
will not accept cookies from the, formerly working, pages. I have 
CookieTracking on
on both machines. The apache-cookie is sent and set from both machines.
But my php-routines (which sends the fitting cookie to the dif. browsers)
work different.
Someone had same problems?
Maybe I forgot something in httpd.conf on B ?
Any suggestions?

TIA Oliver



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




Re: [PHP] Posting with script tags, or a plea not to

2002-04-12 Thread Mike Gohlke

Barry C. Hawkins wrote:
Barry & Rasmus (you already figured this out, I'm sure),
That's the problem, it's there but the browser is ignoring the  tag 
as unknown (just as it should).  The only way Earthlink can fix that is 
to do an inline change of < to < and > to > when using the webmail 
side.

Personally, I would say things are working exactly as they should.

Mike...

>Rasmus,
>   I gathered info in several ways to hopefully save time.  I
>composed a message containing a simple, one-line PHP echo function and
>sent it to myself.  Not surprisingly, nothing showed in the message body
>when pulled up via the webmail app.  The exhibits are displayed below.
>This message was composed via Outlook, just to eliminate any confusion.
>
>Message sent:
>   Subject: PHP Test
>   Message: 
>
>Message received in Earthlink webmail:
>   Subject: PHP Test
>   Message: (nothing appears)
>
>View Source in IE 6.0:
>
>
>
>  
>
>Subject:  
>
>  
>  
>
>PHP Test
>
>  
>
>
>
>  
>
>
>
>
> 
> 
>
>
>
> 
> 
>
>
>
>Earthlink Mailcenter's "view source" hyperlink to "mimeget.php3?":
>
>
>Subject: PHP Test
>Sender: [EMAIL PROTECTED]
>Message-ID:
><[EMAIL PROTECTED]>
>X-Originating-IP: 66.149.18.3
>
>
>
>
>
>
>Thanks,
>





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




Re: [PHP] variable scoping...

2002-04-12 Thread Rasmus Lerdorf

I guess the only real way is to use virtual() in this case.  That's a bit
clunky as well, but it isn't quite as bad as going through CGI or all the
way out to the port 80 level.

-Rasmus

On Fri, 12 Apr 2002, Aric Caley wrote:

> Is it possible to keep the variable name-space separate between, say, two
> files (one included into the other) to avoid name collisions?  I'm trying to
> get two scripts to work together on the same page.  Each script defines some
> classes that have the same names but work differently (ex., class Template).
> All I need is to embed the output of one script into the other.
>
> Now, I could do this by just getting the output from a URL but that seems
> really inefficient.  Or I could run the script from the CGI version of PHP
> using exec() but that also seems like it could be really slow and clunky.
>
> Is there some efficient way of doing this?
>
> It would be cool if you could just put the include() inside of a function
> and have all the classes and variable names be local inside that function
> but that didnt seem to work...  plus the scripts explicitly access global
> variable names.
>
>
>
> --
> 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] 2 newbie questions ;)

2002-04-12 Thread Collins, Robert

1.
This should work (notice quotes around var) : 
This is incorrect (it only shows the first word) : >

2. not sure about the second question but have you tried removing the
target, it seems to me that a target might not be necessary since the link
should already be opening an application that is associated with that file
type.



Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Steve Bradwell [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 9:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 2 newbie questions ;)


Hi there,

I am populating form elements (type="text") with values from a db, but if
the string has a space in it, it cuts the string off at the space. eg. $var
= "the cat in the hat"  but all you see in the text box is "the". is there a
function I should be adding to my echo line?

Also I have an anchor tag that is a link to open an Access db. For some
reason it opens 2 copies instead of one. i have tried the following: Launch App
and
  Launch App
but it seems to want to open two copies anyhow,
anyone seen this before?

Thanks,
Steve.
   

-- 
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] include through HTTP

2002-04-12 Thread Rasmus Lerdorf

Why do you want to include from localhost over HTTP?  Sounds to me like
you want to do:

$foo='bar';
include "$DOCUMENT_ROOT/folder/file.php";

-Rasmus

On Fri, 12 Apr 2002, Barýþ Mert wrote:

> What i want to do is :
> include("http://localhost/folder/file.php?foo=bar";);
> but it doesn't work. As you may guess it looks for a
> file called "file.php?foo=bar". "url_fopen" is set to
> "on" in my php.ini file as told in the PHP manual.
> I work on win98+apache+php4.1.1(or something like that
> but at least 4.1...)
> Do you know what's the problem?
> Info about this subject is on
> http://www.php.net/manual/en/function.include.php
> ...
>
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] PHP Training is New York

2002-04-12 Thread ROBERT MCPEAK


Can't make it to this one but would like to know of any other training
opps in the Balt-Wash-Phil-NY areas.  Anybody know of a good source for
this info?


>>> "Daniel Kushner" <[EMAIL PROTECTED]> 04/12/02 10:48AM >>>
LAST DAY TO REGISTER

http://websapp.com/training.php 

--Daniel


-- 
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] Re: alphabetizing titles when first word begins with 'The','A',etc.

2002-04-12 Thread Analysis & Solutions

> On Wed, 12 Apr 2000, Steph wrote:
> 
> > Hi. Im using MySQL and as part of my tables I have titles (of stories). My
> > question os in regards to outputing those titles. Some of the titles begin
> > with words such as 'The', 'A', 'An', etc. Is there a way to order these
> > particular titles based on the second word in the title??

Why not do what libraries do.  Store the data correctly in the first
place?

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Return path (php/sendmail)

2002-04-12 Thread Analysis & Solutions

Hi Anthony:

On Fri, Apr 12, 2002 at 03:27:14AM -0400, Anthony Rodriguez wrote:
>
> My Web hosting provider runs php (4.1.1) / sendmail (8.10.2) / apache
> (1.3.20) / linux red hat (6.2) and I don't get bounced e-mails.
 
Put a from line in the additional headers argument:
   
   mail($To, $Subject, $Body, "From: $From");

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Output to system printer

2002-04-12 Thread Bruce S. Garlock

I have a script which, when modified or added, automatically prints out
to a system printer that I define. Here is some sample code:

$job_desc=urldecode($job_desc);
define(PRINT_CMD, " lpr -Pis ");

$prt = "-\n";
$prt .= "| $type DRAWDOWN REQUEST |\n";
$prt .= "- \n";
$prt .= "\n\n";
$prt .= " REPORT RUN: $today\n\n\n";
$prt .= "DATE of Request: $date\n";
$prt .= "Job #: $job_id\n";
$prt .= "Description:" . $job_desc . "\n";

// redirect $prt to system print command
$cmd="echo $prt | ".PRINT_CMD;

// execute the command
exec($cmd);


This prints fine, unless the variable $job_desc has a " AND ' in the
string. If it contains " OR ' it prints fine. For example:

if $job_desc = 40" & 20" PS, then it prints fine. if $job_desc = 40" &
20" P'S, it will NOT print.

Any idea why or how I can fix this?

TIA

- Bruce


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




[PHP] PHP Training is New York

2002-04-12 Thread Daniel Kushner

LAST DAY TO REGISTER

http://websapp.com/training.php

--Daniel


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




Re: [PHP] displaying form data

2002-04-12 Thread Erik Price


On Friday, April 12, 2002, at 08:23  AM, John P. Donaldson wrote:

> I have a form processor that displays a confirmation
> screen showing the submitted form values to the user
> after they submit the form.  This confirmation
> screen's contents are generated by the script itself.
> However, I'd like to be able to redirect the results
> to any pre-existing webpage.  For example, if the form
> had a field named "Name," I'd like to have the value
> of that displayed in an webpage after they submit it.
> I tried doing this by including the field name $Name
> in the webpage, having the form processor read this
> webpage in using fread, then printing it out from the
> script, but the page renders without the value of
> $Name.  How can I do this?

Sounds like you want to do a str_replace().  The template system I use 
works in this fashion -- I have a template HTML page, with certain 
keywords of the form {{{NAVIGATION}}}, {{{STYLESHEET}}}, {{{FOOTER, 
etc.  I have a class that I wrote which simply takes the values of the 
variables in my page and swaps them in for the appropriate keyword -- 
thus, if my nav column was contained by a variable called 
$navigation_column, then my class would do something like:

$template_page = "./includes/site_template.inc";
str_replace("{{{NAVIGATION}}}", $navigation_column, $template_page);

This is oversimplified and wouldn't really work (you need to read the 
template page into a file handle, etc) but demonstrates the theory.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] templates and listbox

2002-04-12 Thread Analysis & Solutions

Hey Javier:

On Thu, Apr 11, 2002 at 01:33:10PM -0300, Javier wrote:
> But does it use templates? I want to use templates not functions that
> generates html.

What do you mean, it uses "templates not functions?"  Smarty uses 
functions.  Are you envisioning include files with scripts in them that 
aren't functions?

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Re: variable scoping...

2002-04-12 Thread J Smith


Namespaces aren't available yet, but should be with PHP 5 (?) when the Zend 
Engine 2.0 is ready.

J


Aric Caley wrote:

> Is it possible to keep the variable name-space separate between, say, two
> files (one included into the other) to avoid name collisions?  I'm trying
> to
> get two scripts to work together on the same page.  Each script defines
> some classes that have the same names but work differently (ex., class
> Template). All I need is to embed the output of one script into the other.
> 
> Now, I could do this by just getting the output from a URL but that seems
> really inefficient.  Or I could run the script from the CGI version of PHP
> using exec() but that also seems like it could be really slow and clunky.
> 
> Is there some efficient way of doing this?
> 
> It would be cool if you could just put the include() inside of a function
> and have all the classes and variable names be local inside that function
> but that didnt seem to work...  plus the scripts explicitly access global
> variable names.


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




[PHP] 2 newbie questions ;)

2002-04-12 Thread Steve Bradwell

Hi there,

I am populating form elements (type="text") with values from a db, but if
the string has a space in it, it cuts the string off at the space. eg. $var
= "the cat in the hat"  but all you see in the text box is "the". is there a
function I should be adding to my echo line?

Also I have an anchor tag that is a link to open an Access db. For some
reason it opens 2 copies instead of one. i have tried the following: Launch App
and
  Launch App
but it seems to want to open two copies anyhow,
anyone seen this before?

Thanks,
Steve.
   

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




Re: [PHP] Forms in PHP

2002-04-12 Thread Erik Price


On Thursday, April 11, 2002, at 09:17  PM, Jennifer Downey wrote:

> Now I have a weird problem. I am using this code and can't understand 
> why it
> doesn't work.
> When the script is run it returns a blank page, no error or done.
>
> here it is and any help would be appreciated.
>
> if(($type == book) or ($type == weapon)){
   ^^ 

I could be completely wrong here, but shouldn't these values be quoted?  
Even if it's not what's screwing up your code, it's probably a good idea 
unless they are supposed to represent your own defined constants.

Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Re: Php/Mysql

2002-04-12 Thread Michael Andersson

Myabe you should assign "some string to a variable:

$string = "some string";
insert into mytable values ($string)

/Just a noob trying to help out


"Torkil Johnsen" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Just a noob php/mysql question... (I suppose)
>
> When I try just putting php code in my insert queries, it goes like this:
>
> insert into mytable values('')
>
> select * from mytable, returns:
> Some string
>
> So the insert-query inserts both the code AND the string that the code
> echoes...
>
> Any help would be greatly appreciated!
>



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




RE: [PHP] include through HTTP

2002-04-12 Thread Barýþ

Oh what a shame on me! Sorry and thank you...

--- "Collins, Robert" <[EMAIL PROTECTED]> wrote:
> Check the Note about 5 lines down on this page.
>
http://www.php.net/manual/en/features.remote-files.php
> 
> "Note: You can't use remote files in include() and
> require() statements on
> Windows."
> 
> Robert W. Collins II 
> Webmaster 
> New Orleans Regional Transit Authority 
> Phone : (504) 248-3826 
> Email : [EMAIL PROTECTED] 
> 
> 
> 
> -Original Message-
> From: Barýþ" Mert [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 12, 2002 8:13 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] include through HTTP
> 
> 
> What i want to do is :
> include("http://localhost/folder/file.php?foo=bar";);
> but it doesn't work. As you may guess it looks for a
> file called "file.php?foo=bar". "url_fopen" is set
> to
> "on" in my php.ini file as told in the PHP manual.
> I work on win98+apache+php4.1.1(or something like
> that
> but at least 4.1...)
> Do you know what's the problem?
> Info about this subject is on 
> http://www.php.net/manual/en/function.include.php
> ...
> 
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




[PHP] Php/Mysql

2002-04-12 Thread Torkil Johnsen

Just a noob php/mysql question... (I suppose)

When I try just putting php code in my insert queries, it goes like this:

insert into mytable values('')

select * from mytable, returns:
Some string

So the insert-query inserts both the code AND the string that the code
echoes...

Any help would be greatly appreciated!


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




[PHP] Different directory/test locally

2002-04-12 Thread Tiago Simões

Hello.

I still can't manage to test locally the pages in my notebook, without using
the htdocs directory. As i told you, i managed to install the all the stuff
correctly, made my first test with a php script in the htdocs Apache
instalation folder, but when  i tried to put that new directory path in the
httpd.conf file i couldn't see the php script on the designated folder. I
know that in the other case i had to access via http://localhost/test.php
path. How do i test a page that is, let's say, in the c:\website\ folder?
(after i configured its path in httpd.conf file, of course)

i know that i should put something like this in the httpd.conf file


AddType application/x-httpd-php .php .phtml .php3
#Next line is optional (for viewing source)
AddType application/x-httpd-php-source .phps


but after that, what path i put in the browser?

Thanks in advance,
Tiago



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




Re: [PHP] Posting with script tags, or a plea not to

2002-04-12 Thread Erik Price



>   I was able to see the PHP code because I came home and fired up
> Outlook.  Right after I posted that last message, I closed Outlook and
> went to Earthlink webmail.  Same problem.  No code, and incredibly weird
> hyerlinks and garbled code.  I opened Outlook back up, loaded the same
> messages I just viewed in webmail, and presto, they look fine.  It's
> definitely their app.
>   I could create an email address and password for you on
> Earthlink just to let you see it firsthand.  However, I am sure you have
> much better things to do with your time.

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







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Re: functions

2002-04-12 Thread Michael Virnstein

like you call every function in php.

"Alia Mikati" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi
> i would like now how can we call a function within another function in
> php?
> thx a lot
>
>



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




Re: [PHP] functions

2002-04-12 Thread Andrey Hristov



HTH

Regards,
Andrey Hristov

- Original Message - 
From: "Alia Mikati" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 12, 2002 4:37 PM
Subject: [PHP] functions


> hi
> i would like now how can we call a function within another function in 
> php?
> thx a lot
> 
> 
> 
> -- 
> 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] functions

2002-04-12 Thread Jon Haworth

Hi Alia,

> i would like now how can we call a function within another function in 
> php?

The same way you'd call it from outside a function :-)

";
world();

?>

...should output

hello
hello world

Cheers
Jon

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




RE: [PHP] functions

2002-04-12 Thread Caspar Kennerdale

function firstfunction(){

code;
code;
code;

secondfunction();

}

-Original Message-
From: Alia Mikati [mailto:[EMAIL PROTECTED]]
Sent: 12 April 2002 06:38
To: [EMAIL PROTECTED]
Subject: [PHP] functions


hi
i would like now how can we call a function within another function in 
php?
thx a lot



-- 
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] displaying form data

2002-04-12 Thread heinisch

At 12.04.2002  05:23, you wrote:
>
>I have a form processor that displays a confirmation
>screen showing the submitted form values to the user
>after they submit the form.  This confirmation
>screen's contents are generated by the script itself.
>However, I'd like to be able to redirect the results
>to any pre-existing webpage.  For example, if the form
>had a field named "Name," I'd like to have the value
>of that displayed in an webpage after they submit it.
>I tried doing this by including the field name $Name
>in the webpage, having the form processor read this
>webpage in using fread, then printing it out from the
>script, but the page renders without the value of
>$Name.  How can I do this?

>Any help would be greatly appreciated.
>
>Thanks,
>John
I hope I understand your problem,
you have the values you got from the confirmation page stored in a file?
And you want them to display in another page.
In the file, the values are stored like
$Name="foo";
$adress="Footown";
you read the data using fopen(), fread().
Then you have to use eval() ta make this text "real vars".
But I wonder how you know which user is Name, and therefor displaying
the corect data to her/him.
Maybe you want to do this with a cookie(), or session() methods, wich are
covered endless in this list.
HTH Oliver


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




  1   2   >