php-general Digest 24 Mar 2002 00:13:09 -0000 Issue 1244

Topics (messages 89831 through 89865):

Superglobals....
        89831 by: David
        89836 by: Jason Sheets

DNS
        89832 by: Liam
        89845 by: Jason Wong

Web Hosting control panel ported to freebsd
        89833 by: Charles Williams

Development tools
        89834 by: Morten Nielsen

Create Email POP accounts with PHP
        89835 by: Julian
        89847 by: Jason Wong
        89849 by: Julian

Re: this mailing list
        89837 by: Jason Sheets

Form Validation Reg EX
        89838 by: John Fishworld

Version 4.2 changes
        89839 by: Gaylen Fraley
        89840 by: Rasmus Lerdorf
        89841 by: Andrew Lopucki

Re: looking for tutorial on XML parsing of attributes...
        89842 by: J. Scott Johnson
        89858 by: Scott Brown

SafeArrays and Enumerations Doc Questions
        89843 by: Jason Lotito

Re: Does anybody use UltraDev?
        89844 by: [-^-!-%-
        89846 by: [-^-!-%-

Include Error on PHP 4.1.2
        89848 by: Alberto Wagner

PHPTriad error in Windows XP.
        89850 by: Peter Ruan
        89851 by: Peter Ruan

Re: Drawing graphs - opinions
        89852 by: David Ford

Caching problem...?
        89853 by: Adam Schlag

PHP Search Engine?
        89854 by: lmlweb
        89855 by: Rasmus Lerdorf

Re: Advice needed
        89856 by: Hugh Bothwell

HELP!! New PHP not working
        89857 by: Christopher J. Crane

Image Manipulation/GD support
        89859 by: Navid Yar
        89860 by: Rasmus Lerdorf
        89861 by: Navid Yar

Select then update
        89862 by: Jen Downey
        89863 by: Alberto Wagner

Re: Trap CR or "Enter" possible?
        89864 by: Miguel Cruz

Russian encoding problems
        89865 by: Lauri Vain

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Hi,
Is there any way to emulate the super globals on PHP4.0.6.
I've designed a system using $_GET, $_POST, etc, and I had it all running 
wonderfully, but I have been forced to change servers to some folks who do 
not seem to have an upgrade to 4.1.x in mind.

What I would like to know is... is there away to make a variable global 
across all functions, like the $_* type vars? Without putting 

global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE;

at the top of each function.

Thanks!

David


-- 
---

WarpedWeb.Net
http://www.warpedweb.net/
--- End Message ---
--- Begin Message ---
You might  remind  them that anything under PHP 4.1.2 has a security whole
that can be exploited remotely, my web host refused to upgrade until they
learned about the security implications of not doing so.

Jason

"David" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> Is there any way to emulate the super globals on PHP4.0.6.
> I've designed a system using $_GET, $_POST, etc, and I had it all running
> wonderfully, but I have been forced to change servers to some folks who do
> not seem to have an upgrade to 4.1.x in mind.
>
> What I would like to know is... is there away to make a variable global
> across all functions, like the $_* type vars? Without putting
>
> global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE;
>
> at the top of each function.
>
> Thanks!
>
> David
>
>
> --
> ---
>
> WarpedWeb.Net
> http://www.warpedweb.net/


--- End Message ---
--- Begin Message ---
23/03/2002 11:26:39 PM

Hi, err, I realise this has nothing to do with PHP but...

I am in desperate need of a backup DNS host.  I've scoured 
the internet and I can't find anyone who'll be my backup DNS.
I'm willing to exchange the favour and be your backup DNS.

If there's any place you know I can get this, please pipe up.

Thanks,
Liam


--- End Message ---
--- Begin Message ---
On Sunday 24 March 2002 07:26, Liam wrote:
> 23/03/2002 11:26:39 PM
>
> Hi, err, I realise this has nothing to do with PHP but...
>
> I am in desperate need of a backup DNS host.  I've scoured
> the internet and I can't find anyone who'll be my backup DNS.
> I'm willing to exchange the favour and be your backup DNS.
>
> If there's any place you know I can get this, please pipe up.

www.zoneedit.com


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Conscience is what hurts when everything else feels so good.
*/
--- End Message ---
--- Begin Message ---
yep,

finally got it working.  original linux based web hosting control panel,
written in PHP, now works under freebsd 4.3 (tested), and should work on 4.4
as well.

If interested in testing on a FreeBSD system just let me know, off list, at
[EMAIL PROTECTED]  I would like to get this compatible with just
about any other FreeBSD release.

thanks,
chuck

--- End Message ---
--- Begin Message ---
Hi,
Does anyone know of a tool that can show how mySQL DB's are related and
which PHP functions are being called. It should maybe be something like UML.

Regards,
Morten


--- End Message ---
--- Begin Message ---
Hey Dan!!!

This book is for sale!!!!!!!! I can't buy it!

Can any body explain me how I can to create email POP accounts whith PHP
without using vpopmail????

Thanks! Julian




----- Original Message -----
From: Dan Harrelson
To: Julian ; [EMAIL PROTECTED]
Sent: Friday, March 22, 2002 9:25 PM
Subject: Re: [PHP] Create Email POP accounts with PHP


I am a newbie and can't tell you how to do it, but I know that the book
I am reading can!  Chapter 27 is titled "Building a Web-based Email
Service".  The Book is title "PHP and MySQL Web Development" and I like
it alot.  It was recommended on the mysql.com.

http://tangledweb.com.au/

-Dan




--- Julian <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I want to know how I can create email POP accounts from a script PHP.
>
>
> If somebody can help me, thank ahead of time!
>
> Regards! Julian
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards
http://movies.yahoo.com/

--- End Message ---
--- Begin Message ---
On Saturday 23 March 2002 21:40, Julian wrote:
> Hey Dan!!!
>
> This book is for sale!!!!!!!! I can't buy it!
>
> Can any body explain me how I can to create email POP accounts whith PHP
> without using vpopmail????

It would depend on what mail system you're using -- sendmail, qmail, postfix 
etc -- and any other 'add-ons' -- vpopmail, vmailmgr etc.



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
That's odd.  That's very odd.  Wouldn't you say that's very odd?
*/
--- End Message ---
--- Begin Message ---
Hi Jason!!!

Explain me how to do it with qmail and sendmail, plese.

Thank you! Julian

----- Original Message -----
From: Jason Wong
To: [EMAIL PROTECTED]
Sent: Saturday, March 23, 2002 4:00 PM
Subject: Re: [PHP] Create Email POP accounts with PHP


On Saturday 23 March 2002 21:40, Julian wrote:
> Hey Dan!!!
>
> This book is for sale!!!!!!!! I can't buy it!
>
> Can any body explain me how I can to create email POP accounts whith PHP
> without using vpopmail????

It would depend on what mail system you're using -- sendmail, qmail, postfix
etc -- and any other 'add-ons' -- vpopmail, vmailmgr etc.



--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
That's odd.  That's very odd.  Wouldn't you say that's very odd?
*/

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

--- End Message ---
--- Begin Message ---
Quite a few, there are 3641 messages in the php-general archive for between
02-01-02 and 03-01-02  this month there are already 3147 messages.  If you
are concerned about transfer you could use a news client and connect to
news.php.net, the news groups are interfaces to the mailing lists that way
you don't have to download messages you dont want to read.

"Liam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How much data (in Kilobytes) would I receive on
> average per month from this list?
>
> cheers,
> Liam
>
>


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

I'm just trying to validate an url !
Without tracing or confiming it I just want

www.whatever.max 4 letters

This is what I had but its wrong ! :-))

function check_url($str) {
if (ereg("w{3}.^[a-z0-9-]+(\.[a-z0-9-]+)*$", $str)) {
return 1;
} else {
return 0;
}
}

I just know that some RegEx guru will go of course it should be .......

thanks
john


--- End Message ---
--- Begin Message ---
Where can I find the changes coming in 4.2?

--
Gaylen
PHP KISGB v4.0.2 Guest Book http://www.gaylenandmargie.com/phpwebsite/



--- End Message ---
--- Begin Message ---
In the NEWS and ChangeLog files in CVS.  See
http://cvs.php.net/cvs.php/php4/NEWS and pay attention to the branch name.

On Sat, 23 Mar 2002, Gaylen Fraley wrote:

> Where can I find the changes coming in 4.2?
>
> --
> Gaylen
> PHP KISGB v4.0.2 Guest Book http://www.gaylenandmargie.com/phpwebsite/
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
On Saturday 23 March 2002 11:34 am, Gaylen Fraley wrote:
> Where can I find the changes coming in 4.2?

There is a 'NEWS' file in the download of the RCx.tgz.  You should download 
and extract it and read the top section which gives news on the 4.2 release.

And since you've already gone to the trouble of downloading it, you may as 
well build and provide the feedback for which the QA team asks ;)
--- End Message ---
--- Begin Message ---
If you use xml_parse_into_struct, it does split out the attributes into the
array it creates.

I tested this with the standard manual code, adding a single attribute to
the sample data i.e.

$simple = "<para><note attrib=\"scott\">simple note</note></para>";
$p = xml_parser_create();
xml_parse_into_struct($p,$simple,$vals,$index);
xml_parser_free($p);
echo "Index array\n";
print_r($index);
echo "\nVals array\n";
print_r($vals);

I got back:

Index array Array ( [PARA] => Array ( [0] => 0 [1] => 2 ) [NOTE] => Array
( [0] => 1 ) ) Vals array Array ( [0] => Array ( [tag] => PARA [type] =>
open [level] => 1 ) [1] => Array ( [tag] => NOTE [type] => complete [level]
=> 2 [attributes] => Array ( [ATTRIB] => scott ) [value] => simple note )
[2] => Array ( [tag] => PARA [type] => close [level] => 1 ) )

There seems to be an attributes array which you can access (disclaimer - I
haven't done that yet).

http://www.php.net/manual/en/function.xml-parse-into-struct.php

Scott

Virtual:
* * * * * * * * * * * * * * * * * * * * * * * * * *
[EMAIL PROTECTED]
http://www.fuzzygroup.com/
Yahoo IM: fuzzygroup


-----Original Message-----
From: Erik Price [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 3:43 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] looking for tutorial on XML parsing of attributes...


I'm no expert on the XML functions, but post your code and maybe we can
figure out what's wrong.


Erik



On Thursday, March 21, 2002, at 09:24  PM, Scott Brown wrote:

> Ok - first off, I've found a few... phpbuilder has a nice number of
> references.  But every one I've tried has ignored attributes... either
> that,
> or I dont understand what I'm doing.
>
> I retrieve from a distant server an XML response to an inquiry:
>
> <?xml version="1.0" ?>
> <response version="1.0" requestid="some-request-identifier">
>   <status code="some-numeric-code">
>     <description>sometext</description>
>   </status>
>   <domain fqdn="fqdn-identidier1">
>     <status code="some-numeric-code1">
>       <description>sometext1</description>
>     </status>
>   </domain>
>   <domain fqdn="fqdn-identidier2">
>     <status code="some-numeric-code2">
>       <description>sometext2</description>
>     </status>
>   </domain>
>   <domain fqdn="fqdn-identidier3">
>     <status code="some-numeric-code3">
>       <description>sometext3</description>
>     </status>
>   </domain>
> </response>
>
> BUT... when I parse this using xml_parse, all I'm getting out is:
>
> Name = RESPONSE  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
> Name = DOMAIN  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
> Name = DOMAIN  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
> Name = DOMAIN  -- Attributes = Array
> Name = STATUS  -- Attributes = Array
> Name = DESCRIPTION  -- Attributes = Array
>
> I cant seem to nail down how to pull the actual attribute values....
> does
> anyone know of a tutorial that's going to teach me how to pull those
> attributes of fqdn and code?  I've figured out how to get the
> DESCRIPTION...
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.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


--- End Message ---
--- Begin Message ---
Thanks - using xml_parse_into_struct does make parsing the document much
easier... great suggestion.

What I've ended up with is:

// create parser
$xp = xml_parser_create();
xml_parse_into_struct($xp,$xml,$vals,$index);
xml_parser_free($xp);

$found_domain = 0;
$results = array();

for($ctr=0; $ctr<count($vals); $ctr++) {
        switch($vals[$ctr]["tag"]) {
        case "DOMAIN":
                $found_domain = 1;
                break;
        case "STATUS":
                if ($found_domain == 1) {

array_push($results,$vals[$ctr]["attributes"][CODE]);
                }
                break;
        case "DESCRIPTION":
                if ($found_domain == 1)
                        array_push($results,$vals[$ctr]["value"]);
                break;
        }
}


echo "Return Status = " . $results[0] . "<BR>\n";
echo "Return Desc   = " . $results[1] . "<BR>\n";
print_r($results);

which then gives me (for something similar to the XMLdoc below):

Return Status = 05<BR>
Return Desc   = Successfully added,eh?<BR>
Array
(
    [0] => some-numeric-code1
    [1] => sometext1
    [2] =>
    [3] =>
    [4] =>
    [5] => some-numeric-code2
    [6] => sometext2
    [7] =>
    [8] =>
    [9] =>
    [10] => some-numeric-code3
    [11] => sometext3
    [12] =>
    [13] =>
    [14] =>
)

So I know that every grouping of 5 elements within the results array is
associated with a given domain.  (The two that are present are what I
want...what are the others - just remnants of the tree traversal??)

A little more fiddling, and I'll be able to pull it all apart as needed.
This will do me for now though...

But of course, my next question has to be.... isnt there an easier way to
extract elements from the XML document?



> -----Original Message-----
> From: J. Scott Johnson [mailto:[EMAIL PROTECTED]]
> Sent: March 23, 2002 12:19 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] looking for tutorial on XML parsing of
> attributes...
>
>
> If you use xml_parse_into_struct, it does split out the
> attributes into the
> array it creates.
>
> I tested this with the standard manual code, adding a single
> attribute to
> the sample data i.e.
>
> $simple = "<para><note attrib=\"scott\">simple note</note></para>";
> $p = xml_parser_create();
> xml_parse_into_struct($p,$simple,$vals,$index);
> xml_parser_free($p);
> echo "Index array\n";
> print_r($index);
> echo "\nVals array\n";
> print_r($vals);
>
> I got back:
>
> Index array Array ( [PARA] => Array ( [0] => 0 [1] => 2 )
> [NOTE] => Array
> ( [0] => 1 ) ) Vals array Array ( [0] => Array ( [tag] =>
> PARA [type] =>
> open [level] => 1 ) [1] => Array ( [tag] => NOTE [type] =>
> complete [level]
> => 2 [attributes] => Array ( [ATTRIB] => scott ) [value] =>
> simple note )
> [2] => Array ( [tag] => PARA [type] => close [level] => 1 ) )
>
> There seems to be an attributes array which you can access
> (disclaimer - I
> haven't done that yet).
>
> http://www.php.net/manual/en/function.xml-parse-into-struct.php
>
> Scott
>
> Virtual:
> * * * * * * * * * * * * * * * * * * * * * * * * * *
> [EMAIL PROTECTED]
> http://www.fuzzygroup.com/
> Yahoo IM: fuzzygroup
>
>
> -----Original Message-----
> From: Erik Price [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 22, 2002 3:43 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] looking for tutorial on XML parsing of
> attributes...
>
>
> I'm no expert on the XML functions, but post your code and
> maybe we can
> figure out what's wrong.
>
>
> Erik
>
>
>
> On Thursday, March 21, 2002, at 09:24  PM, Scott Brown wrote:
>
> > Ok - first off, I've found a few... phpbuilder has a nice number of
> > references.  But every one I've tried has ignored
> attributes... either
> > that,
> > or I dont understand what I'm doing.
> >
> > I retrieve from a distant server an XML response to an inquiry:
> >
> > <?xml version="1.0" ?>
> > <response version="1.0" requestid="some-request-identifier">
> >   <status code="some-numeric-code">
> >     <description>sometext</description>
> >   </status>
> >   <domain fqdn="fqdn-identidier1">
> >     <status code="some-numeric-code1">
> >       <description>sometext1</description>
> >     </status>
> >   </domain>
> >   <domain fqdn="fqdn-identidier2">
> >     <status code="some-numeric-code2">
> >       <description>sometext2</description>
> >     </status>
> >   </domain>
> >   <domain fqdn="fqdn-identidier3">
> >     <status code="some-numeric-code3">
> >       <description>sometext3</description>
> >     </status>
> >   </domain>
> > </response>
> >
> > BUT... when I parse this using xml_parse, all I'm getting out is:
> >
> > Name = RESPONSE  -- Attributes = Array
> > Name = STATUS  -- Attributes = Array
> > Name = DESCRIPTION  -- Attributes = Array
> > Name = DOMAIN  -- Attributes = Array
> > Name = STATUS  -- Attributes = Array
> > Name = DESCRIPTION  -- Attributes = Array
> > Name = DOMAIN  -- Attributes = Array
> > Name = STATUS  -- Attributes = Array
> > Name = DESCRIPTION  -- Attributes = Array
> > Name = DOMAIN  -- Attributes = Array
> > Name = STATUS  -- Attributes = Array
> > Name = DESCRIPTION  -- Attributes = Array
> >
> > I cant seem to nail down how to pull the actual attribute values....
> > does
> > anyone know of a tutorial that's going to teach me how to pull those
> > attributes of fqdn and code?  I've figured out how to get the
> > DESCRIPTION...
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.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
>
>

--- End Message ---
--- Begin Message ---
In the ChangeLog 4.1.0
"Added support for single dimensional SafeArrays and Enumerations. Added an
is_enum() function to check if a component implements an enumeration. (Alan,
Harald) "

Does anyone know about this or know where I can find documentation on this?

I searched the manual, and frankly, the ChangeLog is the only placed
mentioned.

Thak you for your time.

Jason Lotito
A PHP Developer's Network Founder
www.devnetwork.net
www.newbienetwork.net

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


 Ultradev is cool for quick dev, but the code is really messy.
 Unles you're creating something basic, you'll most likely have to clean
 up the code.

 Other than that, it's an excellent tool. It cuts down the development
 time, help (tremendously) with the layout, and take out takes care of the
 HTML codes.

 If don't mind your code being a bit messy, then it's perfect. Otherwise,
 you'll need to do some minor adjustments.

 Overall:
 I'd recommend it.


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-


On Sat, 23 Mar 2002, ....::: rObEr2 :::.... wrote:

> Hey!
>
> Does anybody use UltraDev for PHP?
> Any comments about it?
>
> (Personally I go for Visual PHP Studio)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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


 PHAKT does support TABLE JOIN, but you have to edit the SQL statement (in
 Ultradev).

 To do this (in Ultradev), switch to 'Advance Mode' and modify your query.
 It should look something like:

 select table1.field1, table2.field2 from table1,table where
  table1.field1=table2.field2

*check the syntax.



__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Fri, 22 Mar 2002, Dan Harrelson wrote:

> I do, and was just thinking of posing a similar question.  My question
> was specific to the PHAkt app server extension.  I've tried it out and
> think it's great, though limited.  For example, my simple project (my
> very first :) calls for inserts into 2 tables from a single form.
> Phakt doesn't support this.  Nor, do I believe, does it support joins
> for retrieval of data.
>
> http://www.interakt.ro/products/PHAkt/index.php
>
> Either way, I use Ultradev quite a bit and dig on it.
>
> -Dan
>
>
> --- "....::: rObEr2 :::...." <[EMAIL PROTECTED]> wrote:
> > Hey!
> >
> > Does anybody use UltraDev for PHP?
> > Any comments about it?
> >
> > (Personally I go for Visual PHP Studio)
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards
> http://movies.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I can't include anything on my php scripts

Failed opening 'Pagina_Inicial.php' for inclusion (include_path='c:\php4\pear')

How to fix it?



--- End Message ---
--- Begin Message ---
Hi,
  I installed PHPTriad under Windows XP and I keep getting this error:



--- End Message ---
--- Begin Message ---
Hi,
  I installed PHPTriad under Windows XP and I keep gettting the
following error:

Warning: MySQL Connection Failed: Can't connect to MySQL server on
'localhost' (10061) in C:\apache\htdocs\phpmyadmin\lib.inc.php on line
255


It worked before under Windows ME.  WinMySQLadmin1.0 works fine as well
as MySQL when I ran it in the cmd-line mode.  What's the remedy?

Thanks in advance,
-Peter


--- End Message ---
--- Begin Message ---
Take a look at jpgraph, it's on freshmeat.

David

Lee P Reilly wrote:

>Hi,
>
>I see there a number of PHP scripts/libraries out there for the purpose
>of graphing data. Which one is considered to be the best, most powerful
>/ easiest to use? I need to plot X/Y graphs for some data sets with
>vertical error margin lines going along the y-axis. Any recommendations?
>
>Cheers,
>
>Lee
>
>


--- End Message ---
--- Begin Message ---
Hello, I'm having a problem with my Apache/PHP setup.  I create a PHP
page and test it in a browser, and the page loads and everything is
fine.  However, when I make a change to my PHP script and reload the
page to see my changes, the same output from PHP is given to me.  I have
to save the page as a new file and load the new file to see any
changes.  I've turned off caching in my browser (Mozilla) and I've even
closed the browser and reloaded it, and I get the same page.  The only
thing that works is restarting Apache.

I'm running Debian with the Debian packages for Apache (1.3.23) and PHP
(4.1.2).  I've tried looking at the configuration and I know there has
to be an easy answer, but I can't find it.  I've read the documentation
for both, and I've searched the web for answers, but I just don't know
what's going on here.  Any help someone could provide would be greatly
appreciated.  Thank-you.

Adam Schlag




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

I've picked up a book called the PHP Developer's Cookbook, specifically
for the search engine that was featured in it. It required the use of
PEAR's File/Find.php, which my host hasn't installed, ..and very likely
will not.

Is there another way of coming up with a search engine in PHP that
doesn't require the use of subscription services?

Laurie M. Landry
http://www.lmlweb.com
voicemail/fax: (604) 693-1120


--- End Message ---
--- Begin Message ---
So just put that file in your own directory and use it from there.  It is
just a PHP script.

On Sat, 23 Mar 2002, lmlweb wrote:

> Hello,
>
> I've picked up a book called the PHP Developer's Cookbook, specifically
> for the search engine that was featured in it. It required the use of
> PEAR's File/Find.php, which my host hasn't installed, ..and very likely
> will not.
>
> Is there another way of coming up with a search engine in PHP that
> doesn't require the use of subscription services?
>
> Laurie M. Landry
> http://www.lmlweb.com
> voicemail/fax: (604) 693-1120
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Actually, it looks pretty straight-forward:

<?php

$points = array( 1, 2, 3, 5, 10, 15, 20, 25, 50, 100, 300, 500, 600,
1000000000 );
$prices = array();


function init_prices() {
    global $points, $prices;

    foreach($points as $val)
        $prices[$val] = "none";
}

function show_prices() {
    global $points, $prices;

    foreach($points as $val)
        echo "q$val: ".$prices[$val]."<br />";
}

function add_price_point($num, $price) {
    global $points, $prices;

    // this saves us from div-by-0 and automatically
    // discards invalid quantities
    if ($num < 1)
        return;

    $per = $price / $num;

    foreach($points as $val)
        if ($val >= $num)
            if (($prices[$val] == "none") or ($prices[$val] > $per))
                $prices[$val] = $per;
}


init_prices();

add_price_point($Quantity1, $Price1);
add_price_point($Quantity2, $Price2);
add_price_point($Quantity3, $Price3);

show_prices();

?>


> q1 q2 q3 q5 q10 q15 q20 q25 q50 q100 q300 q500 q600 q1000000000
> 0  0  0  0  .10 .10 .10 .10 .10 .10  .10  .10  .10  .10

Note that this is a messy and misleading way to do things:

1.  Having '0' as the price for un-valued quantities is dangerous, unless
you want to tell me that 4 or fewer items are free.  Note that in my code I
have replaced it with "none", which isn't much safer (it may get cast to 0)
but is a lot more obvious when debugging.

2.  What's with all these price points?  Surely it would be cleaner to keep
just the decision points in your database instead?

- what happens if you can get a cheaper price on 120 items (or on any
arbitrary number of items not in the list)?  Will you just defer it to the
next number of items (in my example, 300)?  Your customers might be
unhappy...



> Now the tricky part is $Quantity2 can either be blank or have a value
> and if $Quantity2 has a value then $Quantity3 can either be blank or have
a
> value

This is quite simply - let the function itself check whether it has been
passed a valid quantity - if not, return without doing anything.  Voila -
valid results and code that is easy to read.


--- End Message ---
--- Begin Message ---
I just downloaded the new version of PHP. I installed it and I am using
Omnicron HTTPD server version 2.09. The PHP that came with the server works,
but when I installed the new version of PHP from PHP.NET, I got the
following error.
<!--- Error Message
Security Alert! PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means
that a page will only be served up if the REDIRECT_STATUS CGI variable is
set. This variable is set, for example, by Apache's Action directive
redirect.

You may disable this restriction by recompiling the PHP binary with
the --disable-force-cgi-redirect switch. If you do this and you have your
PHP CGI binary accessible somewhere in your web tree, people will be able to
circumvent .htaccess security by loading files through the PHP parser. A
good way around this is to define doc_root in your php.ini file to something
other than your top-level DOCUMENT_ROOT. This way you can separate the part
of your web space which uses PHP from the normal part using .htaccess
security. If you do not have any .htaccess restrictions anywhere on your
site you can leave doc_root undefined. If you are running IIS, you may
safely set cgi.force_redirect=0 in php.ini
---!>

I read what it says and also the install.txt file that came from PHP.NET. I
have tried many different configurations with the "force-cgi-redirect "
variable both on and off. I never get it to work. I don't what it means to
assign a variable to the "REDIRECT_STATUS CGI " line in the php.ini file.
Some please help. I tried even going back and repointing the PHP files to
the php.exe that came with the server originally and it still does not work.
I am really stuck now, because nothing works.


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

I just enabled GD support for PHP via the php.ini file. When I try to
run a script that uses the functions included in the library, it gives
me a dialog box asking me whether I want to save the php file to a
specific location or not. I don't need to save it, I need PHP to run it.
This is happening on two machines enabled with the gd library. I'm using
PHP 4.0.6, while my remote host machine is using 4.1.1. Do I need a more
current version of the GD library to run this script? Here is the
script:

<?php

$image = "images/pic.jpg";

if (!$max_width)
   $max_width = 150;
if (!max_height)
   $max_height= 150;

$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];

$x_ratio = $max_width / $width;
$y_ratio = $max_height / $height;

if (($width <= $max_width) && ($height <= $max_height)) {
   $tn_width = $width;
   $tn_height = $height;
}
elseif (($x_ratio * $height) < $max_height) {
   $tn_height = ceil($x_ratio * $height);
   $tn_width = $max_width;
}
else {
   $tn_width = ceil($y_ratio * $width);
   $tn_height = $max_height;
}

$src = ImageCreateFromJpeg ($image);
$dst = ImageCreate ($tn_width, $tn_height);
ImageCopyResized ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width,
$height);
header ("Content-type: image/jpg");
ImageJpeg ($dst, null, -1);
ImageDestroy ($src);
ImageDestroy ($dst);

?>

--- End Message ---
--- Begin Message ---
Try image/jpeg as your content-type

On Sat, 23 Mar 2002, Navid Yar wrote:

> Hello,
>
> I just enabled GD support for PHP via the php.ini file. When I try to
> run a script that uses the functions included in the library, it gives
> me a dialog box asking me whether I want to save the php file to a
> specific location or not. I don't need to save it, I need PHP to run it.
> This is happening on two machines enabled with the gd library. I'm using
> PHP 4.0.6, while my remote host machine is using 4.1.1. Do I need a more
> current version of the GD library to run this script? Here is the
> script:
>
> <?php
>
> $image = "images/pic.jpg";
>
> if (!$max_width)
>    $max_width = 150;
> if (!max_height)
>    $max_height= 150;
>
> $size = GetImageSize($image);
> $width = $size[0];
> $height = $size[1];
>
> $x_ratio = $max_width / $width;
> $y_ratio = $max_height / $height;
>
> if (($width <= $max_width) && ($height <= $max_height)) {
>    $tn_width = $width;
>    $tn_height = $height;
> }
> elseif (($x_ratio * $height) < $max_height) {
>    $tn_height = ceil($x_ratio * $height);
>    $tn_width = $max_width;
> }
> else {
>    $tn_width = ceil($y_ratio * $width);
>    $tn_height = $max_height;
> }
>
> $src = ImageCreateFromJpeg ($image);
> $dst = ImageCreate ($tn_width, $tn_height);
> ImageCopyResized ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width,
> $height);
> header ("Content-type: image/jpg");
> ImageJpeg ($dst, null, -1);
> ImageDestroy ($src);
> ImageDestroy ($dst);
>
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Rasmus, thanks so much! It's executing. I've run into another problem
with this script, but I'll try to figure this one out as best I can
first before posting it. Thanks again!  :)

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 23, 2002 4:41 PM
To: Navid Yar
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Image Manipulation/GD support

Try image/jpeg as your content-type

On Sat, 23 Mar 2002, Navid Yar wrote:

> Hello,
>
> I just enabled GD support for PHP via the php.ini file. When I try to
> run a script that uses the functions included in the library, it gives
> me a dialog box asking me whether I want to save the php file to a
> specific location or not. I don't need to save it, I need PHP to run
it.
> This is happening on two machines enabled with the gd library. I'm
using
> PHP 4.0.6, while my remote host machine is using 4.1.1. Do I need a
more
> current version of the GD library to run this script? Here is the
> script:
>
> <?php
>
> $image = "images/pic.jpg";
>
> if (!$max_width)
>    $max_width = 150;
> if (!max_height)
>    $max_height= 150;
>
> $size = GetImageSize($image);
> $width = $size[0];
> $height = $size[1];
>
> $x_ratio = $max_width / $width;
> $y_ratio = $max_height / $height;
>
> if (($width <= $max_width) && ($height <= $max_height)) {
>    $tn_width = $width;
>    $tn_height = $height;
> }
> elseif (($x_ratio * $height) < $max_height) {
>    $tn_height = ceil($x_ratio * $height);
>    $tn_width = $max_width;
> }
> else {
>    $tn_width = ceil($y_ratio * $width);
>    $tn_height = $max_height;
> }
>
> $src = ImageCreateFromJpeg ($image);
> $dst = ImageCreate ($tn_width, $tn_height);
> ImageCopyResized ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height,
$width,
> $height);
> header ("Content-type: image/jpg");
> ImageJpeg ($dst, null, -1);
> ImageDestroy ($src);
> ImageDestroy ($dst);
>
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

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

Just wondering, If I have a query like:

$query = "SELECT name FROM users";
$ret = mysql_query($query);
while(list($name) = mysql_fetch_row($ret)) or die("Error: ".mysql_error());
print ("your name is $name);

$query_update ["name"] = ("UPDATE my_other_table set name = $name");
$result = mysql_query($query_update["name"]);
or die("Error: ".mysql_error());

Why wont this work?

I am trying to select the user name from the user table and then update
another table with that user name. But it doesn't seem to want to update the
other table

I get no errors when running the script.

Thanks in advance
Jennifer Downey


--- End Message ---
--- Begin Message ---
You need to put {} in the while function like this

while.... {
do this
}


$query = "SELECT name FROM users";
$ret = mysql_query($query);
while(list($name) = mysql_fetch_row($ret)) or die("Error: ".mysql_error()) {
print ("your name is $name);

$query_update["name"] = ("UPDATE my_other_table set name = $name");
$result = mysql_query($query_update["name"]);
or die("Error: ".mysql_error());
};


23/03/2002 20:58:14, "Jen Downey" <[EMAIL PROTECTED]> wrote:

>Hi all!
>
>Just wondering, If I have a query like:
>
>$query = "SELECT name FROM users";
>$ret = mysql_query($query);
>while(list($name) = mysql_fetch_row($ret)) or die("Error: ".mysql_error());
>print ("your name is $name);
>
>$query_update ["name"] = ("UPDATE my_other_table set name = $name");
>$result = mysql_query($query_update["name"]);
>or die("Error: ".mysql_error());
>
>Why wont this work?
>
>I am trying to select the user name from the user table and then update
>another table with that user name. But it doesn't seem to want to update the
>other table
>
>I get no errors when running the script.
>
>Thanks in advance
>Jennifer Downey
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>




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



-------- End of forwarded message --------




--- End Message ---
--- Begin Message ---
On Fri, 22 Mar 2002, Erik Price wrote:
> I have noticed that pressing enter in IE does achieve the same effect as 
> pressing the "submit" button for my forms.  But I have also heard that 
> it's not really "the same", especially if there are more than one 
> "submit"-style inputs for the given form.  What does Enter "really" do 
> in IE?

To be safe, I usually include a hidden variable with a unique name in the 
form (<input type="hidden" name="whichform" value="login">). That way, no 
matter what browsers do about the Enter key, I still know what's going on.

miguel

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

I have some problems related to a site in Russian (I don't speak Russian
myself, so I can't consult tutorials in Russian). 

The encoding, passed via HTML, is koi8-r. Then the form will be
submitted and PHP will send out an e-mail with the encoding koi8-r. 

Everything seems to work fine now, but there are problems with data from
the <.SELECT> boxes. 

The e-mail response. Comments marked with "//": 
************ START ****************
Kliendi info: 
   Nimi:   
   Telefon:   
   E-post: simberg@********.com 

Pring: 
   Kategooria:                       // should be ""
   Sihtpunkt:   
   Lhtepunkt:                   // should be ""
   Kuupevad:   
   Lisatingimused:  
************ END ******************

The form itself lies at http://www.sputnik.ee/new/vorm_4_rus.php 

Thanks,
Lauri
--
Tharapita Creations
[dynamic web applications]
[EMAIL PROTECTED]
Mobile: +372 53 410 610 

--- End Message ---

Reply via email to