php-general Digest 6 Jul 2003 08:48:44 -0000 Issue 2159

Topics (messages 154073 through 154114):

Re: Failed to Receive in E:\...\mailscript.php on line 25
        154073 by: Håkon Strandenes
        154109 by: Jason Wong
        154110 by: Håkon Strandenes
        154111 by: Håkon Strandenes
        154112 by: Jason Wong
        154113 by: Jason Wong

Sessions help needed!
        154074 by: John Fuller

Re: Q on echo phpinfo() ;
        154075 by: Philip Olson
        154078 by: jsWalter

Re: Authentication system
        154076 by: olinux

PHP crashing with using Oracle
        154077 by: Reuben D. Budiardja

SSL POST problems, cURL, fsockopen, ipv6??
        154079 by: af.ax-im.com

Re: Delimiter must not be alphanumeric or backslash
        154080 by: Jaap van Ganswijk

looping through values from a field?  Need hellp.
        154081 by: Micah Montoy
        154082 by: Lars Torben Wilson
        154085 by: Micah Montoy
        154091 by: Giz
        154095 by: Micah Montoy
        154097 by: Lars Torben Wilson
        154098 by: Micah Montoy

Re: Timing out fopen using https stream wrapper?
        154083 by: Giz
        154084 by: Giz
        154099 by: Dan Anderson
        154103 by: Giz
        154104 by: Dan Anderson
        154106 by: Giz

Re: Limit output of query field
        154086 by: Giz

Re: Permission Problem
        154087 by: Giz

Re: simple query help
        154088 by: Giz
        154089 by: Giz

Forms and PHP_SELF
        154090 by: Beauford.2005
        154093 by: Beauford.2005
        154094 by: Alan D'Angelo
        154100 by: Dan Anderson
        154101 by: Leif K-Brooks
        154102 by: Dan Anderson
        154107 by: Leif K-Brooks

Compiling 4.2.3 with MySQL ... what does it look for?
        154092 by: -{ Rene Brehmer }-

sqlite_seek() problem
        154096 by: Alan D'Angelo

Re: [PHP-DB] Compiling 4.2.3 with MySQL ... what does it look for?
        154105 by: olinux

instanceof on class (not objects) php 5
        154108 by: Greg Beaver

does anyone know how to tell if a PHP scrip is being executed from the command line 
not a server HTTP request??
        154114 by: Jeffrey D. Means

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message ---
No, actually not. But i think so. This is the server to my ISP, so I
cannot change it. But the SMTP server is set to "localhost", so I THINK
it's correct.

I have made a php script with only the "phpinfo()" tag in here:
http://grimstad.seilforening.no/Mailinglister/phpinfo.php

Regards,
Håkon Strandenes

-----Original Message-----
From: Thomas Seifert [mailto:[EMAIL PROTECTED] 
Sent: 5. juli 2003 22:17
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25


are you sure that the smtp-settings in php.ini are correct on your
host's server?


Thomas

On Sat, 5 Jul 2003 20:15:14 +0200 [EMAIL PROTECTED]
(Håkon strandenes) wrote:

> Hi,
> 
> I am making a small PHP script for managing a simple mailing list. The

> PHP script is added in the bottom of this message.
> 
> This PHP script works great on IIS 5.1 with PHP 4.3.0, witch I have 
> installed locally on my system to test my scripts. But when I transfer

> the script over to my host server (With IIS and PHP 4.2.1), I get an 
> error message when I'm trying to use it. The error message is like 
> this:
> 
> Warning: Failed to Receive in 
> E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
> on line 25 Kommandoen er nå sendt. Merk at det kan ta opp til 5 
> minutter før den trer i kraft.PHP Warning: Failed to Receive in 
> E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
> on line 25
> 
> Is there any compatibility problems between 4.2.1 and 4.3.0 for the 
> codes I have used in my script?
> 
> Regards,
> Håkon Strandenes
> 
> 
> Here is the script (It get its inputs from this form:
> http://grimstad.seilforening.no/Mailinglister/Styreskjema.html):
> 
> <?php
> 
> @extract($_POST);
> 
> $Liste = stripslashes($Liste);
> $Navn = stripslashes($Navn);
> $Email = stripslashes($Email);
> $Kommando = stripslashes($Kommando);
> 
> if (!$Email)
> {
> echo ("Du må fylle inn din e-mail adresse.");
> }
> else
> {
> if (!$Navn)
> {
> echo ("Du må fylle inn navnet ditt.");
> }
> else
> {
> 
> $Message = "Automatisk generert styringsmail";
> $Headers = "From: $Navn <$Email>";
> mail( $Liste, $Kommando, $Message, $Headers );
> 
> echo ("Kommandoen er nå sendt. Merk at det kan ta opp til 5 minutter 
> før den trer i kraft.");
> 
> }
> }
> ?>
> 
> 



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

---
[This E-mail was scanned for viruses by Declude Virus]





--- End Message ---
--- Begin Message ---
On Sunday 06 July 2003 03:25, Håkon Strandenes wrote:
> No, actually not. But i think so. This is the server to my ISP, so I
> cannot change it. But the SMTP server is set to "localhost", so I THINK
> it's correct.

You're using some Windows system? Are you running an SMTP server on that 
machine? If not then you cannot use 'localhost' for your SMTP setting. Try 
changing it to the SMTP server provided by your ISP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Default, n.:
        The hardware's, of course.
*/


--- End Message ---
--- Begin Message ---
How do I specify witch SMTP server I shall use? I cannot set this in the
PHP.ini file, so I must specift this in the script.

Regards,
Håkon Strandenes

-----Original Message-----
From: Håkon Strandenes [mailto:[EMAIL PROTECTED] 
Sent: 5. juli 2003 21:25
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Failed to Receive in E:\...\mailscript.php on
line 25


No, actually not. But i think so. This is the server to my ISP, so I
cannot change it. But the SMTP server is set to "localhost", so I THINK
it's correct.

I have made a php script with only the "phpinfo()" tag in here:
http://grimstad.seilforening.no/Mailinglister/phpinfo.php

Regards,
Håkon Strandenes

-----Original Message-----
From: Thomas Seifert [mailto:[EMAIL PROTECTED] 
Sent: 5. juli 2003 22:17
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Failed to Receive in E:\...\mailscript.php on line 25


are you sure that the smtp-settings in php.ini are correct on your
host's server?


Thomas

On Sat, 5 Jul 2003 20:15:14 +0200 [EMAIL PROTECTED]
(Håkon strandenes) wrote:

> Hi,
> 
> I am making a small PHP script for managing a simple mailing list. The

> PHP script is added in the bottom of this message.
> 
> This PHP script works great on IIS 5.1 with PHP 4.3.0, witch I have
> installed locally on my system to test my scripts. But when I transfer

> the script over to my host server (With IIS and PHP 4.2.1), I get an
> error message when I'm trying to use it. The error message is like 
> this:
> 
> Warning: Failed to Receive in
> E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
> on line 25 Kommandoen er nå sendt. Merk at det kan ta opp til 5 
> minutter før den trer i kraft.PHP Warning: Failed to Receive in 
> E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php 
> on line 25
> 
> Is there any compatibility problems between 4.2.1 and 4.3.0 for the
> codes I have used in my script?
> 
> Regards,
> Håkon Strandenes
> 
> 
> Here is the script (It get its inputs from this form:
> http://grimstad.seilforening.no/Mailinglister/Styreskjema.html):
> 
> <?php
> 
> @extract($_POST);
> 
> $Liste = stripslashes($Liste);
> $Navn = stripslashes($Navn);
> $Email = stripslashes($Email);
> $Kommando = stripslashes($Kommando);
> 
> if (!$Email)
> {
> echo ("Du må fylle inn din e-mail adresse.");
> }
> else
> {
> if (!$Navn)
> {
> echo ("Du må fylle inn navnet ditt.");
> }
> else
> {
> 
> $Message = "Automatisk generert styringsmail";
> $Headers = "From: $Navn <$Email>";
> mail( $Liste, $Kommando, $Message, $Headers );
> 
> echo ("Kommandoen er nå sendt. Merk at det kan ta opp til 5 minutter
> før den trer i kraft.");
> 
> }
> }
> ?>
> 
> 



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

---
[This E-mail was scanned for viruses by Declude Virus]





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

---
[This E-mail was scanned for viruses by Declude Virus]





--- End Message ---
--- Begin Message ---
This is not my server, so I cannot change the settings in php.ini. This
is my ISP's server, and I think they run SMPT om the same server. And
yes, this is a Windows 2000 server.

How do I set the SMTP server I shall use in the script? I have no access
to the php.ini...

I will contact my ISP at moonday and tell them about my problem.

Regards,
Håkon Strandenes

-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: 6. juli 2003 08:56
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Failed to Receive in E:\...\mailscript.php on
line 25


On Sunday 06 July 2003 03:25, Håkon Strandenes wrote:
> No, actually not. But i think so. This is the server to my ISP, so I 
> cannot change it. But the SMTP server is set to "localhost", so I 
> THINK it's correct.

You're using some Windows system? Are you running an SMTP server on that

machine? If not then you cannot use 'localhost' for your SMTP setting.
Try 
changing it to the SMTP server provided by your ISP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Default, n.:
        The hardware's, of course.
*/


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

---
[This E-mail was scanned for viruses by Declude Virus]





--- End Message ---
--- Begin Message ---
On Sunday 06 July 2003 14:55, Håkon Strandenes wrote:

Please trim your posts!

> How do I specify witch SMTP server I shall use? 

If you're using mail() then in php.ini.

> I cannot set this in the
> PHP.ini file, 

Why not? If it's on some hosting service then obviously the hosting service 
have gotten their settings wrong. And they should do something to rectify it!

>so I must specift this in the script.

If all else fails, you have to abandon the use of mail(). There are several 
alternatives here: www.phpclasses.org, which allows you to specify an SMTP 
server at run-time.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
No sex with anyone in the same office
                -- Murphy's Laws on Sex n8
*/


--- End Message ---
--- Begin Message ---
On Sunday 06 July 2003 14:59, Håkon Strandenes wrote:
> This is not my server, so I cannot change the settings in php.ini. This
> is my ISP's server, and I think they run SMPT om the same server. And
> yes, this is a Windows 2000 server.

A quick and easy way to check whether mail() would work is to use the 
error_log() function.

> How do I set the SMTP server I shall use in the script? I have no access
> to the php.ini...

I believe you can set that at run-time using ini_set().

> I will contact my ISP at moonday and tell them about my problem.

Good idea!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Theory is gray, but the golden tree of life is green.
                -- Goethe
*/


--- End Message ---
--- Begin Message ---
Hello all, 
    I am new to php in general and am trying to set up a user authentification system 
with mysql.  The registration page works well and sends all of the data to the 
appropriate table in mysql.  However, when I try to get the registered user to log in 
and start a session, the system will not remember the session information past the 
page.  For instance, this page will not work (the one that initially is supposed to 
register the session from the login form):
 
<?
session_start();
$username="chris";
$database="login";

$login = $_POST['login'];
$password = $_POST['password'];
if((!$login) || (!$password)){
 echo "Please enter ALL of the information! <br />";
 include 'login.php';
 exit();
}
mysql_connect(localhost,$username);
@mysql_select_db($database) or die( "Unable to select database");
$sql=mysql_query("SELECT * FROM login WHERE login='$login' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
  // This is where I register the session
  session_register('login');
  $_SESSION['login'] = $login;  
  mysql_close();
include 'success.php';
} else {
 echo "You could not be logged in! Either the username and password do not match or 
you have not validated your membership!<br />
 Please try again!<br />";
 include 'login.php';
}
?>
 
It proceeds to login the user for that page (I know this happens because I have played 
around with it looking at the error checks), but it will not display any variable that 
resembles "$_SESSION['login']".  
The next page sequentially (success.php) looks like this:
 
<?
session_start();
echo 'Successful login for "$_SESSION['login']"';
?>
 
Any and all variations of this page come up blank and white whenever the variable 
$_SESSION['login'] is called to display. It shows no memory of me registering a 
session.  Any variation of quotes verse apostrophes changes nothing, so I figure that 
either I am blatantly screwing up the session code (possible for I have never written 
any sessions before) or my system is not supporting sessions.  I have a php4 
something, windows, apache 1.3.27 for my home network server, and mysql.  Any help on 
this problem would be greatly appreciated.  
Thanks a lot for your time, John



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

--- End Message ---
--- Begin Message ---
You may set the location of php.ini by using the PHPRC 
environment variable or during ./configure use the
--with-config-file-path directive.  Maybe you should
just copy a php.ini into the directory PHP is looking for
it in, which appears to be C:\WINNIT.  If PHP was actually
reading a php.ini, you would have instead seen it as
C:\WINNIT\php.ini as opposed to just a directory path.  So
because no php.ini is being read, PHP is using all default
values as per a stock php.ini-dist.

http://www.php.net/manual/en/configuration.php
http://www.php.net/manual/en/faq.installation.php#faq.installation.phpini

Regards,
Philip


On Sat, 5 Jul 2003, jsWalter wrote:

> I ran this as a script from my Apache and it gave me a beautiful web page
> just full of wonderful information!
> 
> But I have a question on just 1 item...
> 
> Configuration File (piping) Path C:\WINNIT
> 
> How does this value get set?
> 
> My PHP is installed at 'G:\etc\php'
> 
> My php.ini is there as well.
> 
> The paths are set (in that ini file) as...
> 
> include_path = ".;G:\etc\php\extensions;G:\etc\php\pear"
> 
> extension_dir = "G:\etc\php\extensions"
> 
> Even My Apache is told to look there as well...
> 
> # Windows Win32 version
> 
> LoadFile "/etc/php/gnu_gettext.dll"
> 
> LoadModule php4_module "/etc/php/sapi/php4apache2.dll"
> 
> Action application/x-httpd-php "/etc/php/php.exe"
> 
> ScriptAlias /php/ "/etc/php/"
> 
> (pls don't comment about there being volume letters missing to this block,
> 
> I want to focus on the issue of a path being defined from out of the blue)
> 
> Is this being hard coded somewhere?
> 
> If so, then why does my PHP work at all?
> 
> I have nothing that belongs to PHP in the system directory.
> 
> Well, not completely true.
> 
> PEAR installed a pear.ini in the system directory itself (I wish it didn't,
> 
> but my PEAR not working properly is a different issue.)
> 
> Nothing I've read from the web or the documentation has given me any
> understand on how this is set and why PHP file are needed in the location
> that the says to place them.
> 
> I guess, this is a question for the folks who wrote the executables for
> Windows.
> 
> Thanks for any help and enlightenment.
> 
> Walter
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
"Philip Olson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> You may set the location of php.ini by using the PHPRC
> environment variable or during ./configure use the
> --with-config-file-path directive.

So, I take it that this is a setting you use during compile time.
So, to fix this, as not to mandate the use of 'C:\winnt' I could just
recompile everything.
mmm.

> Maybe you should just copy a php.ini into the directory PHP
> is looking for it in, which appears to be C:\WINNIT.

I was really hoping not to have to do that. It is so *Microsoft* in
implementation. I was really hoping that something that came from outside
the DarkSide would not be tempted.

> If PHP was actually reading a php.ini, you would have instead
> seen it as C:\WINNIT\php.ini as opposed to just a directory
> path. So because no php.ini is being read, PHP is using all
> default values as per a stock php.ini-dist.

OK! Now I see. PHP is using default values since it can't "see" a php.ini
file where it thinks it should be, the C:\WINNT directory.

Well, I copied my php.ini into C:\winnt removed my "fix" for DB.php,
restarted my Apache and sure enough, phpinfo() shows C:\WINNT\php.ini and
DB.php no longer returns an error!

:( [why the sad face? It thought you said it now works?]

The sad face is because I am forced to place files in the windows directory.

There was nothing I could do about Apache and it's use of the Registry, now
it looks like I'm forced to do things "The Microsoft Way" with PHP. At least
Perl is set up without using Microsoft's mandates.

Thanks for the info Philip. I appreciate it. Now things are clearer. PHP now
works, but I'm not happy, but that's not relevant. I'm always causing
trouble.

Now I 'need' to see if I can find someone who can re-compile this for me (no
I don't have access to any of these tools. I'm learning PHP now since I was
told that is what I need to add to my skill set if I want to get a job,
again. I got laid off 6 months ago after 7 years as an Lead Internet
Technologies Architect. PHP was just something I never had to deal with. The
fortune 1000 didn't "want" that, so, I didn't do it. That'll teach me!)

Anyway, Thanks Philip.

Walter



--- End Message ---
--- Begin Message ---
there's a good example in this article

A Complete, Secure User Login System
by Tim Perdue
http://www.phpbuilder.com/columns/tim20000505.php3


olinux


> On 2 Jul 2003 at 13:00, Mike Migurski wrote:
> 
> > You may find it easier to include, in the e-mail,
> a
> > uniquely-generated, limited-time URL that the
> person can visit to
> > verify that they have received the e-mail. This
> will remove the burden
> > of having to set up a system that responds to
> e-mail commands.
> 
> Thanks, Mike. I think my brain is working undertime
> at the moment. 
> Can you give me an example? (Or point me in the
> direction of one?)
> 
> Doug

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--- End Message ---
--- Begin Message ---
Hello,
I installed PHP-4.3.2 with oci8 and oracle support (using --with-oci8 
--with-oracle).
I recompile apache-1.3.27 to use the libpthread as mentioned here:
http://ww.php.net/oci8

Now, I got crashes when using oracle with php. In my apache error logs, I get:

[Sat Jul  5 17:24:28 2003] [notice] child pid 17496 exit signal Segmentation 
fault (11)
[Sat Jul  5 17:24:29 2003] [notice] child pid 17558 exit signal Segmentation 
fault (11)

and the application would just do nothing (I tried reload, submit, etc). 

if this happens, the only way I can fix it is by restarting apache. Could 
anyone give me pointer what's going on here  and how to fix it?

In case this matters, the Oracle 9i DB server is also in the same box. Somehow 
it has it's own Apache, but I don't use that.

Thanks for any help.
RDB

-- 
Reuben D. Budiardja


--- End Message ---
--- Begin Message ---
Hello.

I've read all the documentation I can find about https POSTs using curl, fsockopen 
with "ssl://",
even PEAR's Net_Socket package, but I'm running into a PHP problem I haven't seen 
before.

Platform Info:
OpenBSD 2.9, PHP 4.3.2, Apache 1.3.27, ModSSL 2.8.14, OpenSSL 0.9.6, curl 7.9.8
(I've installed curl 7.10.5, but PHP configure refuses to see it even when I specify 
the path,
"--with-curl=/usr/local/curl" -- it uses the default 7.9.8 install in /usr/local no 
matter what I
do).

I'm testing all my code on my Mac OS X server and everything works fine, but I'm 
running into
problems when I try to move it to my main server running OpenBSD 2.9 -- I can't get 
any of these
methods to connect to a particular target server (running MS Site Server, btw) -- all 
attempts
return nothing.  Yes, I'm also talking to the admins of the target server, but some 
error
messages on my end concern me.

 - Using Snoopy (which uses curl for https posts), it reports an error 6 = "Couldn't 
resolve
host".

 - Using fsockopen with ssl://, my error log reads:
   "PHP Warning:  fsockopen(): unable to connect to [secure.host.name]:443
    PHP Warning:  fsockopen(): php_network_getaddresses: getaddrinfo failed: no address
associated with name (is your IPV6 configuration correct? If this error happens all 
the time, try
reconfiguring PHP using --disable-ipv6 option to configure)"

(I've tried reconfiguring php with "--disable-ipv6" and reinstalling, but I continue 
to get the
same message).

Anyone have any penetrating insights?
Thanks in advance...
Alex
- - - - - - - - - -
af at ax-im dot com

--- End Message ---
--- Begin Message ---
At 2003-07-05 20:01 +0200, Alan D'Angelo wrote:
>Try this:
>
><?php
>$text = "pot post pat patent";
>if(preg_match("/\bp\w+t\b/", $text, $array)){
>    print $array[0];
>}
>?>
>
>the pattern in preg_match() does not have correct limit :)

It is probably also a good idea to use single quotes
('/\bp\w+t\b/') so PHP won't try to interpret the
'\w' and '\b' itself.

Greetings,
Jaap


--- End Message ---
--- Begin Message ---
I have this javascript that enables browsing and selecting of a file.  This
file location and name are then transferred further down in the form as an
<option>.  Multiple files may be chosen as they are just added one below the
other.  Anyway, when the form is submitted it is only retrieving the last
file name from the form.  How can I get PHP to return all the values from
the <select> part.  Basically this is what is happening:

1.  Choose a file  <input type="file" name="viewing" onchange="loadImg();">
2. File location and name are displayed in the
<select name="imgList" style="width:350;" size="6" multiple></select> as
<option value="c:\images\filename.gif">c:\images\filename.gif</option>
The javascript creates the option and a new option is added and appended
when a new file is chosen.
3. Submit form to php script to send location and stuff to database.

Anyone have any ideas of how I can get PHP to loop through and pull out each
option value?  They are separated by a comma.  Right now, it only grabs the
last file even though all files are highlighted before submission.

thanks



--- End Message ---
--- Begin Message ---
On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
> I have this javascript that enables browsing and selecting of a file.  This
> file location and name are then transferred further down in the form as an
> <option>.  Multiple files may be chosen as they are just added one below the
> other.  Anyway, when the form is submitted it is only retrieving the last
> file name from the form.  How can I get PHP to return all the values from
> the <select> part.  Basically this is what is happening:
> 
> 1.  Choose a file  <input type="file" name="viewing" onchange="loadImg();">
> 2. File location and name are displayed in the
> <select name="imgList" style="width:350;" size="6" multiple></select> as
> <option value="c:\images\filename.gif">c:\images\filename.gif</option>
> The javascript creates the option and a new option is added and appended
> when a new file is chosen.
> 3. Submit form to php script to send location and stuff to database.
> 
> Anyone have any ideas of how I can get PHP to loop through and pull out each
> option value?  They are separated by a comma.  Right now, it only grabs the
> last file even though all files are highlighted before submission.
> 
> thanks


http://ca2.php.net/manual/en/faq.html.php#faq.html.select-multiple


Hope this helps,

Torben  

-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




--- End Message ---
--- Begin Message ---
I think that will do it.

thanks,

----- Original Message ----- 
From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
To: "Micah Montoy" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 05, 2003 4:59 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.


> On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
> > I have this javascript that enables browsing and selecting of a file.
This
> > file location and name are then transferred further down in the form as
an
> > <option>.  Multiple files may be chosen as they are just added one below
the
> > other.  Anyway, when the form is submitted it is only retrieving the
last
> > file name from the form.  How can I get PHP to return all the values
from
> > the <select> part.  Basically this is what is happening:
> >
> > 1.  Choose a file  <input type="file" name="viewing"
onchange="loadImg();">
> > 2. File location and name are displayed in the
> > <select name="imgList" style="width:350;" size="6" multiple></select> as
> > <option value="c:\images\filename.gif">c:\images\filename.gif</option>
> > The javascript creates the option and a new option is added and appended
> > when a new file is chosen.
> > 3. Submit form to php script to send location and stuff to database.
> >
> > Anyone have any ideas of how I can get PHP to loop through and pull out
each
> > option value?  They are separated by a comma.  Right now, it only grabs
the
> > last file even though all files are highlighted before submission.
> >
> > thanks
>
>
> http://ca2.php.net/manual/en/faq.html.php#faq.html.select-multiple
>
>
> Hope this helps,
>
> Torben
>
> -- 
>  Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
>  http://www.thebuttlesschaps.com          http://www.inflatableeye.com
>  http://www.hybrid17.com                  http://www.themainonmain.com
>  -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----
>
>
>
>



--- End Message ---
--- Begin Message ---
Yeah, this is the behavior of select lists.  What comes through in the form
post is the item that was last selected.  

What I've found you have to do with javascript is populate a hidden field
with the values, using some delimiter (I've used commas) and you can easily
explode those values into an array in the processing script.

In your form have an onsubmit like this:

onSubmit="SetList2Values(this.yourlist,this.list2values)"

(change list2values to the hidden field you define for this purpose.

Here's the javascript function list2values I use:

echo "function SetList2Values(box,list2values)  {\n";
echo "var t = \"\";";
echo "for(var i=0; i<box.options.length; i++) {\n";
echo "if(box.options[i].value != \"\") {\n";
echo "t = t + box.options[i].value + \",\";\n";
echo "      }\n";
echo "   }\n";
echo "list2values.value = t;";
echo "return true;}\n";

echo "// End -->\n";
echo "</script>\n";


In the post script I have:

$rListvalues = explode(",", $_POST['list2values']);

foreach through that and do your processing.

-----Original Message-----
From: Micah Montoy [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 3:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] looping through values from a field? Need hellp.


1.  Choose a file  <input type="file" name="viewing" onchange="loadImg();">
2. File location and name are displayed in the
<select name="imgList" style="width:350;" size="6" multiple></select> as
<option value="c:\images\filename.gif">c:\images\filename.gif</option>
The javascript creates the option and a new option is added and appended
when a new file is chosen.
3. Submit form to php script to send location and stuff to database.

Anyone have any ideas of how I can get PHP to loop through and pull out each
option value?  They are separated by a comma.  Right now, it only grabs the
last file even though all files are highlighted before submission.




--- End Message ---
--- Begin Message ---
Ok.  I gave it a shot but have run into one other question that I wasn't
able to find that was addressed by the article.

My select statement looks like this:

<select name="imgList[]" style="width:350;" size="6" multiple></select>

When I create the php file, I am trying something like below but it isn't
working and I am receiving an error.  What am I not doing?

$filename = $_POST["imgList"];

for each ($filename as $value) {
 echo $value;
}

thanks



----- Original Message ----- 
From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
To: "Micah Montoy" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 05, 2003 4:59 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.


> On Sat, 2003-07-05 at 15:55, Micah Montoy wrote:
> > I have this javascript that enables browsing and selecting of a file.
This
> > file location and name are then transferred further down in the form as
an
> > <option>.  Multiple files may be chosen as they are just added one below
the
> > other.  Anyway, when the form is submitted it is only retrieving the
last
> > file name from the form.  How can I get PHP to return all the values
from
> > the <select> part.  Basically this is what is happening:
> >
> > 1.  Choose a file  <input type="file" name="viewing"
onchange="loadImg();">
> > 2. File location and name are displayed in the
> > <select name="imgList" style="width:350;" size="6" multiple></select> as
> > <option value="c:\images\filename.gif">c:\images\filename.gif</option>
> > The javascript creates the option and a new option is added and appended
> > when a new file is chosen.
> > 3. Submit form to php script to send location and stuff to database.
> >
> > Anyone have any ideas of how I can get PHP to loop through and pull out
each
> > option value?  They are separated by a comma.  Right now, it only grabs
the
> > last file even though all files are highlighted before submission.
> >
> > thanks
>
>
> http://ca2.php.net/manual/en/faq.html.php#faq.html.select-multiple
>
>
> Hope this helps,
>
> Torben
>
> -- 
>  Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
>  http://www.thebuttlesschaps.com          http://www.inflatableeye.com
>  http://www.hybrid17.com                  http://www.themainonmain.com
>  -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----
>
>
>
>



--- End Message ---
--- Begin Message ---
On Sat, 2003-07-05 at 17:13, Micah Montoya wrote:
> Ok.  I gave it a shot but have run into one other question that I wasn't
> able to find that was addressed by the article.
> 
> My select statement looks like this:
> 
> <select name="imgList[]" style="width:350;" size="6" multiple></select>
> 
> When I create the php file, I am trying something like below but it isn't
> working and I am receiving an error.  What am I not doing?
> 
> $filename = $_POST["imgList"];
> 
> for each ($filename as $value) {
>  echo $value;
> }
> 
> thanks

Impossible to say without know what the error says. :) Anyway, if that
code is cut-and-pasted, then 'foreach' should have no space in it. That
would cause a parse error. Otherwise, you could be getting a Notice
if you're actually passing something in via method="GET" but checking
the $_POST array instead.



-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




--- End Message ---
--- Begin Message ---
That was the trick.  Just the space was messing things up.  Thanks.


----- Original Message ----- 
From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
To: "Micah Montoya" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, July 05, 2003 6:18 PM
Subject: Re: [PHP] looping through values from a field? Need hellp.


> On Sat, 2003-07-05 at 17:13, Micah Montoya wrote:
> > Ok.  I gave it a shot but have run into one other question that I wasn't
> > able to find that was addressed by the article.
> >
> > My select statement looks like this:
> >
> > <select name="imgList[]" style="width:350;" size="6" multiple></select>
> >
> > When I create the php file, I am trying something like below but it
isn't
> > working and I am receiving an error.  What am I not doing?
> >
> > $filename = $_POST["imgList"];
> >
> > for each ($filename as $value) {
> >  echo $value;
> > }
> >
> > thanks
>
> Impossible to say without know what the error says. :) Anyway, if that
> code is cut-and-pasted, then 'foreach' should have no space in it. That
> would cause a parse error. Otherwise, you could be getting a Notice
> if you're actually passing something in via method="GET" but checking
> the $_POST array instead.
>
>
>
> -- 
>  Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
>  http://www.thebuttlesschaps.com          http://www.inflatableeye.com
>  http://www.hybrid17.com                  http://www.themainonmain.com
>  -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----
>
>
>
>



--- End Message ---
--- Begin Message ---
This has no effect on stream operations.  I have a timeout set in php.ini,
but the script never times out, so that should further illustrate the issue.

-----Original Message-----
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 5:11 AM
To: Giz
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Timing out fopen using https stream wrapper?

> It seems I have been over the documentation repeatedly, but there simply
> isn't any documented way of setting a timeout duration.  Any ideas? 

If you want to set a time out on execution of the /script/, check out:

http://us3.php.net/manual/en/function.set-time-limit.php

-Dan



--- End Message ---
--- Begin Message ---
That only works to set a timeout on reading data once the fopen has
successfully returned. The problem is that the fopen function is hanging.

-----Original Message-----
From: Arjen Brouwer [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 6:08 AM
To: Giz
Subject: Re: [PHP] Timing out fopen using https stream wrapper?

check: http://php.net/stream_set_timeout

----- Original Message ----- 
From: "Giz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 05, 2003 2:09 PM
Subject: [PHP] Timing out fopen using https stream wrapper?


> I have a class that uses fopen to read some xml data from a site with
> ongoing stability issues.  Fopen is using the stream wrapper for http.
>
> Something I've struggled with is finding a way to set a timeout value when
> fopen is attempting to get a page from a site that is inaccessible for
some
> reason.
>
> On my test server, the behavior is that fopen seems to hang up, and the
> script never returns.
>
> It seems I have been over the documentation repeatedly, but there simply
> isn't any documented way of setting a timeout duration.  Any ideas?
>
>
>
>
>
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



--- End Message ---
--- Begin Message ---
> This has no effect on stream operations.  I have a timeout set in php.ini,
> but the script never times out, so that should further illustrate the issue.

But if you'd visited the page I sent you and viewed user comments you
would see how to set a time limit for socket operations (what you're
doing).

-Dan


--- End Message ---
--- Begin Message ---
I've looked at that page extensively and seen nothing there that would
handle my issue, long before I ever mailed the problem to this list.  What
in particular from there did you see that would be useful to my use of
fopen('http://etc')?

-----Original Message-----
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 5:28 PM
To: Giz
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Timing out fopen using https stream wrapper?

> This has no effect on stream operations.  I have a timeout set in php.ini,
> but the script never times out, so that should further illustrate the
issue.

But if you'd visited the page I sent you and viewed user comments you
would see how to set a time limit for socket operations (what you're
doing).

-Dan



--- End Message ---
--- Begin Message ---
>From the user comments:
I think it might be useful to point out that set_time_limit() doesn't
have any effect on stream operations. A stalled script, either during
open operations (e.g. fsockopen()) or read operations (e.g. fgets()),
can make your script run "forever".

So it would be advisable to define timeouts for opening sockets (with
the timeout parameter in fsockopen()) and for reading data from sockets
(with socket_set_timeout()).

So, yes, you would have had to go to:
http://us3.php.net/manual/en/function.fsockopen.php

Sorry about that but I didn't exactly have lots of time on my hands at
the time to give you more details.

-Dan

On Sat, 2003-07-05 at 21:27, Giz wrote:
> I've looked at that page extensively and seen nothing there that would
> handle my issue, long before I ever mailed the problem to this list.  What
> in particular from there did you see that would be useful to my use of
> fopen('http://etc')?
> 
> -----Original Message-----
> From: Dan Anderson [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 05, 2003 5:28 PM
> To: Giz
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Timing out fopen using https stream wrapper?
> 
> > This has no effect on stream operations.  I have a timeout set in php.ini,
> > but the script never times out, so that should further illustrate the
> issue.
> 
> But if you'd visited the page I sent you and viewed user comments you
> would see how to set a time limit for socket operations (what you're
> doing).
> 
> -Dan
> 
> 


--- End Message ---
--- Begin Message ---
Thanks for the reply,
  Well hopefully this will help narrow down the issue.  With Fsockopen a
timeout can be passed, however, this is using fopen.  I am hoping there may
be some obscure way of setting a timeout but so far, I've not been able to
find one.

-----Original Message-----
From: Dan Anderson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 6:26 PM
To: Giz
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Timing out fopen using https stream wrapper?

>From the user comments:
I think it might be useful to point out that set_time_limit() doesn't
have any effect on stream operations. A stalled script, either during
open operations (e.g. fsockopen()) or read operations (e.g. fgets()),
can make your script run "forever".

So it would be advisable to define timeouts for opening sockets (with
the timeout parameter in fsockopen()) and for reading data from sockets
(with socket_set_timeout()).

So, yes, you would have had to go to:
http://us3.php.net/manual/en/function.fsockopen.php

Sorry about that but I didn't exactly have lots of time on my hands at
the time to give you more details.

-Dan

On Sat, 2003-07-05 at 21:27, Giz wrote:
> I've looked at that page extensively and seen nothing there that would
> handle my issue, long before I ever mailed the problem to this list.  What
> in particular from there did you see that would be useful to my use of
> fopen('http://etc')?
> 
> -----Original Message-----
> From: Dan Anderson [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 05, 2003 5:28 PM
> To: Giz
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] Timing out fopen using https stream wrapper?
> 
> > This has no effect on stream operations.  I have a timeout set in
php.ini,
> > but the script never times out, so that should further illustrate the
> issue.
> 
> But if you'd visited the page I sent you and viewed user comments you
> would see how to set a time limit for socket operations (what you're
> doing).
> 
> -Dan
> 
> 



--- End Message ---
--- Begin Message ---
This add a bit more functionality, in that it will adjust to the nearest end
of a word, and includes a 'more' link to the full text.  This also assumes
that the article may already only be 50 chars or less.

$maxsize = 50; // might be better as a DEFINE
$post = $row->text;
$post = (strlen($post) > $maxsize ) ? substr(substr($post,0,$maxsize-1), 0,
strrpos(substr($post,0,$maxsize-1),' '))."...<a
href='your_url_to_full_text'> more</a>" : $post; 
        

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 6:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Limit output of query field

Hi there,

Hope you can help me with the following:

I have a query and i'm showing the output:

echo $row->text;

That goes o.k. but the text is 400 characters long and I only one to show
the first 50 characters and at the end showing ... dot's..

Help!

Thank you very much!

Frank




--- End Message ---
--- Begin Message ---
You need to seek help from a phpnuke support forum.

-----Original Message-----
From: Mr|P [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 7:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Permission Problem

I moved from myphpnuke to phpnuke.

When trying to register a new user account on the website it get the error:
You are trying to access a restricted area.
We are Sorry, but this section of our site is for Registered Users Only.

Thanks for your help.



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



--- End Message ---
--- Begin Message ---
My guess is that you actually have 2 rows in the table for every forumID.

-----Original Message-----
From: Paul Ferrie [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] simple query help

anyways i am tyring to delete the threadCount by -1 from the db.
could below does dlete the count but in multipules of 2.

Anyone

cheers

$query = "UPDATE forumForums SET threadCount = threadCount -1 WHERE forumID
= $forumID";
if(!mysql_query($query)) {
    fail("Error deleting thread Count");
}
$result = @mysql_query($query);




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



--- End Message ---
--- Begin Message ---
Bleh nevermind, it's because you were executing the query twice (calling
mysql_query in the if () and then again below.

-----Original Message-----
From: Giz [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 4:37 PM
To: 'Paul Ferrie'; [EMAIL PROTECTED]
Subject: RE: [PHP] simple query help

My guess is that you actually have 2 rows in the table for every forumID.

-----Original Message-----
From: Paul Ferrie [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 05, 2003 8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] simple query help


$query = "UPDATE forumForums SET threadCount = threadCount -1 WHERE forumID
= $forumID";
if(!mysql_query($query)) {
    fail("Error deleting thread Count");
}
$result = @mysql_query($query);




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



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



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

I have a very simple form that searches a MySQL database and I want to
be able to have the search appear on the same page as the search.

        <FORM NAME="search" METHOD="post" ACTION="<? $PHP_SELF; ?>">
        <INPUT type=text size=30 name=player>
        <INPUT TYPE="image" src="../images/submit.gif" width="75"
height"30" value="submit">
        </FORM>

The part that confuses me is how I run the code for the search.
Currently I have it in a function and at the top of the script I have an
IF statement that checks to see if the submit button has been pressed,
if it has I go to the function. This is not working, and I'm not even
sure this is the right way to go about it. 

I'm probably doing this wrong and would appreciate it if someone could
set me straight.


--- End Message ---
--- Begin Message ---
I just figured it out, so I guess I was on the right track - I just
forgot to make the variable name in the form global. 

-----Original Message-----
From: Beauford.2005 [mailto:[EMAIL PROTECTED] 
Sent: July 5, 2003 7:43 PM
To: PHP
Subject: Forms and PHP_SELF


Hi,

I have a very simple form that searches a MySQL database and I want to
be able to have the search appear on the same page as the search.

        <FORM NAME="search" METHOD="post" ACTION="<? $PHP_SELF; ?>">
        <INPUT type=text size=30 name=player>
        <INPUT TYPE="image" src="../images/submit.gif" width="75"
height"30" value="submit">
        </FORM>

The part that confuses me is how I run the code for the search.
Currently I have it in a function and at the top of the script I have an
IF statement that checks to see if the submit button has been pressed,
if it has I go to the function. This is not working, and I'm not even
sure this is the right way to go about it. 

I'm probably doing this wrong and would appreciate it if someone could
set me straight.


--- End Message ---
--- Begin Message ---
For print $PHP_SELF, or $_SERVER['PHP_SELF'] use:

<?php echo $_SERVER['PHP_SELF']; ?>

or the shortcur sintax:

<?=$_SERVER['PHP_SELF']?>

(if short_open_tag = On in php.ini)



----- Original Message ----- 
From: "Beauford.2005" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Sunday, July 06, 2003 1:43 AM
Subject: [PHP] Forms and PHP_SELF


> Hi,
> 
> I have a very simple form that searches a MySQL database and I want to
> be able to have the search appear on the same page as the search.
> 
>         <FORM NAME="search" METHOD="post" ACTION="<? $PHP_SELF; ?>">
>         <INPUT type=text size=30 name=player>
>         <INPUT TYPE="image" src="../images/submit.gif" width="75"
> height"30" value="submit">
>         </FORM>
> 
> The part that confuses me is how I run the code for the search.
> Currently I have it in a function and at the top of the script I have an
> IF statement that checks to see if the submit button has been pressed,
> if it has I go to the function. This is not working, and I'm not even
> sure this is the right way to go about it. 
> 
> I'm probably doing this wrong and would appreciate it if someone could
> set me straight.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
        Be careful when using PHP self.  Not all servers support it.  If you're
planning on using this script over and over on multiple servers you may
find creating a variable is helpful.

$some_variable = "the_script_name.php";

        Then, where you would use PHP_SELF just echo (or whatever)
$some_variable.  You will have to change it if the script name changes,
but otherwise it's just a relative path.

-Dan

On Sat, 2003-07-05 at 19:43, Beauford.2005 wrote:
> Hi,
> 
> I have a very simple form that searches a MySQL database and I want to
> be able to have the search appear on the same page as the search.
> 
>         <FORM NAME="search" METHOD="post" ACTION="<? $PHP_SELF; ?>">
>         <INPUT type=text size=30 name=player>
>         <INPUT TYPE="image" src="../images/submit.gif" width="75"
> height"30" value="submit">
>         </FORM>
> 
> The part that confuses me is how I run the code for the search.
> Currently I have it in a function and at the top of the script I have an
> IF statement that checks to see if the submit button has been pressed,
> if it has I go to the function. This is not working, and I'm not even
> sure this is the right way to go about it. 
> 
> I'm probably doing this wrong and would appreciate it if someone could
> set me straight.
> 


--- End Message ---
--- Begin Message --- Dan Anderson wrote:

        Be careful when using PHP self.  Not all servers support it.  If you're
planning on using this script over and over on multiple servers you may
find creating a variable is helpful.

$some_variable = "the_script_name.php";

Then, where you would use PHP_SELF just echo (or whatever)
$some_variable. You will have to change it if the script name changes,
but otherwise it's just a relative path.


Please don't mislead users! That's plain untrue. You're correct that not all servers have register_globals on, so use $HTTP_SERVER_VARS['PHP_SELF'].

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



--- End Message ---
--- Begin Message ---
> Please don't mislead users!  That's plain untrue.  

I assure you that server administrators can turn off the variables such
as PHP SELF.  It may not be common but it does happen.

-Dan


--- End Message ---
--- Begin Message --- Dan Anderson wrote:

I assure you that server administrators can turn off the variables such
as PHP SELF.  It may not be common but it does happen.

The only way to do that would be editing the PHP source. That's above the IQ of any sysadmin who would want to do that.

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



--- End Message ---
--- Begin Message --- X-posted to PHP General, PHP DB, and MySQL

Hi gang

Attempting to get my Linux test-server working, but ran into a problem when "making" PHP...

System is RedHat 8, Apache 1.3.27 (compiled myself, tested OK), MySQL 4.0.13.

The Apache 2.0.40 and PHP 4.2.2 that came w. RH8 didn't work correctly, thus I've ventured into my own creation.

Trying to build PHP 4.2.3 (because that's what my webhost runs, so need that version to test correctly) w. support for MySQL. Running

./configure --with-mysql=/[path to mysql] --with-apxs=/[path to apxs]

Found the path to the apxs to be /usr/local/apache/bin/apxs, but for the life of me I cannot figure out what path to give it for MySQL. I installed MySQL from the the RPM files:
MySQL-client-4.0.13-0.i386.rpm
MySQL-devel-4.0.13-0.i386.rpm
MySQL-embedded-4.0.13-0.i386.rpm
MySQL-server-4.0.13-0.i386.rpm
MySQL-shared-4.0.13-0.i386.rpm


client and server first, the rest second ... used --force to get them in, because it complained about version issues with the one already there (even though the package manager was told not to put the Mysql in, it still put MySQL 3.something in...)

When doing the configure above, I get this error:

configure: error: Cannot find header files under /usr/include

or whatever path I give it ... I'm having a hard time figuring out where the RPM puts everything, and an even harder time figuring out what path to stick to PHP ...

Some detective work gave me these paths:

MySQL (bins):
/usr/bin
/usr/share/mysql
MySQL daemon (mysqld):
/usr/libexec
/usr/sbin
MySQL headers (.h):
/usr/include/mysql

I've tried them all, but they all result in the above error. Anyone care to guess which path I should give to the configure?

Or is it something else that causes this?
I haven't ever used MySQL before, or any other SQL for that matter, so got 0 experience in getting the system up and running with it...


TIA

Rene
--
Rene Brehmer
aka Metalbunny

http://metalbunny.net/
References, tools, and other useful stuff...


--- End Message ---
--- Begin Message ---
Hello !!

When I make a query with sqlite_query() and use sqlite_fetch_array() all
works well:

Example:

$result = sqlite_query('SELECT * FROM test', $conn);
while($row = sqlite_fetch_array($resulr, SQLITE_NUM, true)){
    $rows[] = $row;
}

$rows is:

Array
(
    [0] => Array
        (
            [0] => 1
            [1] => toro
            [2] => 10
            [3] => 500.00
        )

    [1] => Array
        (
            [0] => 2
            [1] => gallo
            [2] => 5
            [3] => 200.00
        )

    [2] => Array
        (
            [0] => 3
            [1] => rana
            [2] => 20
            [3] => 100.00
        )

    [3] => Array
        (
            [0] => 4
            [1] => cane
            [2] => 3
            [3] => 500.00
        )

)

if I use sqlite_seek() and sqlite_current:

if(sqlite_seek($result,1)){
    $row = sqlite_current($result, SQLITE_NUM, true);
}

$row is:

Array
        (
            [0] => 2
            [1] => gallo
            [2] => 5
            [3] => 200.00
        )

in place of the first record return the second (The row number is one-based (1 is the 
first row) in sqlite_seek()).
using sqlite_rewrite() and sqlite_current() I obtain the first record, but it is not 
possible to obtainthe first record 
of a rowset with sqlite_seek() and sqlite_current()? I am writing a pretty class for 
SQLite, this is the last problem 
that I have before the release :) but I do not find other documentation for sqlite and 
PHP.

Thank

Alan D'Angelo

--- End Message ---
--- Begin Message ---
try --with-mysql=/usr


--- -{ Rene Brehmer }- <[EMAIL PROTECTED]>
wrote:
> X-posted to PHP General, PHP DB, and MySQL
> 
> Hi gang
> 
> Attempting to get my Linux test-server working, but
> ran into a problem when 
> "making" PHP...
> 
> System is RedHat 8, Apache 1.3.27 (compiled myself,
> tested OK), MySQL 4.0.13.
> 
> The Apache 2.0.40 and PHP 4.2.2 that came w. RH8
> didn't work correctly, 
> thus I've ventured into my own creation.
> 
> Trying to build PHP 4.2.3 (because that's what my
> webhost runs, so need 
> that version to test correctly) w. support for
> MySQL. Running
> 
> ./configure --with-mysql=/[path to mysql]
> --with-apxs=/[path to apxs]
> 
> Found the path to the apxs to be
> /usr/local/apache/bin/apxs, but for the 
> life of me I cannot figure out what path to give it
> for MySQL. I installed 
> MySQL from the the RPM files:
> MySQL-client-4.0.13-0.i386.rpm
> MySQL-devel-4.0.13-0.i386.rpm
> MySQL-embedded-4.0.13-0.i386.rpm
> MySQL-server-4.0.13-0.i386.rpm
> MySQL-shared-4.0.13-0.i386.rpm
> 
> client and server first, the rest second ... used
> --force to get them in, 
> because it complained about version issues with the
> one already there (even 
> though the package manager was told not to put the
> Mysql in, it still put 
> MySQL 3.something in...)
> 
> When doing the configure above, I get this error:
> 
> configure: error: Cannot find header files under
> /usr/include
> 
> or whatever path I give it ... I'm having a hard
> time figuring out where 
> the RPM puts everything, and an even harder time
> figuring out what path to 
> stick to PHP ...
> 
> Some detective work gave me these paths:
> 
> MySQL (bins):
> /usr/bin
> /usr/share/mysql
> MySQL daemon (mysqld):
> /usr/libexec
> /usr/sbin
> MySQL headers (.h):
> /usr/include/mysql
> 
> I've tried them all, but they all result in the
> above error. Anyone care to 
> guess which path I should give to the configure?
> 
> Or is it something else that causes this?
> I haven't ever used MySQL before, or any other SQL
> for that matter, so got 
> 0 experience in getting the system up and running
> with it...
> 
> TIA
> 
> Rene

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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

Is it possible to determine whether a class implements an interface without instantiating an object of that class?

<?php
interface tester {
    function doesStuff();
}

class MyClass implements tester {
    function doesStuff(){}
}

$var = 'MyClass';

if ($var instanceof_equiv tester) {
    ...
}
?>

I really need this kind of capability to determine whether an argument is a valid class for the purposes needed. I guess if reflection makes it into beta 2, I will have what I need, but is there something in beta 1?

Thanks,
Greg


--- End Message ---
--- Begin Message ---
I am trying to write a script but for security I need to verify that it is
not executed by a web server.  At this point I have just placed it outside
the htdocs tree but would like to build into the script a test to die if it
is being executed by a web server.

Thanks

Jeff Means
CIO for MeansPC
[EMAIL PROTECTED]


--- End Message ---

Reply via email to