php-general Digest 22 May 2001 14:13:16 -0000 Issue 701
Topics (messages 53802 through 53855):
Re: Secure LDAP and php 4.0.4pl1
53802 by: Stig Venaas
.....RESPONSE TO YOUR ADVERTISEMENT........
53803 by: bigsavings555.yahoo.com
PHP & RUBY
53804 by: Maxim Maletsky
53811 by: Rasmus Lerdorf
53812 by: Maxim Maletsky
53814 by: John Monfort
53815 by: Maxim Maletsky
Re: What's wrong with this code?
53805 by: Plutarck
53809 by: Christian Reiniger
53845 by: Plutarck
Send attachments with an email (Sample Code for you lot :))
53806 by: Jason Murray
53807 by: Jason Murray
53808 by: Plutarck
53810 by: Jason Lotito
Is the session ID of php4 made like a session cookie?
53813 by: $B>>K\!!8y0l(B
Re: why does it not work (fwd)
53816 by: Adrian D'Costa
53817 by: Adrian D'Costa
regex
53818 by: Dennis Gearon
53821 by: Gyozo Papp
53834 by: CC Zona
Re: Encrypt Password for Session
53819 by: Joseph Blythe
Re: replacing directory references at beginning of file name
53820 by: James Holloway
returned eMails
53822 by: Jean-Arthur Silve
53826 by: Zak Greant
53839 by: Maxim Maletsky
ftp_put
53823 by: Jon A
53825 by: Zak Greant
All of a sudden I get Warning: Bad arguments to implode() in busca_01.php on line 133
53824 by: Martin Cabrera Diaubalick
53827 by: Zak Greant
53828 by: Zak Greant
53837 by: Maxim Maletsky
Re: Recompiling PHP with MySQL
53829 by: Chris Lee
53843 by: Pavel Jartsev
Class and extends pb/bug? with php404pl1
53830 by: Hugues BRUNEL
53836 by: Maxim Maletsky
53847 by: Christian Reiniger
Re: PHP & URL Question - omitting index.php
53831 by: Tomaz Kovacic
Opera > Localhost
53832 by: Tarrant Costelloe
53835 by: Maxim Maletsky
using Delphi code with PHP
53833 by: Gilles Koffmann
53842 by: John Lim
Problems with php 4.0.5 with iplanet 4
53838 by: Felix Garcia Renedo
fput
53840 by: Vanessa
Max execution time for exec()?
53841 by: Charles Williams \(CEO\)
53844 by: George E. Papadakis
Re: best way to flush stdout?
53846 by: Plutarck
sessions without trans_id
53848 by: Dalyyla
Re: I am newbie and I can't resist anymore !!!!
53849 by: Daniel BI
Running two scripts from HTML
53850 by: Luis E. Suarez
Re: mysql and user-defined functions
53851 by: Lybarger, Denver J (LYBARDJ8)
53852 by: Alexander Wagner
Re: Class var not retaining values
53853 by: Chris Sano
Array Problem
53854 by: Tom
Re: unset()- newbie question
53855 by: Chris Sano
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]
----------------------------------------------------------------------
On Mon, May 21, 2001 at 07:48:27PM -0400, Scott Russell wrote:
> Using php 4.0.4pl1 with ssl and ldap support I'm connecting to a secure ldap
> server. I want to be able to specify which level of ssl support I use,
> either ssl1, ssl2, or ssl3. By default it appears as if php is trying to
> connect using ssl3 which on my server fails during the ssl handshake.
>
> How can I tell the ldap_connect() / ldap_bind() functions to use ssl2 instead?
All the work is done by the LDAP library, PHP just calls the LDAP library
with ldaps://hostname, and the library does the rest. You would need to
specify it in ldap.conf or something if at all possible.
There was a problem with SSL/TLS and SASL in OpenLDAP. This should be
fixed in 2.0.8, perhaps you should try without SASL if your library is
compiled with SASL support. I've never had to care about ssl versions,
I thought that should be worked out automatically.
Stig
Dear [EMAIL PROTECTED],
We are responding to your classified advertisement online
and thought you would be interested in learning how to Increase
your current sales at least 30 times what they are now...GUARANTEED!
WOULD YOU LIKE TO HAVE 5 MILLION DELIVERABLE OPT-IN
EMAIL ADDRESSES...JUST EXTRACTED ON 4/26/01 - 5/14/0?
Plus TONS of FREE MARKETING SOFTWARE?
Visit our web site today for more exciting information...
http://quicksitebuilder.cnet.com/freesoftware1/marketingsoftware
If you would like to be removed from our list at any time, simply send us
an email at [EMAIL PROTECTED]
and type "remove" in the "subject line".
Hello gurus,
does anyone know a way to make PHP and RUBY running together (parsing both
the same file) ?
This is what I tried to do:
httpd.conf:
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .html
#Action application/x-httpd-php "/php/php.exe"
AddType application/x-httpd-eruby .rhtml .html
Action application/x-httpd-eruby /cgi-bin/eruby
as you can see PHP runs as apache's module and Ruby as CGI,
It works fine for .rhtml files (with ruby), but when I give them the same
file extension to parse only Ruby works, PHP shows the source.
I know this a wrong try, well, still a try. Has anyone tried to do the same?
Any success in any way?
There are some things I'd like Ruby to do while processing PHP files.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
Well, sort of by definition you can't do this. You can't have multiple
mime types mapping to the same extension. And even if you could, Apache
can only have one content-generating phase. Anything that generates
content will send it back to the client. With Apache2 it will be possible
to layer multiple content filters on the same request.
-Rasmus
On Tue, 22 May 2001, Maxim Maletsky wrote:
> Hello gurus,
>
> does anyone know a way to make PHP and RUBY running together (parsing both
> the same file) ?
>
> This is what I tried to do:
>
> httpd.conf:
>
> AddType application/x-httpd-php-source .phps
> AddType application/x-httpd-php .html
>
> #Action application/x-httpd-php "/php/php.exe"
>
> AddType application/x-httpd-eruby .rhtml .html
> Action application/x-httpd-eruby /cgi-bin/eruby
>
> as you can see PHP runs as apache's module and Ruby as CGI,
>
> It works fine for .rhtml files (with ruby), but when I give them the same
> file extension to parse only Ruby works, PHP shows the source.
>
> I know this a wrong try, well, still a try. Has anyone tried to do the same?
> Any success in any way?
>
> There are some things I'd like Ruby to do while processing PHP files.
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
> PHPBeginner.com (Where PHP Begins)
> [EMAIL PROTECTED]
> www.phpbeginner.com
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Thanks Rasmus,
hope a stable Apache 2.0 comes out soon.
I have done some tests few minutes ago and discovered that eRuby is much
slower then PHP.
While might still have some advantages.
This is how I tested it:
ruby.php // with PHP
==========
<html><head><title>PHP example</title></head><body>
<h1>Enumeration</h1>
<ul>
<?for($i=1; $i<10; $i++) {?>
<li>number <?=$i?></li>
<?}?>
</ul>
<h1>Environment variables</h1>
<table>
<?foreach($HTTP_SERVER_VARS as $key=>$val) {?>
<tr>
<th><?=$key?></th><td><?=$HTTP_SERVER_VARS[$key]?></td>
</tr>
<?}?>
</table>
</body></html>
==========
ruby.rhtml // with eRuby
==========
<html><head><title>eruby example</title></head><body>
<h1>Enumeration</h1>
<ul>
<%(1..10).each do|i|%>
<li>number <%=i%></li>
<%end%>
</ul>
<h1>Environment variables</h1>
<table>
<%ENV.keys.sort.each do |key|%>
<tr>
<th><%=key%></th><td><%=ENV[key]%></td>
</tr>
<%end%>
</table>
</body></html>
==========
As you can see this is a sample of a very basic functionality.
It took 4 times longer to generate the page for Ruby.
(tested by eyes)
However, Ruby here was running as CGI. I believe the performance would be
better under mod_ruby.
Just for the reference in anyone else cares. (and to avoid some PHP vs
eRuby)
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 1:38 PM
To: Maxim Maletsky
Cc: 'PHP General List. (E-mail)'
Subject: Re: [PHP] PHP & RUBY
Well, sort of by definition you can't do this. You can't have multiple
mime types mapping to the same extension. And even if you could, Apache
can only have one content-generating phase. Anything that generates
content will send it back to the client. With Apache2 it will be possible
to layer multiple content filters on the same request.
-Rasmus
On Tue, 22 May 2001, Maxim Maletsky wrote:
> Hello gurus,
>
> does anyone know a way to make PHP and RUBY running together (parsing both
> the same file) ?
>
> This is what I tried to do:
>
> httpd.conf:
>
> AddType application/x-httpd-php-source .phps
> AddType application/x-httpd-php .html
>
> #Action application/x-httpd-php "/php/php.exe"
>
> AddType application/x-httpd-eruby .rhtml .html
> Action application/x-httpd-eruby /cgi-bin/eruby
>
> as you can see PHP runs as apache's module and Ruby as CGI,
>
> It works fine for .rhtml files (with ruby), but when I give them the same
> file extension to parse only Ruby works, PHP shows the source.
>
> I know this a wrong try, well, still a try. Has anyone tried to do the
same?
> Any success in any way?
>
> There are some things I'd like Ruby to do while processing PHP files.
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
> PHPBeginner.com (Where PHP Begins)
> [EMAIL PROTECTED]
> www.phpbeginner.com
>
>
>
What is RUBY?
-John
On Tue, 22 May 2001, Maxim Maletsky wrote:
> Hello gurus,
>
> does anyone know a way to make PHP and RUBY running together (parsing both
> the same file) ?
>
> This is what I tried to do:
>
> httpd.conf:
>
> AddType application/x-httpd-php-source .phps
> AddType application/x-httpd-php .html
>
> #Action application/x-httpd-php "/php/php.exe"
>
> AddType application/x-httpd-eruby .rhtml .html
> Action application/x-httpd-eruby /cgi-bin/eruby
>
> as you can see PHP runs as apache's module and Ruby as CGI,
>
> It works fine for .rhtml files (with ruby), but when I give them the same
> file extension to parse only Ruby works, PHP shows the source.
>
> I know this a wrong try, well, still a try. Has anyone tried to do the same?
> Any success in any way?
>
> There are some things I'd like Ruby to do while processing PHP files.
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
> PHPBeginner.com (Where PHP Begins)
> [EMAIL PROTECTED]
> www.phpbeginner.com
>
>
>
a new (?) infamous programming language.
Something similar to PHP but fully (religiously) Object Oriented.
It claims to be more OOOriented then Python while with easier syntax than
Perl.
eRuby (it's embedded scripting language for web) can also run as an apache
module, not only CGI (*nix only ).
Ruby itself can function in similar way C does. (including windows
management, command line, background jobs etc..)
It is written by some Japanese gurus and is quite famous here in Tokyo.
read on here:
http://www.ruby-lang.org/en/
Quite impressive as an idea and I really like it's language concept,
but it is still soooooo immature.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: John Monfort [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 2:42 PM
To: Maxim Maletsky
Cc: 'PHP General List. (E-mail)'
Subject: Re: [PHP] PHP & RUBY
What is RUBY?
-John
On Tue, 22 May 2001, Maxim Maletsky wrote:
> Hello gurus,
>
> does anyone know a way to make PHP and RUBY running together (parsing both
> the same file) ?
>
> This is what I tried to do:
>
> httpd.conf:
>
> AddType application/x-httpd-php-source .phps
> AddType application/x-httpd-php .html
>
> #Action application/x-httpd-php "/php/php.exe"
>
> AddType application/x-httpd-eruby .rhtml .html
> Action application/x-httpd-eruby /cgi-bin/eruby
>
> as you can see PHP runs as apache's module and Ruby as CGI,
>
> It works fine for .rhtml files (with ruby), but when I give them the same
> file extension to parse only Ruby works, PHP shows the source.
>
> I know this a wrong try, well, still a try. Has anyone tried to do the
same?
> Any success in any way?
>
> There are some things I'd like Ruby to do while processing PHP files.
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
> PHPBeginner.com (Where PHP Begins)
> [EMAIL PROTECTED]
> www.phpbeginner.com
>
>
>
Doh!
I read the part about what "." does and it didn't even register that it
won't match newlines.
Well now that part works ;)
And now one more bit. For instance to kill an onclick event I use:
$file = preg_replace("#<(.*)onclick=\".*\"(.*)>#isU", "<\\1\\2>", $file);
Which works, kinda. Problem is, consider this:
onclick='somecode()'
It's not caught, because it only catches double quotes. How best can I say I
want code which is between single quotes, or between double quotes, without
it choking on something like: onclick='somecode("thisiswhereitwouldstop")'?
Should I just copy the regex to another line and replace single quotes with
double quotes, thus doing two searches rather than trying to do it all at
one time?
Plutarck
"Christian Reiniger" <[EMAIL PROTECTED]> wrote in message
01052120275102.00644@chrisbig">news:01052120275102.00644@chrisbig...
On Monday 21 May 2001 16:23, Plutarck wrote:
> Since there is a "/" in the code itself, I use "#" as a delimiter
> instead so I don't have to escape it, making it harder to read.
>
> So here's the code:
>
> $file = preg_replace("#<script.*>.*</script>#Ui", "<!-- RWW: Scripting
> killed -->", $file);
Stupid error (noticed this after trying for ~10 minutes...):
Add the "s" modifier. Otherwise "." doesn't match newlines.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
Error 032: Recursion error - see error 032
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Tuesday 22 May 2001 05:06, Plutarck wrote:
> And now one more bit. For instance to kill an onclick event I use:
>
> $file = preg_replace("#<(.*)onclick=\".*\"(.*)>#isU", "<\\1\\2>",
> $file);
>
> Which works, kinda. Problem is, consider this:
>
> onclick='somecode()'
>
> It's not caught, because it only catches double quotes. How best can I
> say I want code which is between single quotes, or between double
> quotes, without it choking on something like:
> onclick='somecode("thisiswhereitwouldstop")'?
#<(.*)onclick=(\"|').*\\2(.*)>#
A simple "or" combined with a backreference. And don't forget to adjust
your replacement string..
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
Ahh, so you can use \\n within the regex itself...I was thinking that what
was capture in the regex itself wasn't available until the "replace" part.
Obviously that's not true ;)
Thanks alot, everyone! One problem down, all the other one's to go :)
Plutarck
"Christian Reiniger" <[EMAIL PROTECTED]> wrote in message
01052206314400.00595@chrisbig">news:01052206314400.00595@chrisbig...
On Tuesday 22 May 2001 05:06, Plutarck wrote:
> And now one more bit. For instance to kill an onclick event I use:
>
> $file = preg_replace("#<(.*)onclick=\".*\"(.*)>#isU", "<\\1\\2>",
> $file);
>
> Which works, kinda. Problem is, consider this:
>
> onclick='somecode()'
>
> It's not caught, because it only catches double quotes. How best can I
> say I want code which is between single quotes, or between double
> quotes, without it choking on something like:
> onclick='somecode("thisiswhereitwouldstop")'?
#<(.*)onclick=(\"|').*\\2(.*)>#
A simple "or" combined with a backreference. And don't forget to adjust
your replacement string..
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi folks,
I see this question asked here all the time, and recently had to implement
it.
Every class and solution I downloaded and tried to use failed for one reason
or
another, so I threw together this, instead.
Advatages:
* Quick :)
* It's a function, so you can call it from most places if it's include()'d.
Disadvantages:
* Quick, so probably buggy :)
* I haven't put in any facility for sending a HTML version of your mail
text
yet. We don't send HTML mails @ Melbourne IT, so it wasn't needed.
Usage:
mailattachments((DestinationAddress), (Subject), (Email Body), (File
Attachment Info),
(Extra Headers));
"File Attachment Info" is an array:
$fileattach[] = array("filename" =>
"/full/path/to/file/on/your/system",
"mimetype" => "mimetype/here");
And the code guts:
<?
Function mailattachments( $to, $subject, $body, $attacharray,
$extraheaders)
{
// Generate a unique boundary
$mail_boundary = md5(uniqid(time()));
// MIME-compliant headers
$mailheaders = $extraheaders
."MIME-Version: 1.0\r\n"
."Content-type:
multipart/mixed;boundary=\"$mail_boundary\"\r\n"
."\r\n"
."This is a multipart MIME message\r\n"
."\r\n";
// Body. The part that gets displayed as the message:
$mailbody = "--$mail_boundary\r\n"
."Content-type: text/plain;charset=us-ascii\r\n"
."Content-transfer-encoding: 8bit\r\n"
."\r\n"
.$body
."\r\n";
// Now, do the attachments
for ($i = 0; $i < count($attacharray); $i++ )
{
$fp = fopen($attacharray[$i][filename], "r");
$file = fread($fp, filesize($attacharray[$i][filename]));
$file = base64_encode($file); // BASE64-encoded.
Text. Nice.
$file = chunk_split($file); // Now in handy
bite-sized 76-char chunks.
$filename = basename($attacharray[$i][filename]);
$mailbody .= "--$mail_boundary\r\n"
."Content-type: ".$attacharray[$i][mimetype].";
name=".$filename."\r\n"
."Content-transfer-encoding: base64\r\n"
."\r\n"
.$file
."\r\n"
."\r\n";
}
// End of mail
$mailbody .= "--$mail_boundary--";
mail($to, $subject, $mailbody, $mailheaders);
}
?>
Hope this helps someone out there...
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"What'll Scorpy use wormhole technology for?"
'Faster pizza delivery.'
> I see this question asked here all the time, and recently had
> to implement
> it.
Ugh, apologies for the crappy formatting.
*slap.outlook*
Jason
*makes a note to develop a fully functional, system independent Slap class*
Slap.setStrength(getMaxStrength());
Slap.setTarget(getLocation("Microsoft Outlook"));
Slap.slap;
*bows*
Plutarck
"Jason Murray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I see this question asked here all the time, and recently had
> > to implement
> > it.
>
> Ugh, apologies for the crappy formatting.
>
> *slap.outlook*
>
> Jason
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Jason,
I hope you don't mind, but I posted your script in my Code Depository
located here:
http://www.newbienetwork.net/phpcodems.php?as=viewcode&id=24
You are given credit, and hopefully it can get some use out of it.
Either way, thanks for showing us. =)
Jason Lotito
www.NewbieNetwork.net
> -----Original Message-----
> From: Jason Murray [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 21, 2001 11:34 PM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] Send attachments with an email (Sample Code
> for you lot :))
>
>
> Hi folks,
>
> I see this question asked here all the time, and recently had
> to implement it. Every class and solution I downloaded and
> tried to use failed for one reason or another, so I threw
> together this, instead.
>
> Advatages:
> * Quick :)
> * It's a function, so you can call it from most places if
> it's include()'d.
>
> Disadvantages:
> * Quick, so probably buggy :)
> * I haven't put in any facility for sending a HTML version
> of your mail text
> yet. We don't send HTML mails @ Melbourne IT, so it wasn't needed.
>
> Usage:
>
> mailattachments((DestinationAddress), (Subject), (Email
> Body), (File Attachment Info),
> (Extra Headers));
>
> "File Attachment Info" is an array:
>
> $fileattach[] = array("filename" =>
> "/full/path/to/file/on/your/system",
> "mimetype" => "mimetype/here");
>
> And the code guts:
>
> <?
> Function mailattachments( $to, $subject, $body, $attacharray,
> $extraheaders)
> {
> // Generate a unique boundary
> $mail_boundary = md5(uniqid(time()));
>
> // MIME-compliant headers
> $mailheaders = $extraheaders
> ."MIME-Version: 1.0\r\n"
> ."Content-type:
> multipart/mixed;boundary=\"$mail_boundary\"\r\n"
> ."\r\n"
> ."This is a multipart MIME message\r\n"
> ."\r\n";
>
> // Body. The part that gets displayed as the message:
> $mailbody = "--$mail_boundary\r\n"
> ."Content-type: text/plain;charset=us-ascii\r\n"
> ."Content-transfer-encoding: 8bit\r\n"
> ."\r\n"
> .$body
> ."\r\n";
>
> // Now, do the attachments
> for ($i = 0; $i < count($attacharray); $i++ )
> {
> $fp = fopen($attacharray[$i][filename], "r");
> $file = fread($fp, filesize($attacharray[$i][filename]));
>
> $file = base64_encode($file); //
> BASE64-encoded.
> Text. Nice.
> $file = chunk_split($file); //
> Now in handy
> bite-sized 76-char chunks.
> $filename = basename($attacharray[$i][filename]);
>
> $mailbody .= "--$mail_boundary\r\n"
> ."Content-type:
> ".$attacharray[$i][mimetype]."; name=".$filename."\r\n"
> ."Content-transfer-encoding: base64\r\n"
> ."\r\n"
> .$file
> ."\r\n"
> ."\r\n";
> }
>
> // End of mail
> $mailbody .= "--$mail_boundary--";
>
> mail($to, $subject, $mailbody, $mailheaders);
> }
> ?>
>
> Hope this helps someone out there...
>
> Jason
>
> --
> Jason Murray
> [EMAIL PROTECTED]
> Web Developer, Melbourne IT
> "What'll Scorpy use wormhole technology for?"
> 'Faster pizza delivery.'
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED] To contact the list
> administrators, e-mail: [EMAIL PROTECTED]
>
>
Is it possible to erase at the same time the session data of php4 closes a browser?
Please teach a method,
when a browser is closed and session data can be canceled.
- now Environment
OS RedHatLinux6.2
php 4.0.5
At php.ini, it is session.cookie_lifetime = 0.; session.cache_limiter = nocache ;
// Ichirou.Tanaka.
Hi,
I have the follow running on my local host rh 7.0
My version
+------------------+
| version() |
+------------------+
| 3.23.22-beta-log |
+------------------+
php
4.0.1pl2
my virtual host
mysql
+-----------+
| version() |
+-----------+
| 3.22.32 |
+-----------+
php running on some version of php3.
The below script works fine with my local host. Online it does not get
the next random record to display. What I am trying to do is to randomly
display a scroll from the special table. This happens when the page is
loaded or refreshed.
What I think is that php3 has some problem or mysql. Though I check the
select statement at the mysql prompt, it works. What could be the
problem.
// sql statement
$searchStmt = "select special.contid, special.cityid, special.curr1,
special.catalogo, special.hf, special.curr2, special.vitofferta,
special.fh, special.club, special.stars, city.city,RAND as r from
special,city where DATE_SUB(special.periodo, INTERVAL 3 DAY) >'$tdate'
and city.id=special.cityid order by r limit 1" ;
var timerID=null
var run=false
count = 10 // counter of cycles
ScrollSpeed = 800; // milliseconds between scrolls
ScrollChars = 1; // chars scrolled per time period
function Stop()
{
if(run) clearTimeout(timerID)
run=false
}
function Start()
{
Stop();
Marquee()
}
function Marquee()
{
var msg = document.forms[0].message.value;
var tmp = msg.substring(0,ScrollChars);
msg = msg.substring(ScrollChars) + tmp;
document.forms[0].message.value = msg;
if(count<200)
{
timerID = setTimeout('Marquee()',ScrollSpeed);
run= true;
count++;
}
}
<!-- end -->
</script>
<form>
<?php
while($row = mysql_fetch_object($result))
{
?>
<input name=message size=57 value="<?php echo
$row->city . ", " .
"Catalogo Prezzo" . " " .
$row->curr1 . " " .
$row->catalogo . " " .
$row->hf . ", " .
"Vitofferta" . " " .
$row->curr2 . " " .
$row->vitofferta . " " .
$row->fh; ?> ">
<?php } ?>
</form>
TIA
Adrian
On 22 May 2001, Chris Searle wrote:
> >>>>> "Adrian" == Adrian D'Costa <[EMAIL PROTECTED]> writes:
>
> Adrian> // sql statement $searchStmt = "select special.contid,
> Adrian> special.cityid, special.curr1, special.catalogo,
> Adrian> special.hf, special.curr2, special.vitofferta, special.fh,
> Adrian> special.club, special.stars, city.city,RAND as r from
> Adrian> special,city where DATE_SUB(special.periodo, INTERVAL 3
> Adrian> DAY) >'$tdate' and city.id=special.cityid order by r limit
> Adrian> 1" ;
>
> So far as I know - the RAND function was introduced in 3.23 - at least
> the order by RAND functionality.
>
> >From the docs:
>
> In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name
> ORDER BY RAND()
If I cut and past this in the online mysql it works. It display the
records randomly, why not in php?
Adrian
Is a '.' inside of a [] a literal '.', or a 'any character'
metacharacter?
--
-----------------------------------------------------------------
Look lovingly upon the present,
for it holds the only things that are forever true.
-----------------------------------------------------------------
Sincerely, Dennis Gearon (Kegley)
metacharacter.
----- Original Message -----
From: "Dennis Gearon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 2001. május 22. 09:34
Subject: [PHP] regex
> Is a '.' inside of a [] a literal '.', or a 'any character'
> ?
> --
> -----------------------------------------------------------------
> Look lovingly upon the present,
> for it holds the only things that are forever true.
> -----------------------------------------------------------------
> Sincerely, Dennis Gearon (Kegley)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> > Is a '.' inside of a [] a literal '.', or a 'any character'
> metacharacter.
In what regex syntax? In POSIX (ereg_*) and in PCRE (preg_*):
[.] //match a period
\. //match a period
. //match one instance of any character (which could be a period)
[[.foo.]] //match string "foo" (in POSIX, anyway; I'm not sure about PCRE)
--
CC
Troy Moreland wrote:
> If I can't decrypt it, then I can't pass that password for the
> user. How do I keep passing the password then w/o having to write it to the
> session. Is that the right way to do it??
I don't know if this is the right way but what I would do is have a
login page that does the md5 databse lookup, if it is successful writes
the users name to a variable to the current session, maybe $verified_user
Now every page tests for $verified_user you will know if they have
logged in correctly, This approach seems to work very well for me, I
don't know if there are any major security holes though?
example:
if ( isset($verified_user) ) {
$user = $verified_user;
} else {
$user = "nobody";
}
Hope this helps, it is pretty simple really.
Regards
Joseph
Dennis,
NOT tested:
$string = preg_replace("/^(\$|\\\|\/|\.)/i", "", $string);
James.
"Dennis Gearon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Could someone please send me the code for doing the above? I have the
> book, "Mastering Regex, blah blah", but I don't have time to read it
> until the end of the school quarter."
>
> I'd like to remove the following chars from the beginning of a string:
> '$', '\', '/', and '.' .
>
> I plan on doing it like so:
>
> while( ereg_replace( $dir_remove_patt, "", $file_name) ){;}
>
> I need the value for $dir_remove_patt, and I would be most grateful. I'm
> a stubborn kind of guy, and I don't usually ask for direct help; I'm not
> a moocher of code. But I could use some help, thanks :-)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Hi !
We have a site which send mails to customers regulary.
My problem is that when some mails are returned (bacause addresses are not
available or mailboxes are full etc..)
they are returned to the server administrator and not to the sender of the
message.
When I send a mail, I use the PHP mail function .
In the header I put "From: [EMAIL PROTECTED]\n\n"
The "From" is ok because when someone receive the message, it is From the
address I put.
May be is there another field to put in the header for the refused messages
are returned to the sender I want ?
Thank you for your help
jean-arthur
----------------------------------------------------------------
EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr
----------------------------------------------------------------
Read the entry on the mail function in the manual:
http://www.php.net/manual/fr/function.mail.php
--zak
----- Original Message -----
From: "Jean-Arthur Silve" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 2:26 AM
Subject: [PHP] returned eMails
Hi !
We have a site which send mails to customers regulary.
My problem is that when some mails are returned (bacause addresses are not
available or mailboxes are full etc..)
they are returned to the server administrator and not to the sender of the
message.
When I send a mail, I use the PHP mail function .
In the header I put "From: [EMAIL PROTECTED]\n\n"
The "From" is ok because when someone receive the message, it is From the
address I put.
May be is there another field to put in the header for the refused messages
are returned to the sender I want ?
Thank you for your help
jean-arthur
----------------------------------------------------------------
EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr
----------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
You gonna need to add
"Return-Path: <[EMAIL PROTECTED]>\n";
into your message header.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Jean-Arthur Silve [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 5:27 PM
To: [EMAIL PROTECTED]
Subject: [PHP] returned eMails
Hi !
We have a site which send mails to customers regulary.
My problem is that when some mails are returned (bacause addresses are not
available or mailboxes are full etc..)
they are returned to the server administrator and not to the sender of the
message.
When I send a mail, I use the PHP mail function .
In the header I put "From: [EMAIL PROTECTED]\n\n"
The "From" is ok because when someone receive the message, it is From the
address I put.
May be is there another field to put in the header for the refused messages
are returned to the sender I want ?
Thank you for your help
jean-arthur
----------------------------------------------------------------
EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr
----------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi, all.
I try to do a file upload using the ftp_put function, where the source file
is a string from a browse field
When I try to do the upload php says that there is an error opening the
local file.
Does any of you know how to solve this problem?
thanks in advance, Jon A
Ensure that the user that PHP is running as has permissions to read the
file.
--zak
----- Original Message -----
From: "Jon A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 21, 2001 10:36 AM
Subject: [PHP] ftp_put
> Hi, all.
>
> I try to do a file upload using the ftp_put function, where the source
file
> is a string from a browse field
> When I try to do the upload php says that there is an error opening the
> local file.
>
> Does any of you know how to solve this problem?
>
> thanks in advance, Jon A
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Hello Everyone!
This is my code
************************************************
if (count($array_id)==1)
{
$string_id=$array_id;
}
else
{
$string_id= implode(":",$array_id);
}
************************************************
I've been testing it for three days and never had an error, now it comes and
goes. Do you know what could be wrong?
$array_id is an array of integers
Thanks in advance
Sounds like you are trying to implode a non-existant array.
Change your code to handle an empty or missing array.
ie.
----- Original Message -----
From: "Martin Cabrera Diaubalick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 2:41 AM
Subject: [PHP] All of a sudden I get Warning: Bad arguments to implode() in
busca_01.php on line 133
> Hello Everyone!
>
> This is my code
>
> ************************************************
> if (count($array_id)==1)
> {
> $string_id=$array_id;
> }
> else
> {
> $string_id= implode(":",$array_id);
> }
> ************************************************
>
> I've been testing it for three days and never had an error, now it comes
and
> goes. Do you know what could be wrong?
>
> $array_id is an array of integers
>
> Thanks in advance
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ie.
Oops! Hit the right keys at the wrong time! :)
if (! count ($array_id))
{
echo '$array_id is empty or not set.';
}
else if (1 == count($array_id))
{
$string_id=$array_id;
}
else
{
$string_id= implode(":",$array_id);
}
--zak
Try:
************************************************
if (!is_array($array_id))
{
$string_id=$array_id;
}
else
{
$string_id= implode(":",$array_id);
}
************************************************
You have to always make sure, you are passing Array into an implode() or
explode().
BTW: your code would look cooler like this:
$string_id = is_array($array_id) ? implode(":",$array_id) : $array_id;
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Martin Cabrera Diaubalick [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 5:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] All of a sudden I get Warning: Bad arguments to implode()
in busca_01.php on line 133
Hello Everyone!
This is my code
************************************************
if (count($array_id)==1)
{
$string_id=$array_id;
}
else
{
$string_id= implode(":",$array_id);
}
************************************************
I've been testing it for three days and never had an error, now it comes and
goes. Do you know what could be wrong?
$array_id is an array of integers
Thanks in advance
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Jason,
Sorry for newbie question, how I compile MySQL from SRPM?
I know how to compile from source tar bar but not form SRPM.
Simple step to show how would be nice.
Thanks in advance.
Regards,
Chris Lee
On 21 May 2001 16:43:48 -0700, [EMAIL PROTECTED] (Jason
Murray) wrote:
>> All were installed using Red Hat RPMs. (Is this where I
>> screwed up from the start?)
>
>Not neccessarily.
>
>You might be able to find a PHP RPM with MySQL enabled, or download
>the source RPM (SRPM), edit the specfile and turn on the options you
>need (you can then rebuild the RPM so you can reinstall if needed).
>
>That said, I do find it kinda easy to compile PHP from the source
>code these days, and I'm no *nix guru.
>
>Jason
>
>--
>Jason Murray
>[EMAIL PROTECTED]
>Web Developer, Melbourne IT
>"What'll Scorpy use wormhole technology for?"
>'Faster pizza delivery.'
Chris Lee wrote:
>
> Jason,
>
> Sorry for newbie question, how I compile MySQL from SRPM?
> I know how to compile from source tar bar but not form SRPM.
>
> Simple step to show how would be nice.
>
rpm --rebuild <some>.src.rpm
And compiled binaries will be under /usr/src/RPM/RPMS/.
(Talking about Mandrake).
--
Pavel a.k.a. Papi
I use PHP 4.0.4pl1 and I don't understand why this doesn't work.
Does somebody help me ?
class a {
var $foo1 ;
function a($thefoo) {
$this->$foo1 = $thefoo ;
echo "a::foo1=".$this->$foo1."\n" ;
}
}
class b extends a {
var $foo2 ;
function b($thefoo1, $thefoo2) {
$this->a($thefoo1) ;
$this->$foo2 = $thefoo2 ;
echo "b::foo1=".$this->$foo1."\n" ;
echo "b::foo2=".$this->$foo2."\n" ;
}
}
$toto = new b(1,3) ;
echo "FOO1=".$toto->$foo1."\n" ;
echo "FOO2=".$toto->$foo2."\n" ;
The result is:
a::foo1=1
b::foo1=3 <- (and not 1) ???
b::foo2=3
FOO1=3 <- (and not 1) ???
FOO2=3
Many thanks for any information (perhaps I'm very tired and I understand nothing??)
Hugues.
--
Synaptique Europe
www.synaptique.com
use $this->foo1
no double dollar signs. Otherwise PHP thinks you are trying to do variable
variables thing.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Hugues BRUNEL [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 6:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Class and extends pb/bug? with php404pl1
I use PHP 4.0.4pl1 and I don't understand why this doesn't work.
Does somebody help me ?
class a {
var $foo1 ;
function a($thefoo) {
$this->$foo1 = $thefoo ;
echo "a::foo1=".$this->$foo1."\n" ;
}
}
class b extends a {
var $foo2 ;
function b($thefoo1, $thefoo2) {
$this->a($thefoo1) ;
$this->$foo2 = $thefoo2 ;
echo "b::foo1=".$this->$foo1."\n" ;
echo "b::foo2=".$this->$foo2."\n" ;
}
}
$toto = new b(1,3) ;
echo "FOO1=".$toto->$foo1."\n" ;
echo "FOO2=".$toto->$foo2."\n" ;
The result is:
a::foo1=1
b::foo1=3 <- (and not 1) ???
b::foo2=3
FOO1=3 <- (and not 1) ???
FOO2=3
Many thanks for any information (perhaps I'm very tired and I understand
nothing??)
Hugues.
--
Synaptique Europe
www.synaptique.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
On Tuesday 22 May 2001 11:54, Hugues BRUNEL wrote:
> echo "b::foo1=".$this->$foo1."\n" ;
> echo "b::foo2=".$this->$foo2."\n" ;
You're accessing the fields incorrectly. It's $this->foo1 (without the
second '$').
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
CPU not found. retry, abort, ignore?
Microsoft's PWS and PHP executable as CGI. I beleave.
I've had problems with porting php scripts from Linux/Apache/mod_php to
Windows/PWS/php as CGI in the past becourse PWS failed to serve pages with
short URLs like directory/?arg1=x&arg2=y
Tomaz
----- Original Message -----
From: "colin olkowski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 21, 2001 10:01 PM
Subject: [PHP] PHP & URL Question - omitting index.php
> Quick question on passing arguments via URL.
>
> Does anyone know if any browsers have a hard time dealing with something
> like the following?
>
> http://www.blahbalh.com/directory/?arg1=arg1&arg2=arg2
>
> In this case the "directory" would have an index.php file that would react
> based on the query string, but as you can see I'm not including the
> index.php in the link.
>
> Is this o.k. or will some browsers get confused?
>
> thanks in advance
>
> colin olkowski
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
I seem unable to view my localhost by typing "http://localhost" in my opera
client. It comes up with the error message, "The server requested a login
authentication method which is not supported".
Anyone know a way about this?
Thanks in advance!
Tarrant Costelloe
nope, it works for me.
not Opera's fault.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
[EMAIL PROTECTED]
www.phpbeginner.com
-----Original Message-----
From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 6:18 PM
To: Php (E-mail)
Subject: [PHP] Opera > Localhost
I seem unable to view my localhost by typing "http://localhost" in my opera
client. It comes up with the error message, "The server requested a login
authentication method which is not supported".
Anyone know a way about this?
Thanks in advance!
Tarrant Costelloe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Hi,
I'm trying to use some Delphi code with PHP without using COM (objective is
to port it to linux).
The first clue I have is that I have to create a DLL/so with a get_module()
function entry.
Does any documentation exists describing the process of creating your own
dll for use with PHP.
Thank's in advance for any clue
Gilles
See http://zend.com/zend/api.php
Bye john
""Gilles Koffmann"" <[EMAIL PROTECTED]> wrote in message
9edaso$ro7$[EMAIL PROTECTED]">news:9edaso$ro7$[EMAIL PROTECTED]...
> Hi,
>
> I'm trying to use some Delphi code with PHP without using COM (objective
is
> to port it to linux).
> The first clue I have is that I have to create a DLL/so with a
get_module()
> function entry.
>
> Does any documentation exists describing the process of creating your own
> dll for use with PHP.
>
> Thank's in advance for any clue
>
> Gilles
>
>
Hello,
I was able to install php 4.0.2 with Netscape iplanet 4 and it worked.
Now I'm trying to install php 4.0.5 with Netscape iplanet 4 and it
doesn't work.
When I start the netscape server it says:
conf_init: Error running init function load-modules: dlopen of
/opt/netscape/iplanet4/bin/libphp4.so failed (ld.so.1: ns-httpd: fatal:
relocati
on error: file /opt/netscape/iplanet4/bin/libphp4.so: symbol elf_version:
referenced symbol not found)
What's the problem?
Thanks
Félix García Renedo
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
Tfn: 983-423000 Ext. 26520
Fax: 983-423271
Centro de Telecomunicaciones e Informatica
Universidad de Valladolid
España
Hi there,
I am trying to upload a picture via ftp_put, but I keep getting the error
message:
Warning: ftp_put: url/image.jpg: No such file or directory. in
/web/www/www.domain.com/upload.php on line xxx
Does that mean I can only use the php locally where the file is?
The php file is on one server and I am trying to upload a local file to
another server.
The normal copy function caused problems since it saves the files as
user=nobody and i had problems with the
directory modes. I thought the ftp functions were a good alternative. Am I
wrong?
I am not sure as what exactly has to be inserted into "localfile" and
"remotefile" in the ftp_put function either.
Any suggestions are welcome!!!
Thx, Nessi *confused*
Haven't seen anything to support this but it seems to me that exec() and
such has maximum execution times. Can anyone verify this?
chuck
Php has max exec time limit. If you increase that limit you wont face any
problems with the functions/calls made by php including exec or system.
:: set_time_limit (secs)
> Haven't seen anything to support this but it seems to me that exec() and
> such has maximum execution times. Can anyone verify this?
>
> chuck
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
For almost every browser there is, no data inside a <table> will be
displayed until the browser get's the matching </table>, so that's one thing
to remember.
flush() "requests" that any buffered data be sent to the client, but most
browsers have their own internal buffer.
So in other words, you can't. ;)
Plutarck
"Phil Glatz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a page that displays a few lines, then runs a database query that
> takes five or six seconds. I'd like to flush stdout and display the first
> text while the query is running, so the user doesn't think the site is
> down. What's the best way to accomplish this? thanks
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
hi,
I have pbs with sessions. I would like to know first how to do , (enable
or
disable) about sessions in the php.ini file while I don't want to use
cookies
on the client at all.
I suppose I must put the id myself in each page. About this pint, I'd
like
to check something : if in my application I don't use the trans_id and
put
id in url's manually then if i publish my application on a server where
trans_id is enabled. What would happen ? He would put it anyway ?
Thanks
Dalyyla
Ok, I saw two of your emails. Your problem is that you
are not enough patiently to look into and to well
understand the docs.
1. if you wanna change password:
if you don't have already one:
mysqladmin -u root password new_password
if you already have one:
mysqladmin -u root -p password new_password
2. the problem with 'mysql.sock' is because
you need to chown or chgrp the mysql data
directory to the user of the mysqld server
( = mysql , if you compiled it with the option
--with-mysqld-user=mysql). You need to do
something like this:
chgrp -R mysql your_mysql_data_dir
hope it helps :)
Daniel BI
On an HTML page, I need to be able to do call two scripts from a submit link
or button.
So, I have a link like this:
<a href="http://www.mysite.com/script1.php?data=1">Click here</a>
Simultaneously at the click of the link I need to run a second script.
What's the best approach?
ok sorry let me include the code(which I should have done the first time), I
have so far and then it should become clear what I am trying to do and the
difficults I am having:
the function is in a separate file:
function findEntryId($tableName,$keyName){
connects to DB
$db ="SELECT * FROM '$tableName' WHERE '$keyName' = $selectOption";
$mysql_result = mysql_query($db);
$temp = mysql_fetch_array($mysql_result);
return $temp;
}
in another file the call:
$row = findEntryId("vendor","vendor_num");
the problem is I want $row to equal $temp after the call but it is not
allowing me to return $temp, any ideas?
> ----------
> From: Alexander Wagner[SMTP:[EMAIL PROTECTED]]
> Sent: Monday, May 21, 2001 4:19 PM
> To: Lybarger, Denver J (LYBARDJ8); '[EMAIL PROTECTED]'
> Subject: Re: [PHP] mysql and user-defined functions
>
> Lybarger, Denver J (LYBARDJ8) wrote:
> > Is there a way to return the results of a mysql_query or the
> > array that is generated after mysql_fetch_array, via a function?
> > Note I have tried to do a straight return.
>
> What was the problem? This should work. Maybe you just got the
> mysql_fetch_array() wrong, or the database-connect.
>
> > Another issue is that all
> > of the tables are a different size, therefore a static array size
> > would be a big waste of memory.
>
> PHP doesn't have static array sizes, only associative arrays.
>
> > Thanks for any help you could lend.
>
> Sorry, but what you wrote is insufficent to find out where your problem
> lies. For me, anyway.
>
> regards
> Wagner
>
> --
> "Some guy hit my fender, and I told him, 'Be fruitful and multiply,'
> but not in those words."
> - Woody Allen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
Lybarger, Denver J (LYBARDJ8) wrote:
> function findEntryId($tableName,$keyName){
> connects to DB
> $db ="SELECT * FROM '$tableName' WHERE '$keyName' = $selectOption";
Where does $selectOption come from?
Looks like you simply produced a MySQL-parse-error.
Try var_dump()-ing $db and $temp, this will help you debug your scripts.
> $mysql_result = mysql_query($db);
> $temp = mysql_fetch_array($mysql_result);
> return $temp;
> }
regards
Wagner
--
"Some guy hit my fender, and I told him, 'Be fruitful and multiply,'
but not in those words."
- Woody Allen
Is the class variable declared as an array?
class test{
var $reasons = array();
function addReason( $score, $reason, $id ) {
$reasons[ $index ] = "$score|$reason|$id";
}
}
Hope this helps,
-C
""Bob"" <[EMAIL PROTECTED]> wrote in message
9ec2rm$etg$[EMAIL PROTECTED]">news:9ec2rm$etg$[EMAIL PROTECTED]...
> I have a class defined with a var $reasons that I will use as an array.
The
> code to add to it is:
>
> function AddReason($score, $reason, $id)
> {
> static $index = 0;
> $this->reasons[$index] = "$score|$reason|$id";
> for ($i = 0; $i < $index; $i++)
> {
> $out = $this->reasons[$i];
> echo "$out...";
> }
> $index++;
> return $score;
> }
>
> However, every time I call it, the value stored in the reasons array seems
> to disappear, and the array holds no data. It seems to be behaving like a
> local variable, even though it is in a class. Any suggestions would be
> greatly appreciated.
>
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
What is the best way to delete an element from an array?
I tried using unset(), and it didn't work.
Thanks in advance.
Tom Malone
Web Designer
HurstLinks Web Development http://www.hurstlinks.com/
Norfolk, VA 23510 (757)623-9688 FAX 623-0433
PHP/MySQL - Ruby/Perl - HTML/Javascript
<?
$array[ 'test' ] = "chris";
echo "before " . $array[ 'test' ] . "<br>";
unset( $array[ 'test' ] );
echo "after " . $array[ 'test' ];
?>
returns:
before chris
after
hence, the unset function works fine for me. what version of php are you
running?
""Tom"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I can't seem to get unset() to work when I'm strying to delete an
> element from an array.
>
> I have a select list that is populated by an array, and i need to
> be able to delete items from the list by deleting them from the
> array, but I don't know how.
>
> I tried using unset($array['element']); but it doesn't work.
> Does anyone know why?
> Does anyone know of a way to use array_diff() to delete elements
> from an array?
>
> Thanks,
> Tom
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>