Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread John Nichel
Freedomware wrote:
Ryan A wrote:

"It installed pretty easy and the guy who makes it is real cool

and will help you via the forum. Also options to run other things like
PERL"


Thanks for the tip. You raised one other question I have - PERL.

I know nothing about it, but I just wondered how it fits into the big 
scheme of things. Am I correct in understanding that PHP is, in the 
broadest sense, a more user friendly PERL equivalent, and that people 
who have mastered PHP still use PERL for doing certain advanced 
functions that PHP can't handle?

PHP and Perl really aren't interchangeable.  There are alot of tasks 
that they can both do, and I'm sure a few items that one can handle that 
the other cannot, but it all boils down to what you want to do.  If all 
you're wanting to do with a programming language is create web sites and 
middle-tier web applications, stick with PHP.  Perl can handle it quite 
well, but wasn't designed for that task, whereas PHP was/is.  I cut my 
teeth on Perl in the mid-90's, and still use it today for some system 
admistration tasks, but I can't think of a reason where I would choose a 
Perl CGI script over a PHP application for web development.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] How do I write to an XML file

2004-01-12 Thread Tim Burgan
Hello,

I'm wondering if anyone can help me or point me in the right direction
regarding how I can write to an XML file.

I'm new to PHP - I've just figured out how to basically write data to a
text file.

What I want to do is have a user submit data (email address & a question)
via a form that is written to the xml file, then have a  support person
add an answer to the xml file.

Any help would be greatly appreciated.

Thanks
Tim Burgan

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



Re: [PHP] view outputed headers?

2004-01-12 Thread Mirek Novak
try mozilla & livehttpheaders from http://livehttpheaders.mozdev.org

Scott Taylor wrote:
What is the easiest way to view the headers that a PHP page has put 
--
Mirek Novak
jabberID: [EMAIL PROTECTED]
ICQ: 119499448
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread Freedomware
OK, here are three more questions:

1. I visited Apache's download page at 
http://httpd.apache.org/download.cgi  It says the best version to 
download is 2.0.48.

Then it lists the following:

Unix Source: httpd-2.0.48.tar.gz [PGP] [MD5]
Unix Source: httpd-2.0.48.tar.Z [PGP] [MD5]
Win32 Source: httpd-2.0.48-win32-src.zip [PGP] [MD5]
Win32 Binary (MSI Installer): apache_2.0.48-win32-x86-no_ssl.msi [PGP] 
[MD5]
Other files

My operating system is Windows XP Pro, so I assume I want to download 
Win32 Source or Win32 Binary - but which one? What's a MSI Installer?

2. Do you know of any instructions for disabling the Windows IIS server 
before I install Apache? I remember going through this process before, 
and it was quite a hassle.

3. What's the best PHP program to download, and would I download it from 
 www.php.net?

Thanks!

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


[PHP] Making coockies valid for multiple domains possible?

2004-01-12 Thread Merlin
Hello everybody,

I am working on translating my site into multiple languages (i18n). Each 
different language is hosted on the same server, but on a different 
subdomain.

example:
de.server.com - german
en.server.com - english
Here comes the problem. Sessions are validated through coockies on my 
site. The system checks if the coockie is valid and compares it with a 
sessionid inside the database.

It seems to me that coockies are only valid for one domain for security 
reasons.

QUESTION:
Is there a way to make that coockie valid for multiple domains?
Thank you for any help on that.

Regards,

Merlin

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


Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread Freedomware
Scratch the first two questions - I figured out the MIS Installer and 
downloaded it, and it looks like the IIS server isn't installed on my 
computer.

But a couple other questions popped up when I began installing Apache:

What do I type in for "Network Domain" and "Server Name"?

I have over a dozen websites, or are they asking for information that 
relates to my computer?

Or should I just pick my biggest website and list www.geobop.org under 
"Network Domain," then get the "Server Name" from my ISP?

Thanks.

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


Re: [PHP] Making coockies valid for multiple domains possible?

2004-01-12 Thread Jake McHenry

- Original Message - 
From: "Merlin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 3:56 AM
Subject: [PHP] Making coockies valid for multiple domains possible?


> Hello everybody,
>
> I am working on translating my site into multiple languages (i18n). Each
> different language is hosted on the same server, but on a different
> subdomain.
>
> example:
> de.server.com - german
> en.server.com - english
>
> Here comes the problem. Sessions are validated through coockies on my
> site. The system checks if the coockie is valid and compares it with a
> sessionid inside the database.
>
> It seems to me that coockies are only valid for one domain for security
> reasons.
>
> QUESTION:
> Is there a way to make that coockie valid for multiple domains?
>
> Thank you for any help on that.
>
> Regards,
>
> Merlin
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>





I've read the pages, it doesn't give very good examples from what I've seen,
but here is the page:


http://us2.php.net/manual/en/ref.session.php#ini.session.cookie-domain

Someone correct me if I'm wrong, but if you set this in your php.ini or with
session_set_cookie_params() to server.com, it's valid across any sub
domains, whereas if you set it to de.server.com, it would only be valid in
the de.server.com sub domain.

Or possibly try *server.com. I havn't played with this, since I only use
cookies when I manually set them, not for sessions.


Hope this helps,

Jake

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



[PHP] Re: Making coockies valid for multiple domains possible?

2004-01-12 Thread Pavel Janda
"Merlin" <[EMAIL PROTECTED]> píse v diskusním príspevku
news:[EMAIL PROTECTED]
> Hello everybody,
>
> I am working on translating my site into multiple languages (i18n). Each
> different language is hosted on the same server, but on a different
> subdomain.
>
> example:
> de.server.com - german
> en.server.com - english
>
> Here comes the problem. Sessions are validated through coockies on my
> site. The system checks if the coockie is valid and compares it with a
> sessionid inside the database.
>
> It seems to me that coockies are only valid for one domain for security
> reasons.
>
> QUESTION:
> Is there a way to make that coockie valid for multiple domains?

Yes, it is...

See: http://cz.php.net/manual/en/function.setcookie.php

When you set parametr domain to ".server.com" - see carfully, there are two
dots :) - the cookie will be available for all subdomains...

PJ

>
> Thank you for any help on that.
>
> Regards,
>
> Merlin

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



Re: [PHP] Making coockies valid for multiple domains possible?

2004-01-12 Thread Pavel Janda
> Someone correct me if I'm wrong, but if you set this in your php.ini or
with
> session_set_cookie_params() to server.com, it's valid across any sub
> domains, whereas if you set it to de.server.com, it would only be valid in
> the de.server.com sub domain.
>
> Or possibly try *server.com. I havn't played with this, since I only use
> cookies when I manually set them, not for sessions.

As written on http://cz.php.net/manual/en/function.setcookie.php
"server.com" should be enought, bud it's recommended to use ".server.com"...
PJ

>
>
> Hope this helps,
>
> Jake

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



Re: [PHP] How do I write to an XML file

2004-01-12 Thread Richard Davey
Hello Tim,

Monday, January 12, 2004, 7:20:07 AM, you wrote:

TB> I'm new to PHP - I've just figured out how to basically write data to a
TB> text file.

TB> What I want to do is have a user submit data (email address & a question)
TB> via a form that is written to the xml file, then have a  support person
TB> add an answer to the xml file.

XML files are just plain text files. If you can write to text files
already then you can write to/create an XML file too.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread DvDmanDT
Well, server name is your main domain... Network domain... Hmm... Not sure
if that's where you enter your IP or your top-level domain...

Try network domain: geobop.org, servername: www.geobop.org... The installer
is just confusing really.. It's much easier to just open httpd.conf in
notepad.. It's very well explained.. :)

About PHP... Download PHP from snaps.php.net, to the right, there's windows
vversions of 4.3.* and 5.0.*... They are the development verisons however...
Usually works (I use them)...

If IIS is installed... Goto the services controll panel and disable it...

If you got dozens domains, mod_l33t is highly recommended, but it's only for
Apache 1.3 which I use under both Me, 2k and XP btw... Apache 2.0 just cause
problems with PHP... Well, I haven't really confirmed it yet, but if you
read on the php.net manual page, you'll see it's not recommended yet...
Unless you run as CGI which I wouldn't recommend for anything in this
world... It's much slower, and the computer is slowed down noticably after
about 50 requests... At least it was like that for me with my old setup...

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Scratch the first two questions - I figured out the MIS Installer and
> downloaded it, and it looks like the IIS server isn't installed on my
> computer.
>
> But a couple other questions popped up when I began installing Apache:
>
> What do I type in for "Network Domain" and "Server Name"?
>
> I have over a dozen websites, or are they asking for information that
> relates to my computer?
>
> Or should I just pick my biggest website and list www.geobop.org under
> "Network Domain," then get the "Server Name" from my ISP?
>
> Thanks.

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



Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread Freedomware
Dvdmandt wrote:

If you got dozens domains, mod_l33t is highly recommended, but it's only for
Apache 1.3 which I use under both Me, 2k and XP btw... Apache 2.0 just cause
problems with PHP... Well, I haven't really confirmed it yet, but if you
read on the php.net manual page, you'll see it's not recommended yet...
Unless you run as CGI which I wouldn't recommend for anything in this
world... It's much slower, and the computer is slowed down noticably after
about 50 requests... At least it was like that for me with my old setup...
Thanks for the tips, but there's one thing I should point out - I won't 
actually be using Apache with my online domains (at least, I don't think 
so). I'm just going to use it on my computer to preview and test web 
pages before I publish them to my websites, which are hosted by ISP's 
that use Apache servers.

But if I'm using it only locally, and I also have PHP on my computer, 
then I should probably take your advice and download Apache 1.3.

I'm not really sure what I'm talking about (yet), but it should become 
clearer once I get Apache installed!

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


Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread DvDmanDT
Nothing wrong with having 3 versions of Apache 1.3 and 5 or so of Apache 2..
.:) I got PHP4.3.4, 3.0.17, 5.0RC1-dev, at least 5 different perl versions,
two versions of TCL, same with python, I got Apache modules for all of these
as well... Sure isn't nessecary, but I'm sure learning lots from it...

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Dvdmandt wrote:
>
> > If you got dozens domains, mod_l33t is highly recommended, but it's only
for
> > Apache 1.3 which I use under both Me, 2k and XP btw... Apache 2.0 just
cause
> > problems with PHP... Well, I haven't really confirmed it yet, but if you
> > read on the php.net manual page, you'll see it's not recommended yet...
> > Unless you run as CGI which I wouldn't recommend for anything in this
> > world... It's much slower, and the computer is slowed down noticably
after
> > about 50 requests... At least it was like that for me with my old
setup...
> >
>
> Thanks for the tips, but there's one thing I should point out - I won't
> actually be using Apache with my online domains (at least, I don't think
> so). I'm just going to use it on my computer to preview and test web
> pages before I publish them to my websites, which are hosted by ISP's
> that use Apache servers.
>
> But if I'm using it only locally, and I also have PHP on my computer,
> then I should probably take your advice and download Apache 1.3.
>
> I'm not really sure what I'm talking about (yet), but it should become
> clearer once I get Apache installed!

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



Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread DvDmanDT
Also, I feel like I wanna tell yo some about myself, so you don't make your
descissions cause of me.. I'm 14 years old, live in sweden, learning
programming in C right now (made my first PHP module a week ago.. :)) I also
play around some with Apache 1.3 Api... I've been using PHP since 4.1.. I've
helped lots of friends with installation though...

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Dvdmandt wrote:
>
> > If you got dozens domains, mod_l33t is highly recommended, but it's only
for
> > Apache 1.3 which I use under both Me, 2k and XP btw... Apache 2.0 just
cause
> > problems with PHP... Well, I haven't really confirmed it yet, but if you
> > read on the php.net manual page, you'll see it's not recommended yet...
> > Unless you run as CGI which I wouldn't recommend for anything in this
> > world... It's much slower, and the computer is slowed down noticably
after
> > about 50 requests... At least it was like that for me with my old
setup...
> >
>
> Thanks for the tips, but there's one thing I should point out - I won't
> actually be using Apache with my online domains (at least, I don't think
> so). I'm just going to use it on my computer to preview and test web
> pages before I publish them to my websites, which are hosted by ISP's
> that use Apache servers.
>
> But if I'm using it only locally, and I also have PHP on my computer,
> then I should probably take your advice and download Apache 1.3.
>
> I'm not really sure what I'm talking about (yet), but it should become
> clearer once I get Apache installed!

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



Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread Freedomware
Dvdmandt wrote:

Also, I feel like I wanna tell yo some about myself, so you don't make your
descissions cause of me.. I'm 14 years old, live in sweden, learning
programming in C right now (made my first PHP module a week ago.. :)) I also
play around some with Apache 1.3 Api... I've been using PHP since 4.1.. I've
helped lots of friends with installation though...
Holy cow, you know more about computers than I do, speak two languages, 
and you're safe from President George W. Bush.

I'm jealous! :)

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


Re: [PHP] Returning Newbie (Disoriented)

2004-01-12 Thread DvDmanDT
Swedish, English, and in few hours I'm gonna have french as well...
Although, my primary language would still be PHP... :s Sweden is a really
nice place really.. :)

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Dvdmandt wrote:
>
> > Also, I feel like I wanna tell yo some about myself, so you don't make
your
> > descissions cause of me.. I'm 14 years old, live in sweden, learning
> > programming in C right now (made my first PHP module a week ago.. :)) I
also
> > play around some with Apache 1.3 Api... I've been using PHP since 4.1..
I've
> > helped lots of friends with installation though...
> >
>
> Holy cow, you know more about computers than I do, speak two languages,
> and you're safe from President George W. Bush.
>
> I'm jealous! :)

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



Re: [PHP] writing Excel files through PHP

2004-01-12 Thread Tristan . Pretty
You know, I've been struggling with this probelm fr ages, and wouldn't you 
know it, I really over complicated things..
using this simple header method, I've done it...

Cheers for the heads up...
It pays to read eh? ;-)

Tris..





Marek Kilimajer <[EMAIL PROTECTED]> 
10/01/2004 13:22

To
Binay <[EMAIL PROTECTED]>
cc
[EMAIL PROTECTED]
Subject
Re: [PHP] writing Excel files through PHP






Use full uri. But the user needs to be online while viewing the xls file.

Other option is to create web archive. It's a mime encoded file, save an 
excel file with an embeded image and you will see what it is.

Binay wrote:
> Hi all,
> 
> I m generating an Excel file though PHP by sending the appropriate 
header and then using HTML  tags to write data in different cells. 
Below is my code snippet.
> 
> It has got 1 problems:
> 
> 1. Image doesn't come/showup in Excel sheet.
> 
>  
> header("Content-type: application/vnd.ms-excel");
> header("Content-disposition: attachment; filename=pareto_combined.xls");
> ?>
> 
> 
>   
>  
>  
> 
>  $dateF=$_REQUEST['dateF']; 
> 
> $dateT=$_REQUEST['dateT'];
> 
> $agentID=$_REQUEST['agentID'];
> 
> 
> 
> 
> 
> 
> ?>
> 
> now after saving the Excel file it displays all alphanumeric data 
correctly but images do not show up. i think Img tag is not supported by 
Excel application. 
> 
> So my question is how can i display the images in Excel using PHP? plz 
help me out 
> 
> Thanks in advance
> 
> Binay 
> 
> 
> 

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




*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] writing Excel files through PHP

2004-01-12 Thread Marek Kilimajer
Binay wrote:
+
How to create web archvie which will be mime encoded file and then saving as
excel file .. plz direct me to the resources where i can find more
information about it  .. or tell me how can i proceed to it.
Thanks
+
Web archive is a simple textfile (zipped if I remember well) very 
similar to multipart emails. To see how it looks save a spreadsheet in 
web archive format, give the file zip extension and unzip it.

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


[PHP] Re: Hiding files away from /public_html/

2004-01-12 Thread nabil
greetings
Would you tell us how to create a script to read these files, extract their
contents and create temporary PNG/JPG/GIF files on the fly ??
in this case we can (as u said) store the pictures content in the mysql and
output them when we like
Regards


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi Philip,
>
> On 10 Jan 2004 at 12:42, Philip J. Newman wrote:
>
> > I want to store some images outside the /public_html/ how ever my isp
> > has decided that i'm not aloud to write files in that area.  Would the
> > next best solution that wold be as secure to maybe put them in a folder
> > with a .htaccess file in it?
>
> You could use an htaccess file, but: (a) the Apache web server must be
configured to
> allow htaccess to over-ride authentication settings (which, from what
you've told us, is
> something you'll have no control over); (b) you'd need to upload an
htpasswd file
> containing username and passwords pairs to the webserver, but wouldn't be
able to
> save it to an off-web directory; and (c) the htaccess file would prevent
your own scripts
> from accessing the image files, which would mean that the user viewing a
page with a
> protected image would need to type a username and password in order for
the image to
> be displayed. Doesn't sound like the best solution to me.
>
> Do you have access to a database? One solution would be to store all
images on a
> database and have the image files generated dinamically via PHP. That
would imply in
> some overhead, but it would be fairly secure. If you like the idea, let me
know and I'll tell
> you how I've implemented it in the past.
>
> Another much more complicated solution would be to rename your image files
with a
> PHP extension (thus protecting their contents) and create a script to read
these files,
> extract their contents and create temporary PNG/JPG/GIF files on the fly.
>
> Good luck,
>
> Erik

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



[PHP] Did I choose the correct download?

2004-01-12 Thread Freedomware
My operating system is Windows XP Pro. I was advised to download Apache 
1.3 if I want to work with PHP, so I went to 
http://httpd.apache.org/download.cgi and found the Apache 1.3 download 
section.

It offered the following choices:

* Unix Source: apache_1.3.29.tar.gz [PGP] [MD5]
* Unix Source: apache_1.3.29.tar.Z [PGP] [MD5]
* Win32 Binary (Self extracting): 
apache_1.3.29-win32-x86-no_src.exe [PGP] [MD5]
* Other files

I assumed Win32 was for all Windows programs, but the first line of the 
README file says, "Apache is an HTTP server, originally designed for 
Unix systems. This is the version of Apache for Microsoft Windows 2000, 
NT, 98, and 95 systems."

Why doesn't it mention Windows XP? Do I need to download another program?

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


Re: [PHP] Did I choose the correct download?

2004-01-12 Thread Richard Davey
Hello,

Monday, January 12, 2004, 10:58:56 AM, you wrote:

F> Why doesn't it mention Windows XP? Do I need to download another program?

The readme hasn't been updated. XP is a modified 2K/NT core anyway.
It'll work just fine.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] Did I choose the correct download?

2004-01-12 Thread Freedomware
OK, thanks.

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


[PHP] Apache - Previewing Pages with Dreamweaver

2004-01-12 Thread Freedomware
Well, I downloaded Apache and PHP, installed Apache, and was had a bunch 
of questions to ask - until I tested Apache and discovered it's already 
working!

I go into Start Programs, then click Control Apache Server > Start, and 
the little black window opens. I click  to close it.

But before I wade through all the documentation, I thought I might speed 
things up by cutting to the chase. My first goal is to be able to 
preview web pages made with Dreamweaver on my new Apache server. Then 
I'll install PHP and get it up and running.

In preparation for using Apache/PHP, I began listing PHP/MySQL as the 
testing server in my site definitions. (Apache isn't listed as a choice.)

That screwed things up immediately, but I could access my pages by 
simply accessing a web page I created with links to all the websites on 
my computer.

Now that I have Apache installed, I need to figure out what I have to 
fix in either Apache or Dreamweaver so that I can preview pages directly 
in Dreamweaver.

The URL prefix for each of my defined websites is http://localhost/

I just discovered that if I try to preview the home page of a website 
that has NOT been defined, I get the following message:

"To preview pages containing server-side code, you need a testing 
server. Would you like to specify one now?"

If I go through the process, choosing PHP/MySQL, I get an error message. 
But if I cancel out of the process, the page defaults to the correct 
URL, such as file:///C:/sites/geobop/index.php or 
file:///C:/sites/geobop/index.php

So here are three questions:

1. Do I need to fix something in Dreamweaver or Apache?

2. When everything's correctly set up, should the URL's of web pages on 
my computer begin with file:///C:/sites/ or "localhost"?

3. Since my testing server is PHP/MySQL, does that mean I won't be able 
to preview my pages at all until I've also installed PHP?

Thanks.

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


[PHP] Re: Apache - Previewing Pages with Dreamweaver

2004-01-12 Thread Freedomware
P.S. Should I go ahead and install PHP, or should I wait until I'm able 
to preview pages on my new Apache server?

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


RE: [PHP] php doesn't work in html files

2004-01-12 Thread Nico Berg
Hi,

It works. I decided to add .html to the list of extensions that will be
opend by php if asked for in apache. I understand here that it will take
more time before html files are processed? True?

Thanks all, Nico Berg

> -Oorspronkelijk bericht-
> Van: Nico Berg [mailto:[EMAIL PROTECTED]
> Verzonden: zondag 11 januari 2004 14:05
> Aan: 'PHP General'
> Onderwerp: [PHP] php doesn't work in html files
>
>
> Hi there all,
>
> I use Apache version 1.3 and WIndows 2000. The site is not global but only
> local so I use the url http://localhost/index.html
>
> This index.html look's like this:
>
> 
> 
> This is a line
> 
> 
>
>  echo "this is the second line";
> ?>
>
> Output is: This is a line
>
> So the php part is not done at all. Is that right? I always believed php
> should work in html?
>
> Nico
>
> --
> 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] I am totally nuts/banana. Please somebody help me with an include problem.

2004-01-12 Thread Webmaster
Hello,

please can somebody help me. I am going nuts.
Really I am close to totally freaking out.

I have a problem that seems minor and ridiculous but cost me already 3
working days.

I have a working php/mysql homepage and used to use Ommnihttpd until 3 days
ago.
I installed the latest versions of Apache and php4 3 days ago on Windows
2000.

No matter what I do my script can not include another file from a directory
on the same level in the directory tree.

I have the following directory structure:

c:\webpage\classes\_dentonaproject\page_dentona.class.php
c:\webpage\classes\design\page.class.php

In the file page_dentona.class.php the first line says the following:

require_once('../design/page.class.php');

The following error message comes up:

 Warning: main(../design/page.class.php): failed to open stream: No such
file or directory in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2

Fatal error: main(): Failed opening required '../design/page.class.php'
(include_path='.;c:\php4\pear') in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2


I wrote a test.php file in the _dentonaproject directory:



and put this into the design directory:



and it works fine.

What could be the problem. Really I am getting grey hair.
Is there ANYTHING in the php.ini file httpd.conf that could cause this?

I looked them over about 50 times.
Thx webmaster

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



RE: [PHP] Exception number: c0000005 (access violation

2004-01-12 Thread Jay Blanchard
[snip]
I have 4.3.5-dev (Build Dec-22-2003) installed on a W2K Dell Inspiron
7500
and I am getting an error which I don't get with 4.1.1 and 4.3.4. Would
like
to learn how to debug things like that. Here is a dump of Dr. Watson:
[/snip]

You will probably want to send this to the PHP developers list. Usually
a memory access problem indicatas that two processes are attempting to
use the same memory location.

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



RE: [PHP] I am totally nuts/banana. Please somebody help me with an include problem.

2004-01-12 Thread Jay Blanchard
[snip]
please can somebody help me. I am going nuts.
Really I am close to totally freaking out.
[/snip]

Sorry to hear that

[snip]
In the file page_dentona.class.php the first line says the following:

require_once('../design/page.class.php');

The following error message comes up:

 Warning: main(../design/page.class.php): failed to open stream: No such
file or directory in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2

Fatal error: main(): Failed opening required '../design/page.class.php'
(include_path='.;c:\php4\pear') in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2

What could be the problem. Really I am getting grey hair.
Is there ANYTHING in the php.ini file httpd.conf that could cause this?

[/snip]

Have you tried putting the full path in the include or require
statement? Did you use Apache 2 (not a good idea yet)?

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



[PHP] PHP Installation Questions

2004-01-12 Thread Freedomware
I'm running Windows XP Pro and just installed Apache 1.3. It appears to 
be running, so I guess I'm ready to install PHP.

I visited http://snaps.php.net and downloaded the latest PHP program - 
CVS (5.0.x-dev). I'm reading the installation instructions at 
http://cvs.php.net/co.php/php-src/win32/install.txt and find them fairly 
confusing.

First, it says, "There are two main ways to install PHP for Windows: 
either manually or by using the InstallShield installer."

I definitely want to do it the easy way, but how do I access the 
InstallShield installer?

But it appears that I first have to do two other things:

1. Stop Apache

2. Decide whether I want to install PHP as a CGI or something else (a 
module?)

So how do I stop Apache, and should I install PHP as a CGI or choose the 
other option? I'm going to be using PHP on websites, primarily to make 
server side includes and, eventually, to do some work with databases.

The instructions say, "Once the installation has completed the installer 
will inform you if you need to restart your system, restart the server, 
or just start using PHP."

I assume this refers to using the InstallShield, which renders just 
about everything else on the installation instructions page moot, right?

If I use the InstallShield, will I still have to install the Windows 
extensions, or are they installed automatically?

Later, the instructions talk about Installing PHP on Windows with Apache 
1.3.x. It says, "There are two ways to set up PHP to work with Apache 
1.3.x on Windows. One is to use the CGI binary (php.exe), the other is 
to use the Apache module dll. In either case you need to stop the Apache 
server, and edit your httpd.conf or srm.conf to configure Apache to work 
with PHP. We'll refer to either of these files with httpd.conf in the text."

Is this all done automatically if I use the InstallShield?

Thanks.

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


Re: [PHP] I am totally nuts/banana. Please somebody help me with an include problem.

2004-01-12 Thread Burhan Khalid
Jay Blanchard wrote:

[snip]
please can somebody help me. I am going nuts.
Really I am close to totally freaking out.
[/snip]
Sorry to hear that

[snip]
In the file page_dentona.class.php the first line says the following:
require_once('../design/page.class.php');

The following error message comes up:

 Warning: main(../design/page.class.php): failed to open stream: No such
file or directory in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2
Fatal error: main(): Failed opening required '../design/page.class.php'
(include_path='.;c:\php4\pear') in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2
What could be the problem. Really I am getting grey hair.
Is there ANYTHING in the php.ini file httpd.conf that could cause this?
[/snip]
The problem here is that you are using forward slashes ( / ) when your 
operating system uses back slashes ( \ ) to distinguish directories.

If you change your include statement so that is uses back slashes ( \ ), 
it should work.

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


Re: [PHP] PHP Installation Questions

2004-01-12 Thread John Nichel
Freedomware wrote:
I'm running Windows XP Pro and just installed Apache 1.3. It appears to 
be running, so I guess I'm ready to install PHP.

I visited http://snaps.php.net and downloaded the latest PHP program - 
CVS (5.0.x-dev). I'm reading the installation instructions at 
http://cvs.php.net/co.php/php-src/win32/install.txt and find them fairly 
confusing.

First, it says, "There are two main ways to install PHP for Windows: 
either manually or by using the InstallShield installer."

I definitely want to do it the easy way, but how do I access the 
InstallShield installer?

But it appears that I first have to do two other things:

1. Stop Apache

2. Decide whether I want to install PHP as a CGI or something else (a 
module?)

So how do I stop Apache, and should I install PHP as a CGI or choose the 
other option? I'm going to be using PHP on websites, primarily to make 
server side includes and, eventually, to do some work with databases.

The instructions say, "Once the installation has completed the installer 
will inform you if you need to restart your system, restart the server, 
or just start using PHP."

I assume this refers to using the InstallShield, which renders just 
about everything else on the installation instructions page moot, right?

If I use the InstallShield, will I still have to install the Windows 
extensions, or are they installed automatically?

Later, the instructions talk about Installing PHP on Windows with Apache 
1.3.x. It says, "There are two ways to set up PHP to work with Apache 
1.3.x on Windows. One is to use the CGI binary (php.exe), the other is 
to use the Apache module dll. In either case you need to stop the Apache 
server, and edit your httpd.conf or srm.conf to configure Apache to work 
with PHP. We'll refer to either of these files with httpd.conf in the 
text."

Is this all done automatically if I use the InstallShield?

Thanks.

  I don't want to sound like a jerk, but most of the questions you have 
been asking are thoroughly documented on places like the PHP and Apache 
websites, and in the README files.  This list is here to help, but it's 
best if you do a bit of research first before posting a question to it. 
 Check the documentation of the app you have a question about first, if 
you don't find the answer there, try Google, if still no luck, then this 
list is a good "next stop".  As for your questions

Installing PHP...
http://www.php.net/manual/en/install.windows.php
Stopping Apache 1.3x...
http://httpd.apache.org/docs/windows.html#signal
Stopping Apache 2.x...
http://httpd.apache.org/docs-2.0/platform/windows.html#winsvc
HTH

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] I am totally nuts/banana. Please somebody help me with an include problem.

2004-01-12 Thread Ford, Mike [LSS]
On 12 January 2004 13:29, Burhan Khalid wrote:

> Jay Blanchard wrote:
> 
> > [snip]
> > please can somebody help me. I am going nuts.
> > Really I am close to totally freaking out.
> > [/snip]
> > 
> > Sorry to hear that
> > 
> > [snip]
> > In the file page_dentona.class.php the first line says the
> > following: 
> > 
> > require_once('../design/page.class.php');
> > 
> > The following error message comes up:
> > 
> >  Warning: main(../design/page.class.php): failed to open stream: No
> > such file or directory in 
> > 
> D:\dentona_new\classes\_dentonaproject\page_dentona.class.php
> on line 2
> > 
> > Fatal error: main(): Failed opening required
> > '../design/page.class.php' (include_path='.;c:\php4\pear') in
> > 
> D:\dentona_new\classes\_dentonaproject\page_dentona.class.php
> on line 2
> > 
> > What could be the problem. Really I am getting grey hair.
> > Is there ANYTHING in the php.ini file httpd.conf that could cause
> > this? 
> > 
> > [/snip]
> 
> The problem here is that you are using forward slashes ( / )
> when your
> operating system uses back slashes ( \ ) to distinguish directories.

That should not be a problem -- PHP translates for you if necessary.  In
fact, it's probably better to use forward slashes since (a) it's portable
between platforms and (b) you don't have to worry about escaping backslashes
in double quotes.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] How do I write to an XML file

2004-01-12 Thread memoimyself
Hello Tim,

On 12 Jan 2004 at 17:50, Tim Burgan wrote:

> I'm wondering if anyone can help me or point me in the right direction
> regarding how I can write to an XML file. 

Writing to an XML file works the same way as writing to any other file: you need to 
open 
the file with fopen(), append to or overwrite the file contents with fwrite(), and 
close the 
file with fclose().

However, In order to do something useful with the XML in your files, you'll also want 
to 
read the file right after opening it (i.e. before writing anything to it), parse the 
XML, insert 
new elements/attributes/text nodes into the XML, and then write that to the file.

The XML parsing and manipulating can be accomplished with the DOM XML functions  
(see chapter XXIV of the function reference section of the PHP manual) or the XML 
Parser (Expat) functions (see chapter CXI of the function reference section of the PHP 
manual). Both sets of functions are PHP extensions, which means they are not enabled 
by default; on *nix systems, you need to compile these extensions when installing PHP, 
 
and on Windows systems you need to enable the extensions in the php.ini file.

Alternatively, if you cannot or don't want to install/reinstall PHP on the web server 
you're 
going to use, you can use PHP classes that emulate the DOM XML extension. The best 
ones I know of are miniXML (http://minixml.psychogenic.com) and Domit! 
(http://www.engageinteractive.com/domit/); both are free and come with fairly good 
documentation that will explain how to use them. There probably are a couple of 
classes out there to do Expat-style (chunk by chunk) parsing, but in your case you'll 
probably want to stick with DOM-style parsing.

Good luck,

Erik


[PHP] Re: PHP Installation Questions

2004-01-12 Thread DvDmanDT
Errm... Just unzip the php zip, so that php.exe is located in c:\php (or D:\
or something).. For example C:\php\php.exe... Then, find your Apache config
file in the Apache\conf folder, named httpd.conf.. Open it, scroll down to
the bottom, then add

LoadFile C:/PHP/php5ts.dll
LoadModule C:/PHP/php5Apache.dll
AddType application/x-httpd-php .php .php5
AddType application/x-httpd-php-source .phps

Then restart Apache, 'NET STOP Apache', 'NET START Apache' for example...
php.net/manual/en/, click install..
-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> I'm running Windows XP Pro and just installed Apache 1.3. It appears to
> be running, so I guess I'm ready to install PHP.
>
> I visited http://snaps.php.net and downloaded the latest PHP program -
> CVS (5.0.x-dev). I'm reading the installation instructions at
> http://cvs.php.net/co.php/php-src/win32/install.txt and find them fairly
> confusing.
>
> First, it says, "There are two main ways to install PHP for Windows:
> either manually or by using the InstallShield installer."
>
> I definitely want to do it the easy way, but how do I access the
> InstallShield installer?
>
> But it appears that I first have to do two other things:
>
> 1. Stop Apache
>
> 2. Decide whether I want to install PHP as a CGI or something else (a
> module?)
>
> So how do I stop Apache, and should I install PHP as a CGI or choose the
> other option? I'm going to be using PHP on websites, primarily to make
> server side includes and, eventually, to do some work with databases.
>
> The instructions say, "Once the installation has completed the installer
> will inform you if you need to restart your system, restart the server,
> or just start using PHP."
>
> I assume this refers to using the InstallShield, which renders just
> about everything else on the installation instructions page moot, right?
>
> If I use the InstallShield, will I still have to install the Windows
> extensions, or are they installed automatically?
>
> Later, the instructions talk about Installing PHP on Windows with Apache
> 1.3.x. It says, "There are two ways to set up PHP to work with Apache
> 1.3.x on Windows. One is to use the CGI binary (php.exe), the other is
> to use the Apache module dll. In either case you need to stop the Apache
> server, and edit your httpd.conf or srm.conf to configure Apache to work
> with PHP. We'll refer to either of these files with httpd.conf in the
text."
>
> Is this all done automatically if I use the InstallShield?
>
> Thanks.

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



[PHP] how to open a webpage

2004-01-12 Thread bernard
Hi,
I am new to php and doing reasonable well (ok, copying other code and
learning ;-)

I have a field with an URL
The value of this in a variable $launch.

How can I open this URL automatically ??

TIA!!
Bernard
Antwerp, Belgium

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



[PHP] Re: PHP Installation Questions

2004-01-12 Thread Freedomware
Dvdmandt wrote:
Errm... Just unzip the php zip, so that php.exe is located in c:\php (or D:\
or something).. For example C:\php\php.exe... Then, find your Apache config
file in the Apache\conf folder, named httpd.conf.. Open it, scroll down to
the bottom, then add
LoadFile C:/PHP/php5ts.dll
LoadModule C:/PHP/php5Apache.dll
AddType application/x-httpd-php .php .php5
AddType application/x-httpd-php-source .phps
Then restart Apache, 'NET STOP Apache', 'NET START Apache' for example...
php.net/manual/en/, click install..


H... I can't locate a file named httpd.conf, but the conf folder 
contains two files named httpd and httpd.default, which appear to be 
identical twins.

They both end with this:

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
#ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /www/docs/dummy-host.example.com
#ServerName dummy-host.example.com
#ErrorLog logs/dummy-host.example.com-error_log
#CustomLog logs/dummy-host.example.com-access_log common
#
* * * * * * * * * *

So I'm assuming you're teling me to change it to this:

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
#ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /www/docs/dummy-host.example.com
#ServerName dummy-host.example.com
#ErrorLog logs/dummy-host.example.com-error_log
#CustomLog logs/dummy-host.example.com-access_log common
#
LoadFile C:/PHP/php5ts.dll
LoadModule C:/PHP/php5Apache.dll
AddType application/x-httpd-php .php .php5
AddType application/x-httpd-php-source .phps
* * * * * * * * * *

Right? And do you think I should do it to the httpd file, the 
httpd.default file or both?

Thanks.

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


[PHP] file upload - But outside of web directory...?

2004-01-12 Thread Tristan . Pretty
Hi there...
I keep all my downloads outside of the web folder on my site.
I only allow users to download them by them using the download page, and 
changing teh header info when a file is requested..

What I want to do now, is allow the other site users to upload files to 
that same directory...
>From what I'v estudied on line, I can't do this, but I'm not convinced...
Anyone know if this os possible, via a web based form?

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



[PHP] Re: PHP Installation Questions

2004-01-12 Thread DvDmanDT
There really should be one named httpd.conf.. Otherwise, that might be the
one named httpd if you have extensions on filenames off (not recommended in
any way)... Also, it should be
LoadModule php5_module C:/PHP/php5Apache.dll
sorry, my misstake.. :)

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Dvdmandt wrote:
> > Errm... Just unzip the php zip, so that php.exe is located in c:\php (or
D:\
> > or something).. For example C:\php\php.exe... Then, find your Apache
config
> > file in the Apache\conf folder, named httpd.conf.. Open it, scroll down
to
> > the bottom, then add
> >
> > LoadFile C:/PHP/php5ts.dll
> > LoadModule C:/PHP/php5Apache.dll
> > AddType application/x-httpd-php .php .php5
> > AddType application/x-httpd-php-source .phps
> >
> > Then restart Apache, 'NET STOP Apache', 'NET START Apache' for
example...
> > php.net/manual/en/, click install..
>
>
> H... I can't locate a file named httpd.conf, but the conf folder
> contains two files named httpd and httpd.default, which appear to be
> identical twins.
>
> They both end with this:
>
> #
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> # The first VirtualHost section is used for requests without a known
> # server name.
> #
> #
> #ServerAdmin [EMAIL PROTECTED]
> #DocumentRoot /www/docs/dummy-host.example.com
> #ServerName dummy-host.example.com
> #ErrorLog logs/dummy-host.example.com-error_log
> #CustomLog logs/dummy-host.example.com-access_log common
> #
>
>
> * * * * * * * * * *
>
> So I'm assuming you're teling me to change it to this:
>
> #
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> # The first VirtualHost section is used for requests without a known
> # server name.
> #
> #
> #ServerAdmin [EMAIL PROTECTED]
> #DocumentRoot /www/docs/dummy-host.example.com
> #ServerName dummy-host.example.com
> #ErrorLog logs/dummy-host.example.com-error_log
> #CustomLog logs/dummy-host.example.com-access_log common
> #
>
> LoadFile C:/PHP/php5ts.dll
> LoadModule C:/PHP/php5Apache.dll
> AddType application/x-httpd-php .php .php5
> AddType application/x-httpd-php-source .phps
>
> * * * * * * * * * *
>
> Right? And do you think I should do it to the httpd file, the
> httpd.default file or both?
>
> Thanks.

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



Re: [PHP] file upload - But outside of web directory...?

2004-01-12 Thread Richard Davey
Hello Tristan,

Monday, January 12, 2004, 2:30:15 PM, you wrote:

TPrsc> What I want to do now, is allow the other site users to upload files to
TPrsc> that same directory...
TPrsc> From what I'v estudied on line, I can't do this, but I'm not convinced...
TPrsc> Anyone know if this os possible, via a web based form?

Depends on the configuration of your server. Apache as standard will
run as "nobody", so when files are uploaded that is who owns them -
nobody. This user has very limited access rights and you won't be able
to move the files to anywhere that isn't pretty wide open.

Some hosts (well, Pair Networks at least) offer a PHP wrapping script,
which allows you to run PHP scripts as your local user, so you can
upload files anywhere - this is what I use and it's great.

Alternatively, you could upload them to a temp directory (within your
web root) and use a CRON job to move them where you really want them
at set intervals, again if executed with the right permissions this
would also work.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]


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



Re: [PHP] how to open a webpage

2004-01-12 Thread Richard Davey
Hello bernard,

Monday, January 12, 2004, 1:47:39 PM, you wrote:

b> I have a field with an URL
b> The value of this in a variable $launch.

b> How can I open this URL automatically ??

PHP itself cannot open a web page, it's a server-side language and
doesn't have any control over the client like that.

What it can do however is echo out the HTML required to make it
happen. Either some JavaScript, or a link with the TARGET attribute
set to be $launch.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] how to open a webpage

2004-01-12 Thread Neil Freeman
Or with PHP you could do:

Header("Location:$launch");
die;
Make sure that nothing is outputted before this is called though. The 
variable $launch should also be an absolute URL.

Neil

Richard Davey wrote:

***
This Email Has Been Virus Swept
***
Hello bernard,

Monday, January 12, 2004, 1:47:39 PM, you wrote:

b> I have a field with an URL
b> The value of this in a variable $launch.
b> How can I open this URL automatically ??

PHP itself cannot open a web page, it's a server-side language and
doesn't have any control over the client like that.
What it can do however is echo out the HTML required to make it
happen. Either some JavaScript, or a link with the TARGET attribute
set to be $launch.
--
--
 www.curvedvision.com
--


This communication is confidential to the intended recipient(s). If you are not that person you are not permitted to make use of the information and you are requested to notify the sender immediately of its receipt then destroy the copy in your possession. Any views or opinions expressed are those of the originator and may not represent those of Advanced System Architectures Ltd.

*** This Email Has Been Virus Checked ***

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


[PHP] Re: PHP Installation Questions

2004-01-12 Thread Freedomware
H... The first installation ended with this message:

"Sorry, the software to automatically configure the Apache httpd.conf 
file has not yet been written. You will have to configure Apache 
manually. See the install txt file for more details."

It then occurred to me that I forgot to tell you that I'm installing PHP 
4.3.4; there was a problem with 5.0, so I downloaded 4.3.4 instead.

So instead of adding this to my conf/httpd file:

LoadFile C:/PHP/php5ts.dll
LoadModule php5_module C:/PHP/php5Apache.dll
AddType application/x-httpd-php .php .php5
AddType application/x-httpd-php-source .phps
I replaced every instance of php5 with php4, so the conf/httpd file ends 
like this:

# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
#ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /www/docs/dummy-host.example.com
#ServerName dummy-host.example.com
#ErrorLog logs/dummy-host.example.com-error_log
#CustomLog logs/dummy-host.example.com-access_log common
#
LoadFile C:/PHP/php4ts.dll
LoadModule php4_module C:/PHP/php4Apache.dll
AddType application/x-httpd-php .php .php4
AddType application/x-httpd-php-source .phps
* * * * * * * * * *

But I get the same error message.

Then I replaced the four lines I added to the conf/httpd file with three 
lines I copied from the Installation.txt:

   LoadModule php4_module c:/php/sapi/php4apache.dll
   AddModule mod_php4.c
   AddType application/x-httpd-php .php
I still get the same error message. However, on all three occasions when 
I clicked out of the error message, I got a message telling me PHP was 
successfully installed.

Do you have a hunch what I should do next? Thanks.

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


[PHP] Re: Ver 5.0 Questions ...

2004-01-12 Thread Chris TenHarmsel
Dvdmandt wrote:

> Try beta3, or rc1-dev from snaps.php.net, if it works there, it'll work in
> 5.0, currently, it's bugfix only for RC1, and RC1 isn't very far from the
> release, so I really don't think anyting would get changed... Also, seems
> to me like objects and references are kinda the highest priority in 5.0
> (along with XML support), but that's only my impression..
> 
> To view the history.. Check cvs, and read the NEWS file...
> 

Is there some current timeline for php5 though? like approximate release
date, release month, anything?  We're evaluating whether or not we want to
start a new project using PHP5 or PHP4, and I'd really like to make a push
for PHP5.

-Chris

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



RE: [PHP] Re: jpeg Uploader issue

2004-01-12 Thread Mike R

> i had a problem like the one you descriped.
> The problem was quite simple. In my case everything
> worked fine with Windows-Web-Browsers but not with
> MAC-Browsers.
> Check the value of the filetype variable. There might be
> differences between different plattforms.

I'm sorry to sound stupid here, but what do you mean by that? :\

:)

Thanks,

-Mike
 

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



RE: [PHP] Re: jpeg Uploader issue

2004-01-12 Thread Kelly Hallman
On Mon, 12 Jan 2004, Mike R wrote:
> > i had a problem like the one you descriped. The problem was quite
> > simple. In my case everything worked fine with Windows-Web-Browsers
> > but not with MAC-Browsers. Check the value of the filetype variable.
> > There might be differences between different plattforms.
> 
> I'm sorry to sound stupid here, but what do you mean by that? :\

This occurred to me too, but I couldn't find the thread to respond...

I think he means that the server may be returning an incorrect
Content-type header for jpeg images. IE is especially notorious for
(incorrectly) ignoring this information if it can match the file extension
to a file type registered on the local machine.

In an ideal world, all http clients should respect the Content-type header
to determine the file type. A .jpg should be Content-type: image/jpeg

Normally this is set in your server configuration. However, if they are
being served by a script that is outputting the raw data to the client,
you may need to send this header from the script.  That would explain why
Mac users see the problem only with uploaded images (did you say?).

In PHP you would set the Content-type header like so:
header("Content-type: image/jpeg");

-- 
Kelly Hallman
// Ultrafancy

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



Re: [PHP] I am totally nuts/banana. Please somebody help me with an include problem.

2004-01-12 Thread Marek Kilimajer
Webmaster wrote:
Hello,

please can somebody help me. I am going nuts.
Really I am close to totally freaking out.
I have a problem that seems minor and ridiculous but cost me already 3
working days.
I have a working php/mysql homepage and used to use Ommnihttpd until 3 days
ago.
I installed the latest versions of Apache and php4 3 days ago on Windows
2000.
No matter what I do my script can not include another file from a directory
on the same level in the directory tree.
I have the following directory structure:

c:\webpage\classes\_dentonaproject\page_dentona.class.php
c:\webpage\classes\design\page.class.php
In the file page_dentona.class.php the first line says the following:

require_once('../design/page.class.php');

You should realize that the base directory is the one where the script 
called by the browser resides. If you have file

c:\webpage\index.php

that contains

require_once('classes/_dentonaproject/page_dentona.class.php');

then in page_dentona.class.php you should still use

require_once('classes/design/page.class.php');

The working directory is c:\webpage\ in this case.

Hope this will help you.

Marek

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


[PHP] PHP logo question

2004-01-12 Thread Jimmy Lantz
Hi coders,
I've sent several mails to [EMAIL PROTECTED] regarding the limitations / rights 
to use the PHP logo.
But I havent recieved any reply, does anyone know who answers that email? 
If so please send him/her an heads up to check his/hers inbox.

Now you might think that I've been sending several mails within a few days 
and now cries for help...
Thats no the case, I sent my first mail the 18th december and a copy of 
that mail was resent at the 8th of january 2004.
Or if someone knows if that guy has a lot on his plate just send me an mail 
to let me know if he usually replies within the month or two months.

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


[PHP] Re: how to open a webpage

2004-01-12 Thread bernard
Hi,

Thanks for the suggestions !

Problem is solved sofar.

But how can I open the link in a new window, I tried (with my limited php
knowlegde) a lot of things, but i'ts not working :-(

Bernard



"Bernard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am new to php and doing reasonable well (ok, copying other code and
> learning ;-)
>
> I have a field with an URL
> The value of this in a variable $launch.
>
> How can I open this URL automatically ??
>
> TIA!!
> Bernard
> Antwerp, Belgium

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



[PHP] Re: Error/ Warning messages in log files (OS 121) and (OS 64)

2004-01-12 Thread Trevor Dowling
David,

Thanks for your reply however, I have been here before and can only find
others with the same problem, and no resolution

(i.e. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21425)

Still looking for a fix

Trevor

"David Robley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> > (Relisted as no response from over Xmas period)
> >
> > Hi,
> >
> > I am having a real problem with error messages posted in the error.log
file
> >
> > in the Apache directory. I have been doing lots of searches to find a
> >
> > solution and it seems obvious that many people are see this issue but I
can
> >
> > find no resolution or explanation for the entries (see below).
> >
> > PHP Bug #25570 seemed to be a solution but the version of php I am using
is
> >
> > 4.3.2 which is claimed to not exhibit the bug described in 25570.
> >
> > The system is running on a Win2K box, and we are using php, sql and
Apache.
> >
> >
> > Anyone out there have an idea of how to fix this issue?
> >
> > Thanks
> >
> > Trevor
> >
> >
> >
> >
> >
> > Some system info:
> >
> > System Windows NT UKRBCSR01 5.0 build 2195
> >
> > Build Date May 28 2003 15:06:05
> >
> > Server API Apache 2.0 Handler
> >
> > Apache/2.0.47 (Win32) PHP/4.3.2
> >
> > This is the more worring of the issues:
> >
> > 21:18:49 2003 [notice] Parent: child process exited with status
> >
> > 4294967295 -- Restarting.
> >
> >
> >
> > But I am assuming that some or all of these are related.
> >
> > 21:19:44 2003 [warn] (OS 121)The semaphore timeout period has expired. :
> >
> > winnt_accept: Asynchronous AcceptEx failed.
> >
> > 00:50:58 2003 [warn] (OS 64)The specified network name is no longer
> >
> > available. : winnt_accept: Asynchronous AcceptEx failed.
>
> One or more of the results from
>
> http://www.google.com/search?q=Asynchronous+AcceptEx+failed
>
> may provide some insight into the problem?
>
> Cheers
> --
> Quod subigo farinam
>
> A: Because it messes up the order in which people normally read text.
> Q: Why is top-posting such a bad thing?
> A: Top-posting.
> Q: What is the most annoying thing on usenet?

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



Re: [PHP] Re: how to open a webpage

2004-01-12 Thread "Miguel J. Jiménez"
bernard wrote:

Hi,

Thanks for the suggestions !

Problem is solved sofar.

But how can I open the link in a new window, I tried (with my limited php
knowlegde) a lot of things, but i'ts not working :-(
 

To open the URL in a new window, you MUST use javascript.. You can 
output a HTMP page like this:
   
window.open('otherPage.html');
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Function returns

2004-01-12 Thread Burhan Khalid
Shawn McKenzie wrote:

Maybe a dumb question, but as good coding practice, should all functions
return something even if they don't need to???
Example:

function do_it()
{
   echo "hi";
}
--or--

function do_it()
{
   return echo "hi";
}
Also, if they do other things but really don't return anything, should they
return true maybe???
Like all things, it depends on what the function is doing.

If the function is already displaying output, then there is no need to 
return a particular value, although a habit from my C++ days (no doubt 
caused by the compiler warning: not all paths return value) is to add a 
simple return; at the end, to ensure that the function will return.

If the function is setting values, a good thing to do is to return the 
result (which will be a true or false) so you can see if the value is 
being set or not.

Classes that use PEAR return objects (usually of PEAR:Error) if there 
was an error in the class.

If all your function is doing is printing output, no need to return 
anything, since the success of the function will be apparent once you 
call it.

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


Re: [PHP] view outputed headers?

2004-01-12 Thread Marek Kilimajer
http://sk2.php.net/manual/en/function.headers-list.php says:

no version information, might be only in CVS

Scott Taylor wrote:

What is the easiest way to view the headers that a PHP page has put 
out?  I've seen the |var_dump(headers_list()); on php.net but this 
always gives me an error (such as: |

Fatal error:  Call to undefined function:  headers_list() in 
/usr/local/psa/home/vhosts/a.com/httpdocs/my/page.php on line 
79

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


Re: [PHP] how to open a webpage

2004-01-12 Thread Chris Shiflett
--- Richard Davey <[EMAIL PROTECTED]> wrote:
> b> How can I open this URL automatically ??
> 
> PHP itself cannot open a web page, it's a server-side language and
> doesn't have any control over the client like that.

Well, that's not exactly true if the allow_url_fopen directive is enabled.
You can open Web pages just like local files:

$handle = fopen('http://www.example.com/', 'r');

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



RE: [PHP] Re: how to open a webpage

2004-01-12 Thread Robert Sossomon
Output this to a new file each time and then use a blind page refresh
via 

$output = "

function openpopup(){
var popurl=\"$launch\"
winpops=window.open(popurl,\"\",\"width=400,height=338,toolbar,location,
directories,status,scrollbars,menubar,resizable,\")
}
openpopup()

";

if($file=fopen($pop.htm, "w")) {  //open file for writing
fwrite($file, $output);  //write to file
}

And then do this:

Header("Location:pop.htm");


HTH!
Robert

~~~
The marvels of modern technology include the 5¢ soda can which when
discarded will last for ever and a $35,000 car which when meticulously
cared for will rust out in 2 - 3 years. 
~~~

-Original Message-
From: bernard [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 12, 2004 11:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: how to open a webpage


Hi,

Thanks for the suggestions !

Problem is solved sofar.

But how can I open the link in a new window, I tried (with my limited
php
knowlegde) a lot of things, but i'ts not working :-(

Bernard



"Bernard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I am new to php and doing reasonable well (ok, copying other code and 
> learning ;-)
>
> I have a field with an URL
> The value of this in a variable $launch.
>
> How can I open this URL automatically ??
>
> TIA!!
> Bernard
> Antwerp, Belgium

-- 
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: how to open a webpage

2004-01-12 Thread Burhan Khalid
bernard wrote:

Hi,

Thanks for the suggestions !

Problem is solved sofar.

But how can I open the link in a new window, I tried (with my limited php
knowlegde) a lot of things, but i'ts not working :-(
From the Newbie Guide :

6. PHP is a server side scripting language.
Whatever processing PHP does takes
place BEFORE the output reaches the client.
Therefore, it is not possible to access the
users'  computer related information (OS, screen
size etc) using PHP. You need to go for
JavaScript and ask the question in a JavaScript
list.
:D

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


[PHP] Re: Ver 5.0 Questions ...

2004-01-12 Thread DvDmanDT
What's the real difference.. We are talking something like 1-2 months I
think... Although, there was thoughts about releasing 5.0 in 2002 as well
IIRC..

-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Chris Tenharmsel" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> Dvdmandt wrote:
>
> > Try beta3, or rc1-dev from snaps.php.net, if it works there, it'll work
in
> > 5.0, currently, it's bugfix only for RC1, and RC1 isn't very far from
the
> > release, so I really don't think anyting would get changed... Also,
seems
> > to me like objects and references are kinda the highest priority in 5.0
> > (along with XML support), but that's only my impression..
> >
> > To view the history.. Check cvs, and read the NEWS file...
> >
>
> Is there some current timeline for php5 though? like approximate release
> date, release month, anything?  We're evaluating whether or not we want to
> start a new project using PHP5 or PHP4, and I'd really like to make a push
> for PHP5.
>
> -Chris

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



RE: [PHP] Function returns

2004-01-12 Thread Mark Cubitt


Shawn McKenzie wrote:

> Maybe a dumb question, but as good coding practice, should all functions
> return something even if they don't need to???
>
> Example:
>
> function do_it()
> {
>echo "hi";
> }
>
> --or--
>
> function do_it()
> {
>return echo "hi";
> }
>
> Also, if they do other things but really don't return anything, should
they
> return true maybe???

I don't think there is a right or wrong way but personally I would do it
like this:

function do_it()
{
echo "hi" || return 0;

return 1;
}

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



RE: [PHP] Function returns

2004-01-12 Thread Jonathan Wilkes
This is NOT good coding practice, ONLY return something from a function / method if it 
needs to, otherwise you may get a performance hit.

regards
Jonathan

-Original Message-
From: Mark Cubitt [mailto:[EMAIL PROTECTED]
Sent: 12 January 2004 17:06
To: Shawn McKenzie; [EMAIL PROTECTED]
Subject: RE: [PHP] Function returns




Shawn McKenzie wrote:

> Maybe a dumb question, but as good coding practice, should all functions
> return something even if they don't need to???
>
> Example:
>
> function do_it()
> {
>echo "hi";
> }
>
> --or--
>
> function do_it()
> {
>return echo "hi";
> }
>
> Also, if they do other things but really don't return anything, should
they
> return true maybe???

I don't think there is a right or wrong way but personally I would do it
like this:

function do_it()
{
echo "hi" || return 0;

return 1;
}

-- 
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: PHP Installation Questions

2004-01-12 Thread DvDmanDT
Errm.. Ok, don't download the installer.. That'll just bring you more
problems.. :s The easiest way is to just download the *-win32.zip file, and
extract to c:\php, and possibly move all files cause the extraction proggy
might place them in C:\php\php-4.3.4... when you want them in C:\php... Now,
in php5, the dll's are placed somewhat different... Here's a snippet from my
httpd.conf:
###
# PHP 4
LoadFile C:/PHP/php4ts.dll
Loadmodule php4_module c:\php\sapi\php4apache.dll

# PHP 5  (deactivated)
# LoadFile D:/PHP5/php5ts.dll
# Loadmodule php5_module D:\php5\php5apache.dll

# Associate files
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


If you add them as the last lines, you don't need that AddModule line.. That
loadfile line is there to ease upgrades, you can workaround that if you move
some files...
-- 
// DvDmanDT
MSN: dvdmandt¤hotmail.com
Mail: dvdmandt¤telia.com
"Freedomware" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> H... The first installation ended with this message:
>
> "Sorry, the software to automatically configure the Apache httpd.conf
> file has not yet been written. You will have to configure Apache
> manually. See the install txt file for more details."
>
> It then occurred to me that I forgot to tell you that I'm installing PHP
> 4.3.4; there was a problem with 5.0, so I downloaded 4.3.4 instead.
>
> So instead of adding this to my conf/httpd file:
>
> LoadFile C:/PHP/php5ts.dll
> LoadModule php5_module C:/PHP/php5Apache.dll
> AddType application/x-httpd-php .php .php5
> AddType application/x-httpd-php-source .phps
>
> I replaced every instance of php5 with php4, so the conf/httpd file ends
> like this:
>
> # VirtualHost example:
> # Almost any Apache directive may go into a VirtualHost container.
> # The first VirtualHost section is used for requests without a known
> # server name.
> #
> #
> #ServerAdmin [EMAIL PROTECTED]
> #DocumentRoot /www/docs/dummy-host.example.com
> #ServerName dummy-host.example.com
> #ErrorLog logs/dummy-host.example.com-error_log
> #CustomLog logs/dummy-host.example.com-access_log common
> #
>
> LoadFile C:/PHP/php4ts.dll
> LoadModule php4_module C:/PHP/php4Apache.dll
> AddType application/x-httpd-php .php .php4
> AddType application/x-httpd-php-source .phps
>
> * * * * * * * * * *
>
> But I get the same error message.
>
> Then I replaced the four lines I added to the conf/httpd file with three
> lines I copied from the Installation.txt:
>
> LoadModule php4_module c:/php/sapi/php4apache.dll
> AddModule mod_php4.c
> AddType application/x-httpd-php .php
>
> I still get the same error message. However, on all three occasions when
> I clicked out of the error message, I got a message telling me PHP was
> successfully installed.
>
> Do you have a hunch what I should do next? Thanks.

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



[PHP] Array Key Test

2004-01-12 Thread Cameron B. Prince
Hi,

How would I go about determining if a specific key exists in an array?

I want to see if $conf['hOpt'] is defined. is_array only works at the $conf
level.

I tried count(array_keys($conf, 'hOpt')), but always get 0.

What am I doing wrong here?


Thanks,
Cameron

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



[PHP] Re: Array Key Test

2004-01-12 Thread Justin Patrin
Cameron B. Prince wrote:
Hi,

How would I go about determining if a specific key exists in an array?

I want to see if $conf['hOpt'] is defined. is_array only works at the $conf
level.
You want:

if(isset($conf['hOpt'])) {
 ...
}
You should always use isset to check if a variable is set, whether it is 
a straight variable, an array index, or an object member.

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


Re: [PHP] Array Key Test

2004-01-12 Thread Stuart
Cameron B. Prince wrote:
How would I go about determining if a specific key exists in an array?
http://php.net/isset

I want to see if $conf['hOpt'] is defined. is_array only works at the $conf
level.
I tried count(array_keys($conf, 'hOpt')), but always get 0.
if (isset($conf['h0pt']))

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


[PHP] _("What does this do?")

2004-01-12 Thread Kelly Hallman
I just ran across this syntax in someone else's code.
I can't detect any difference between these two expressions:

_("String value") and "String value"

Is there a difference? What does _("xyz") do, and is it documented
anywhere? I'm curious why this code (SquirrelMail) uses it in one place,
but not another. What say you, PHP gurus? Gotta love the syntactic sugar!

--
Kelly Hallman
// Ultrafancy

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



Re: [PHP] php doesn't work in html files

2004-01-12 Thread Manuel Vázquez Acosta
The facts is that EVERY html (php embeded or not) will be processed by PHP,
which is totally unnecesary and a waste of time.

The best practice is to append the .php extension to your php files. If your
your working for production you must consider that your host provider won't
agree to put his server to process every HTML as a PHP file.
Manu.


"Nico Berg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> It works. I decided to add .html to the list of extensions that will be
> opend by php if asked for in apache. I understand here that it will take
> more time before html files are processed? True?
>
> Thanks all, Nico Berg
>
> > -Oorspronkelijk bericht-
> > Van: Nico Berg [mailto:[EMAIL PROTECTED]
> > Verzonden: zondag 11 januari 2004 14:05
> > Aan: 'PHP General'
> > Onderwerp: [PHP] php doesn't work in html files
> >
> >
> > Hi there all,
> >
> > I use Apache version 1.3 and WIndows 2000. The site is not global but
only
> > local so I use the url http://localhost/index.html
> >
> > This index.html look's like this:
> >
> > 
> > 
> > This is a line
> > 
> > 
> >
> >  > echo "this is the second line";
> > ?>
> >
> > Output is: This is a line
> >
> > So the php part is not done at all. Is that right? I always believed php
> > should work in html?
> >
> > Nico
> >
> > --
> > 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[2]: [PHP] how to open a webpage

2004-01-12 Thread Richard Davey
Hello Chris,

Monday, January 12, 2004, 5:00:16 PM, you wrote:

>> PHP itself cannot open a web page, it's a server-side language and
>> doesn't have any control over the client like that.

CS> Well, that's not exactly true if the allow_url_fopen directive is enabled.
CS> You can open Web pages just like local files:

CS> $handle = fopen('http://www.example.com/', 'r');

Depends on your meaning of the word "open" though doesn't it? :)

I think the original post meant it in the context of "pop open", as
opposed to file accessing it.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] _("What does this do?")

2004-01-12 Thread Marek Kilimajer
It's an alias to this function:

http://sk2.php.net/manual/en/function.gettext.php

Kelly Hallman wrote:

I just ran across this syntax in someone else's code.
I can't detect any difference between these two expressions:
_("String value") and "String value"

Is there a difference? What does _("xyz") do, and is it documented
anywhere? I'm curious why this code (SquirrelMail) uses it in one place,
but not another. What say you, PHP gurus? Gotta love the syntactic sugar!
--
Kelly Hallman
// Ultrafancy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] _("What does this do?")

2004-01-12 Thread Yann Larrivee
This is the equivalent to the function gettext
http://ca3.php.net/manual/en/function.gettext.php

Yann Larrivee
http://conf.phpquebec.com
http://protonicdesign.com


On Mon, 2004-01-12 at 12:42, Kelly Hallman wrote:
> I just ran across this syntax in someone else's code.
> I can't detect any difference between these two expressions:
> 
> _("String value") and "String value"
> 
> Is there a difference? What does _("xyz") do, and is it documented
> anywhere? I'm curious why this code (SquirrelMail) uses it in one place,
> but not another. What say you, PHP gurus? Gotta love the syntactic sugar!
> 
> --
> Kelly Hallman
> // Ultrafancy
-- 
Yann Larrivee <[EMAIL PROTECTED]>

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



[PHP] Re: Ver 5.0 Questions ...

2004-01-12 Thread Chris TenHarmsel
Dvdmandt wrote:

> What's the real difference.. We are talking something like 1-2 months I
> think... Although, there was thoughts about releasing 5.0 in 2002 as well
> IIRC..
> 

Well, we're interested in stability.  I figured since php4 had been out for
a while in "stable" form, it would be more stable than php5.  Is this the
case, or is there a good feeling that php5 will be considered "stable" in
the next couple months?

-Chris

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



RE: [PHP] view outputed headers?

2004-01-12 Thread Ivo Pletikosic
I've been using mozilla firebird as a test browser with the 'Live HTTP
Headers' extension. I've found it most useful.

http://texturizer.net/firebird/extensions/#livehttpheaders


> -Original Message-
> From: Scott Taylor [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, January 11, 2004 9:34 PM
> Subject: [PHP] view outputed headers?
> 
> 
> 
> What is the easiest way to view the headers that a PHP page has put 
> out?  I've seen the |var_dump(headers_list()); on php.net but this 
> always gives me an error (such as: |
> 
> Fatal error:  Call to undefined function:  
> headers_list() in 
> /usr/local/psa/home/vhosts/a.com/httpdocs/my/page.php on 
> line 79

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



Re[2]: [PHP] view outputed headers?

2004-01-12 Thread Richard Davey
Hello Ivo,

Monday, January 12, 2004, 6:41:49 PM, you wrote:

IP> I've been using mozilla firebird as a test browser with the 'Live HTTP
IP> Headers' extension. I've found it most useful.

It's not free, but I use "HTTP Interceptor" for Windows which is
extremely good.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: Re[2]: [PHP] how to open a webpage

2004-01-12 Thread Chris Shiflett
--- Richard Davey <[EMAIL PROTECTED]> wrote:
> CS> You can open Web pages just like local files:
> CS>
> CS> $handle = fopen('http://www.example.com/', 'r');
> 
> Depends on your meaning of the word "open" though doesn't it? :)

That's true. I see now from everyone else's answers that the majority
interpreted this particular question to mean popup or something of the
like.

Oh well. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

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



[PHP] compile php

2004-01-12 Thread Logan McKinley
i have a script that checks an email account and records information into a
database and want to call it when ever an email hits that account.  My ISP
uses merak mail server and i see it has an excutables section, so i was
hoping to fire my php page whenever an email goes to the account.  the
problem is that it can only execute .exe or .dll files and i don't know if a
php file can be compiled.
Thanks in advance,
~Logan

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



[PHP] to array or not to array..

2004-01-12 Thread Edward Peloke
Ok,

This is probably a basic question, I am just looking for opinions and
examples as to the best way to handle this...

I cycling through a query and displaying results to the user such as ...

usernamecan add can delete
eddieY N
frankN N
martha   Y Y

each of the 'Y's and 'N's represent a checkbox.  The user can click
checkboxes for several users then click the update button.  When they click
the update button, I then need to loop through and make updates to the table
for each client.  What is the best way to handle this?  Should these values
be put into a multidemensional array keyed off the users id then loop
through the array to insert into the table?  Should I not use an array and
just someone loop through the results?

Thanks,
Eddie

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



[PHP] Re: Re: need help please

2004-01-12 Thread Piet from South Africa
Hi Haydar

I had this problem a lot of times before, and i can tel you that you cannot
execute a header call and a echo call

 header(sprintf("Location: %s", $insertGoTo));
> >*here is the error
> > >   exit();
}
> > >   ob_get_contents() ;
> > >
>
>***
***
> > > ?>
> > > 
> > > ";   (if you comment this out like i
did, you wont get the error, you need to put the header or the echo inside
an if statement that exits otherwise you will keep on getting the error)(i
changed your  a bit as well, should work)

?>> > > 

"Haydar Moussalem" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
>
> >From: "Gabor Hojtsy" <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: "haydar" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> >Subject: Re: need help please
> >Date: Sat, 10 Jan 2004 15:39:45 +0100 (CET)
> >
> >Please ask support questions at [EMAIL PROTECTED] I would
> >suggest you read the manual page of header() and headers_sent() before
> >you ask there though.
> >
> >Regards,
> >Gabor Hojtsy
> >
> > >
> > > hello
> > > i have this probleme
> > > i include a connection file to the db
> > > then i update i record and finaly i want to redirect it to another
> >page using header function but i have the following error
> > > Warning: Cannot modify header information - headers already sent by
> >(output started
> > > my code is :
> > > 
> > > 
> > >  > > $gifname=rand(1,1000);
> > > $gifname=$gifname.".gif";
> > > global $jpgname;
> > > $jpgname=rand(1000,1);
> > > $jpgname=$jpgname.".jpg";
> > > if(is_uploaded_file($pic))
> > >   {   global $myvar;
> > >  $myvar = $HTTP_POST_FILES['pic']['name'];
> > >  $cd = getcwd();
> > >  $wd = $cd."/pics";
> > >  chdir($wd);
> > >  if([EMAIL PROTECTED]('.'))
> > >{ if($HTTP_POST_FILES['pic']['type']=="image/gif")
> > >   {
> > >   if(file_exists($GLOBALS['myvar']))
> > > {
> > > rename($GLOBALS['myvar'],$GLOBALS['gifname']);
> > > }
> > >   copy($HTTP_POST_FILES['pic']['tmp_name'],$dir);
> > >   if(file_exists("Resource id #1"))   {
> > >   rename("Resource id #1",$GLOBALS['myvar']);
> > > }
> > >   elseif(file_exists("Resource id #2"))   {
> > >   rename("Resource id #2",$GLOBALS['myvar']);
> > > }
> > > elseif(file_exists("Resource id #3"))   {
> > >   rename("Resource id #3",$GLOBALS['myvar']);
> > > }
> > > elseif(file_exists("Resource id #4"))   {
> > >   rename("Resource id #4",$GLOBALS['myvar']);
> > > }
> > > }
> > >   if($HTTP_POST_FILES['pic']['type']=="image/jpeg")
> > >   {
> > >   if(file_exists($GLOBALS['myvar']))
> > > {
> > > rename($GLOBALS['myvar'],$GLOBALS['jpgname']);
> > > }
> > >   copy($HTTP_POST_FILES['pic']['tmp_name'],$dir);
> > >   if(file_exists("Resource id #1"))   {
> > >   rename("Resource id #1",$GLOBALS['myvar']);
> > > }
> > >   elseif(file_exists("Resource id #2"))   {
> > >   rename("Resource id #2",$GLOBALS['myvar']);
> > > }
> > > elseif(file_exists("Resource id #3"))   {
> > >   rename("Resource id #3",$GLOBALS['myvar']);
> > > }
> > > elseif(file_exists("Resource id #4"))   {
> > >   rename("Resource id #4",$GLOBALS['myvar']);
> > > }
> > >   closedir($dir);}
> > > }
> > > }
> > > function GetSQLValueString($theValue, $theType, $theDefinedValue = "",
> >$theNotDefinedValue = "")
> > > {
> > >   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) :
> >$theValue;
> > >   switch ($theType) {
> > > case "text":
> > >   $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> > >   break;
> > > case "long":
> > > case "int":
> > >   $theValue = ($theValue != "") ? intval($theValue) : "NULL";
> > >   break;
> > > case "double":
> > >   $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'"
> >: "NULL";
> > >   break;
> > > case "date":
> > >   $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
> > >   break;
> > > case "defined":
> > >   $theValue = ($theValue != "") ? $theDefinedValue :
> >$theNotDefinedValue;
> > >   break;
> > >   }
> > >   return $theValue;
> > > }
> > > $editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
> > > if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
> > >   $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
> > > }
> > > if ((isset($HTTP_POST_VARS["MM_insert"])) &&
> >($HTTP_POST_VARS["MM_insert"] == "form1")) {
> > >   $insertSQL = sprintf("INSERT INTO iss_pages (iss_id, pg_name,
> >pg_alt, pg_order, pg_display) VALUES (%s, %s, %s, %s, %s)",
> > >GetSQLValueString($HTTP_POST_VARS['page_id'],
> >"int"),
> > >GetSQLValueStri

RE: [PHP] Re: jpeg Uploader issue

2004-01-12 Thread Mike R



> On Mon, 12 Jan 2004, Mike R wrote:
> > > i had a problem like the one you descriped. The problem was quite
> > > simple. In my case everything worked fine with Windows-Web-Browsers
> > > but not with MAC-Browsers. Check the value of the filetype variable.
> > > There might be differences between different plattforms.
> >
> > I'm sorry to sound stupid here, but what do you mean by that? :\
>
> This occurred to me too, but I couldn't find the thread to respond...
>
> I think he means that the server may be returning an incorrect
> Content-type header for jpeg images. IE is especially notorious for
> (incorrectly) ignoring this information if it can match the file extension
> to a file type registered on the local machine.
>
> In an ideal world, all http clients should respect the Content-type header
> to determine the file type. A .jpg should be Content-type: image/jpeg
>
> Normally this is set in your server configuration. However, if they are
> being served by a script that is outputting the raw data to the client,
> you may need to send this header from the script.  That would explain why
> Mac users see the problem only with uploaded images (did you say?).
>
> In PHP you would set the Content-type header like so:
> header("Content-type: image/jpeg");

So, should I write that header to the actual image file prior to the image
itself?

:)

I'll admit that while IE is incorrect for ignoring this information, I think
it is also important for browsers to be flexible enough to understand what a
file means to make the experience for the end user smooth.

Thanks!

-Mike

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



Re: [PHP] to array or not to array..

2004-01-12 Thread shawn_milochik

Try adapting like this:

 foreach ($_POST as $key => $val){
  #display each item from submitted form
  print "$key: $val";
 }

Shawn




   

  [EMAIL PROTECTED]

  om   To:   [EMAIL PROTECTED] 

   cc: 

  01/12/2004 02:44 Subject:  [PHP] to array or not to 
array..  
  PM   

   

   





Ok,

This is probably a basic question, I am just looking for opinions and
examples as to the best way to handle this...

I cycling through a query and displaying results to the user such as ...

usernamecan add can delete
eddieY N
frankN N
martha   Y Y

each of the 'Y's and 'N's represent a checkbox.  The user can click
checkboxes for several users then click the update button.  When they click
the update button, I then need to loop through and make updates to the
table
for each client.  What is the best way to handle this?  Should these values
be put into a multidemensional array keyed off the users id then loop
through the array to insert into the table?  Should I not use an array and
just someone loop through the results?

Thanks,
Eddie

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








**
This e-mail and any files transmitted with it may contain 
confidential information and is intended solely for use by 
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not 
disclose its contents to others and delete it from your 
system.

**

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



Re: [PHP] compile php

2004-01-12 Thread shawn_milochik

Easy solution:  Use wget.
http://unxutils.sourceforge.net/

If you're not familiar with wget, you can Google or e-mail me.  Basically,
a command of:
wget www.yahoo.com
results in an HTTP request to Yahoo and you will find an index.html in the
directory from which you ran the command.  In your case, you don't
care about the resulting file.  What you care about is that your page can
be requested, causing your PHP to run.  ;o)

Alternately, you can do something horribly clumsy, like having merak call
"iexplore.exe http://localhost/myPage.php";, but that's ugly, and you
don't want dozens of browser windows to build up on your webserver.

I'm assuming that you're using a Windows server due to your reference to
"exe" files.  If I got that wrong, wget is still your answer -- it's an old
Unix command, available also on Linux, FreeBSD, and, I imagine, Mac, since
it's now a BSD.

Please post your results to the group, in case they might me useful to
someone.

Note:  You can just drop the .exe files from that unxutils .zip file into
your windows\system32 directory.

Shawn




   

  [EMAIL PROTECTED]

  et   To:   [EMAIL PROTECTED] 

   cc: 

  01/12/2004 01:56 Subject:  [PHP] compile php 

  PM   

   

   





i have a script that checks an email account and records information into a
database and want to call it when ever an email hits that account.  My ISP
uses merak mail server and i see it has an excutables section, so i was
hoping to fire my php page whenever an email goes to the account.  the
problem is that it can only execute .exe or .dll files and i don't know if
a
php file can be compiled.
Thanks in advance,
~Logan

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








**
This e-mail and any files transmitted with it may contain 
confidential information and is intended solely for use by 
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not 
disclose its contents to others and delete it from your 
system.

**

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



[PHP] MySQL query

2004-01-12 Thread Ashley M. Kirchner
   I need to query for record within a certain date stamp.  The 
datetime field contains the createdon information that i need and is in 
the following format:  2004-01-11 21:40:50

   What I'd like to do is search for records that are between 
2004-01-09 and 2004-01-04.  The time is to be ignored, just the date is 
what I need to search by.  Is there a way to do this within an sql 
query, or do I have to do some PHP processing of the datetime field to 
get what I need?

--
W | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MySQL query

2004-01-12 Thread Richard Davey
Hello Ashley,

Monday, January 12, 2004, 8:21:01 PM, you wrote:

AMK> What I'd like to do is search for records that are between
AMK> 2004-01-09 and 2004-01-04.  The time is to be ignored, just the date is
AMK> what I need to search by.  Is there a way to do this within an sql
AMK> query, or do I have to do some PHP processing of the datetime field to
AMK> get what I need?

SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
00:00:00' AND '2004-01-04 23:59:59'

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re[2]: [PHP] MySQL query

2004-01-12 Thread Richard Davey
RD> SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
RD> 00:00:00' AND '2004-01-04 23:59:59'

Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
date, the 4th) so it encompasses the whole period. You might actually
be able to not even include the seconds, try it and see what happens.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



Re: [PHP] MySQL query

2004-01-12 Thread CPT John W. Holmes
From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>

> I need to query for record within a certain date stamp.  The
> datetime field contains the createdon information that i need and is in
> the following format:  2004-01-11 21:40:50
>
> What I'd like to do is search for records that are between
> 2004-01-09 and 2004-01-04.  The time is to be ignored, just the date is
> what I need to search by.  Is there a way to do this within an sql
> query, or do I have to do some PHP processing of the datetime field to
> get what I need?

You'll want to do it in the query, although PHP could help a little.

Even though you want the time to be ignored, the easiest way to do this is
to actually search from 2004-01-09 00:00:00 through 2004-01-04 23:59:59.
Since the "00:00:00" and "23:59:59" are "constants" you can just have PHP
add them to the date string or hard code them into your query. Given that
format, the query would be as simple as:

SELECT * FROM table WHERE datetimefield BETWEEN $start AND $end

Where $start is "2004-01-09 00:00:00" and $end is "2004-01-04 23:59:59"

If you don't want to do that processing, then you'll need to use another
method.

SELECT * FROM table WHERE TO_DAYS(datetimefield) BETWEEN TO_DAYS($start) AND
TO_DAYS($end)

Where $start is "2004-01-09" and $end is "2004-01-04".

There are other methods, too, but the end results is you need to take your
"datetimefield" and get it into the same format as $start and $end.

If you're using MySQL 4.1, there is a DATE() function (I think) that'll
allow you to do this:

SELECT * FROM table WHERE DATE(datetimefield) BETWEEN $start AND $end

Where $start is "2004-01-09" and $end is "2004-01-04".

Hope that helps.

---John Holmes...

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



Re: Re[2]: [PHP] MySQL query

2004-01-12 Thread CPT John W. Holmes
From: "Richard Davey" <[EMAIL PROTECTED]>

> RD> SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
> RD> 00:00:00' AND '2004-01-04 23:59:59'
> 
> Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
> date, the 4th) so it encompasses the whole period. You might actually
> be able to not even include the seconds, try it and see what happens.

What he said for my answer, too! ;)

I didn't even notice you had the later date first in your write-up. Ooops. 

---John Holmes...

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



Re: [PHP] MySQL query

2004-01-12 Thread Ashley M. Kirchner
Richard Davey wrote:

RD> SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
RD> 00:00:00' AND '2004-01-04 23:59:59'
Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
date, the 4th) so it encompasses the whole period. You might actually
be able to not even include the seconds, try it and see what happens.
 

   Assume I don't know what those dates are.  I need to search based on 
whatever the current date is, and search between 2 and 7 days back.  The 
dates in my previous post were simply an example.

--
W | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Installing Preconfigured Packaged Over Apache

2004-01-12 Thread Freedomware
I was able to install Apache fairly easily, and it appears to be 
working, but PHP is way over my head. So I downloaded a preconfigured 
package called XAMPP, from http://www.apachefriends.org/xampp-en.html

The specs say it includes Apache 2.0.48, which I was told is not good 
for working with PHP; I understand Apache 1.3.29  (the one I installed) 
is best.

So can I install a preconfigured package with Apache 2.0.48 over Apache 
1.3.29, without removing Apache 1.3.29? If so, what's the best way to 
proceed? Is there a simple way to switch the PHP connection from Apache 
2 to Apache 1.3, after which I would uninstall Apache 2 (after I get 
Apache 1.3 and PHP up and running)?

Thanks.

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


Re: [PHP] MySQL query

2004-01-12 Thread CPT John W. Holmes
From: "Ashley M. Kirchner" <[EMAIL PROTECTED]>

> >RD> SELECT whatever FROM table WHERE date_column_name BETWEEN '2004-01-09
> >RD> 00:00:00' AND '2004-01-04 23:59:59'
> >
> >Actually sorry, inverse the seconds (put the 00:00:00 onto the lower
> >date, the 4th) so it encompasses the whole period. You might actually
> >be able to not even include the seconds, try it and see what happens.
> >
> >
> Assume I don't know what those dates are.  I need to search based on
> whatever the current date is, and search between 2 and 7 days back.  The
> dates in my previous post were simply an example.

Should have said that in the first place. :)

SELECT * FROM table WHERE TO_DAYS(datetimefield) BETWEEN TO_DAYS(CURDATE() -
INTERVAL 2 DAY) AND TO_DAYS(CURDATE())

The "2" in the query can be a PHP variable ranging from 2 - 7, if you want.

---John Holmes...

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



[PHP] Re: to array or not to array..

2004-01-12 Thread Justin Patrin
Edward Peloke wrote:

Ok,

This is probably a basic question, I am just looking for opinions and
examples as to the best way to handle this...
I cycling through a query and displaying results to the user such as ...

usernamecan add can delete
eddieY N
frankN N
martha   Y Y
each of the 'Y's and 'N's represent a checkbox.  The user can click
checkboxes for several users then click the update button.  When they click
the update button, I then need to loop through and make updates to the table
for each client.  What is the best way to handle this?  Should these values
be put into a multidemensional array keyed off the users id then loop
through the array to insert into the table?  Should I not use an array and
just someone loop through the results?
Thanks,
Eddie
I would use an array or arrays using [] syntax in the HTML variable names.



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


RE: [PHP] to array or not to array..

2004-01-12 Thread Edward Peloke

Thanks Shawn,

That works great, I am messing myself up, however because I am using
checkboxes so when I run this, if I have unchecked the checkbox, the value
doesn't come through and I want an unchecked box to be 0 for example so I
may need some javascript...

Thanks,
Eddie
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 3:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] to array or not to array..



Try adapting like this:

 foreach ($_POST as $key => $val){
  #display each item from submitted form
  print "$key: $val";
 }

Shawn





  [EMAIL PROTECTED]
  om   To:
[EMAIL PROTECTED]
   cc:
  01/12/2004 02:44 Subject:  [PHP] to array or
not to array..
  PM






Ok,

This is probably a basic question, I am just looking for opinions and
examples as to the best way to handle this...

I cycling through a query and displaying results to the user such as ...

usernamecan add can delete
eddieY N
frankN N
martha   Y Y

each of the 'Y's and 'N's represent a checkbox.  The user can click
checkboxes for several users then click the update button.  When they click
the update button, I then need to loop through and make updates to the
table
for each client.  What is the best way to handle this?  Should these values
be put into a multidemensional array keyed off the users id then loop
through the array to insert into the table?  Should I not use an array and
just someone loop through the results?

Thanks,
Eddie

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








**
This e-mail and any files transmitted with it may contain
confidential information and is intended solely for use by
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not
disclose its contents to others and delete it from your
system.

**

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



[PHP] Globals problem - $_REQUEST good solution?

2004-01-12 Thread Ryan A
Hi,
I am getting some variable from another program an the main problem is its
coming mixed...
eg:
some get and some post

So far I have coded this with register globals on because I didnt know which
way it was coming..
now i want to do it with globals off...

After going through the manual trying to find an answer I came accross
$_REQUEST, is this a good
solution? because I have never used this before or is this as bad as having
globals on?

Thanks,
-Ryan

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



RE: [PHP] to array or not to array..

2004-01-12 Thread Matt Matijevich
[snip]
That works great, I am messing myself up, however because I am using
checkboxes so when I run this, if I have unchecked the checkbox, the
value
doesn't come through and I want an unchecked box to be 0 for example so
I
may need some javascript...
[/snip]

Can only one option be checked per user (like can add has to either be
Y or N, it cant be both)?  Is it just a yes/no question?  If it is, why
not just use radio input types.

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



Re: [PHP] Globals problem - $_REQUEST good solution?

2004-01-12 Thread CPT John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]>

> After going through the manual trying to find an answer I came accross
> $_REQUEST, is this a good
> solution? because I have never used this before or is this as bad as
having
> globals on?

The only simularity it has to register_globals ON is that you don't know
what method provided the value. It could be POST, GET, or COOKIE.

But... if you're validating the data properly anyhow, it really shouldn't
matter where it's coming from. I use $_REQUEST for everything, that way I
can change the method of my forms if I need to without affecting my code (or
the user can).

---John Holmes...

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



Re: [PHP] Globals problem - $_REQUEST good solution?

2004-01-12 Thread Ryan A
Cool.
Thanks John.

-Ryan

> The only simularity it has to register_globals ON is that you
> don't know
> what method provided the value. It could be POST, GET, or COOKIE.
> 
> But... if you're
> validating the data properly anyhow, it really
> shouldn't
> matter where it's coming from. I use $_REQUEST for everything,
> that way I
> can change the method of my forms if I need to without affecting my code
> (or
> the user can).
> 
> ---John Holmes...

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



Re: [PHP] to array or not to array..

2004-01-12 Thread Justin Patrin
The way I deal with this is one of two ways. An easy way is to populate 
hidden fields in the page with the indexes of the users, thwn loop 
through those, checking the indexes of the arrays sent back.


User 5 

User 7 
Another is to loop through, say, records from the DB and use their IDs 
for the indexes of the arrays.

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


[PHP] permissions with bash scripts in php?

2004-01-12 Thread Jas
Something I have never tried... seems fairly straight-forward but I am 
running into problems.

My problem is that I need to call system to restart a daemon service 
like so...

$cmd = "/path/to/shell/script/script.sh";
system($cmd . " &> /tmp/error ");
?>

Script contains this command...
#!/bin/bash
/path/to/dhcpd -cf /path/to/config/dhcpd
So far so good right?  I mean it works from a command line so why not 
from php.  Lets check some permissions...
httpd as Apache:Apache
script.sh as Apache:Apache

Upon inspection of 'error file' in /tmp I find this...

unable to create icmp socket: Operation not permitted
Can't create new lease file: Permission denied
And...

Can't bind to dhcp address: Permission denied
Please make sure there is no other dhcp server
running and that there's no entry for dhcp or
bootp in /etc/inetd.conf.   Also make sure you
are not running HP JetAdmin software, which
includes a bootp server.
So lets set a sticky bit on the script.sh and /path/to/config/dhcpd
$> chmod 1777 /path/to/config/dhcpd
$> chmod 1777 script.sh
So far so good but I am still recieving the same error, if anyone has 
some good tips on what would be the most efficient & SECURE way of 
starting this service please point me to the tutorial Thanks a ton.
Jas

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


Re: [PHP] to array or not to array..

2004-01-12 Thread Jake McHenry
- Original Message - 
From: "Matt Matijevich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 4:18 PM
Subject: RE: [PHP] to array or not to array..


> [snip]
> That works great, I am messing myself up, however because I am using
> checkboxes so when I run this, if I have unchecked the checkbox, the
> value
> doesn't come through and I want an unchecked box to be 0 for example so
> I
> may need some javascript...
> [/snip]
>
> Can only one option be checked per user (like can add has to either be
> Y or N, it cant be both)?  Is it just a yes/no question?  If it is, why
> not just use radio input types.
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



I just picked up on this thread.. but you can just initialize the variable
as 0, then if the box is checked it will have the new value. What's wrong
with this?

Jake

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



[PHP] class design question

2004-01-12 Thread rogue
hi there.

i am working out the finishing touches on a authentication class that 
uses mysql to store the time of last access and some other goodies.

my question is, when developing a class that uses a database, what is 
the best way to handle the database bit? for now i just set the 
connection in an .inc file and include that in the class, but there has 
got to be a better way - especially for portability sake.

thanks for any suggestions.

- rogue

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


Re: [PHP] permissions with bash scripts in php?

2004-01-12 Thread Jake McHenry

- Original Message - 
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 4:47 PM
Subject: [PHP] permissions with bash scripts in php?


> Something I have never tried... seems fairly straight-forward but I am
> running into problems.
>
> My problem is that I need to call system to restart a daemon service
> like so...
>  $cmd = "/path/to/shell/script/script.sh";
> system($cmd . " &> /tmp/error ");
> ?>
>
> Script contains this command...
> #!/bin/bash
> /path/to/dhcpd -cf /path/to/config/dhcpd
>
> So far so good right?  I mean it works from a command line so why not
> from php.  Lets check some permissions...
> httpd as Apache:Apache
> script.sh as Apache:Apache
>
> Upon inspection of 'error file' in /tmp I find this...
>
> unable to create icmp socket: Operation not permitted
> Can't create new lease file: Permission denied
>
> And...
>
> Can't bind to dhcp address: Permission denied
> Please make sure there is no other dhcp server
> running and that there's no entry for dhcp or
> bootp in /etc/inetd.conf.   Also make sure you
> are not running HP JetAdmin software, which
> includes a bootp server.
>
> So lets set a sticky bit on the script.sh and /path/to/config/dhcpd
> $> chmod 1777 /path/to/config/dhcpd
> $> chmod 1777 script.sh
>
> So far so good but I am still recieving the same error, if anyone has
> some good tips on what would be the most efficient & SECURE way of
> starting this service please point me to the tutorial Thanks a ton.
> Jas
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


is the apache user and group able to run the script from the command line? I
know under rh9, you have to be root to start / stop / restart just about all
the services.

Just an idea.

Jake

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



Re: [PHP] class design question

2004-01-12 Thread Jason Sheets
Take a look at the PEAR DB Abstraction layer, I usually store connection
info in an XML or INI file and use parse_ini or PEAR Config to parse the
configuration file.  http://pear.php.net

> hi there.
>
> i am working out the finishing touches on a authentication class that
> uses mysql to store the time of last access and some other goodies.
>
> my question is, when developing a class that uses a database, what is
> the best way to handle the database bit? for now i just set the
> connection in an .inc file and include that in the class, but there has
>  got to be a better way - especially for portability sake.
>
> thanks for any suggestions.
>
> - rogue
>
> --
> 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] permissions with bash scripts in php?

2004-01-12 Thread Jas
Jake McHenry wrote:
- Original Message - 
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 4:47 PM
Subject: [PHP] permissions with bash scripts in php?



Something I have never tried... seems fairly straight-forward but I am
running into problems.
My problem is that I need to call system to restart a daemon service
like so...
 /tmp/error ");
?>
Script contains this command...
#!/bin/bash
/path/to/dhcpd -cf /path/to/config/dhcpd
So far so good right?  I mean it works from a command line so why not
from php.  Lets check some permissions...
httpd as Apache:Apache
script.sh as Apache:Apache
Upon inspection of 'error file' in /tmp I find this...

unable to create icmp socket: Operation not permitted
Can't create new lease file: Permission denied
And...

Can't bind to dhcp address: Permission denied
Please make sure there is no other dhcp server
running and that there's no entry for dhcp or
bootp in /etc/inetd.conf.   Also make sure you
are not running HP JetAdmin software, which
includes a bootp server.
So lets set a sticky bit on the script.sh and /path/to/config/dhcpd
$> chmod 1777 /path/to/config/dhcpd
$> chmod 1777 script.sh
So far so good but I am still recieving the same error, if anyone has
some good tips on what would be the most efficient & SECURE way of
starting this service please point me to the tutorial Thanks a ton.
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


is the apache user and group able to run the script from the command line? I
know under rh9, you have to be root to start / stop / restart just about all
the services.
Just an idea.

Jake
Just tried that and I am getting the same error.  I guess what I am 
really looking for is a way to have apache restart the service without 
adding the apache user in the 'sudoers' file.
Jas

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


Re: [PHP] class design question

2004-01-12 Thread Justin Patrin
Jason Sheets wrote:

Take a look at the PEAR DB Abstraction layer, I usually store connection
info in an XML or INI file and use parse_ini or PEAR Config to parse the
configuration file.  http://pear.php.net

hi there.

i am working out the finishing touches on a authentication class that
uses mysql to store the time of last access and some other goodies.
my question is, when developing a class that uses a database, what is
the best way to handle the database bit? for now i just set the
connection in an .inc file and include that in the class, but there has
got to be a better way - especially for portability sake.
thanks for any suggestions.

- rogue

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
You could even use PEAR's Auth package to even further simplify things. ;-)

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


RE: [PHP] class design question

2004-01-12 Thread Giz
If you're going to the trouble of making an authentication class, you should
consider also using a database connection class, and modifying your
authentication class to make use of it.  You might want to roll your own,
although there are numerous classes that already exist.  

As for "portability" I'm not a big fan of designing for it where databases
are concerned.  People always talk about portability, but how often do they
move applications from one database to another?  The reality is relational
databases have many differences, and many different contention and locking
schemes.  I firmly believe in using the best features available in any
database I'm developing for.  

With that said, adodb is a well known database portability library that has
been around for a long time and been used in many projects.  I personally
like the simplicity of ez_sql which can be found here:
http://www.justinvincent.com/

-Original Message-
From: rogue [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 12, 2004 2:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP] class design question

hi there.

i am working out the finishing touches on a authentication class that 
uses mysql to store the time of last access and some other goodies.

my question is, when developing a class that uses a database, what is 
the best way to handle the database bit? for now i just set the 
connection in an .inc file and include that in the class, but there has 
got to be a better way - especially for portability sake.

thanks for any suggestions.

- rogue

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



  1   2   >