Re: [PHP] SQL sums

2004-12-04 Thread Marek Kilimajer
Raditha Dissanayake wrote:
Marek Kilimajer wrote:
Jason Wong wrote:
On Saturday 04 December 2004 00:40, Marek Kilimajer wrote:
Raditha Dissanayake wrote:
Marek Kilimajer wrote:
This is an SQL question.

Marek, don't you know that this the mysql list? you are supposed to
answer questions like these. If you don't there will be self appointed
list moderators who will jump on you like what happened to me last 
week.
I was accused of being not helpfull.

Ok, I appologize :)))


I think Raditha had his tongue firmly in his cheek when he wrote that.
Does anyone know of a good remedy for cheek pain? (or is that an off 
topic question?)
I did not find any cheek-pain-remedy list, so I think it's fine to ask 
here. I'll ask the moderators to add it to the subjects as number ... 
integer overflow.

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


Re: [PHP] Getting latest Session name

2004-12-04 Thread Marek Kilimajer
Sagar C Nannapaneni wrote:
Hello friends,
I just wanna know is there any way out to know the name of the latest
created session. The issue i'm fixed up with is
I'm storing some variables in the session and the session expire is set
to some 24hrs. Now when i close the browser and when i again open the
same page after some time i need to get the same variables that i stored 
in my previous login. Is that possible???
The session cookie is set to expire when the browser is closed by 
default. So you need to use session_set_cookie_params() function to set 
the cookie to expire after 24 hours.

But be aware of the security implications this have. If a user does not 
log out and just closes the browser, anyone coming to the computer after 
him might get into his account.

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


[PHP] Re: Please wait page while processing - SOLVED

2004-12-04 Thread Geoff Caplan
Hi

For anyone interested, it was a combination of issues.

First, I had to use flush() and ob_end_flush() combined to
get the page to display in IE. end_flush didn't work on its
own.

Second, I was being dim in redirecting away from the message
page - because of course it won't display after a redirect.
So you have to do the processing in the message script,
saving the result to the session. Then keep polling the
message page with a client-side refresh till the gateway
processing completes and you can re-direct to the result
page.

GC I'm writing a checkout.

GC When user submits their card details, I want to redirect
GC them to page with a please wait message. Then redirect to
GC the script that does the payment processing. Then when I
GC have the response from the gateway, redirect again to the
GC result page.

form - message - processor - result_page

GC I've seen this done but I can't figure out how.

-- 
Geoff Caplan
Vario Software Ltd
(+44) 121-515 1154 

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



[PHP] Fwd: variable not being rendered

2004-12-04 Thread Dustin Krysak
Answering within the email below
d
On 4-Dec-04, at 3:16 AM, [EMAIL PROTECTED] wrote:
From: Jason Wong [EMAIL PROTECTED]
Date: December 4, 2004 12:04:18 AM PST
To: [EMAIL PROTECTED]
Subject: Re: [PHP] variable not being rendered
On Saturday 04 December 2004 15:36, Dustin Krysak wrote:
Hi there, I have some code where I am using the $_SERVER['PHP_SELF']
array to reference my script for a form action... now for some reason
the file name is not being rendered out. I am including only small
snippets of my code to see where my error is...
I know this is not your actual code, but did you actually run this? I 
can't
see any errors in it and it should work fine if you're using a recent 
version
of PHP.
I did run it... that is the reason I posted. As I stated, When I view 
source, the result is blank.


?php
$editFormAction = $_SERVER['PHP_SELF'];
What does print_r($_SERVER) show?
What does print $editFormAction show?
echo $_SERVER['PHP_SELF']; shows the proper result.
print_r($_SERVER['PHP_SELF']); shows the proper result
print $editFormAction ; shows the proper result


print form action=\.$editFormAction.\ method=\post\
name=\ml_form\ id=\ml_form\\n;
As you're not placing variables inside your print statement you might 
as well
use single-quotes:

print 'form action='.$editFormAction.' method=post
name=ml_form id=ml_form'.\n;
This does away with all the backslashes (which gives me a headache).
Well I changed it to:
print 'form action='.$editFormAction.' method=post name=ml_form 
id=ml_form'.\n;

and I still had the same result. the source of the page when viewed in 
the browser was:

form action= method=post name=ml_form id=ml_form
So as you can see the $editFormAction is still not being rendered. So 
I am going to add the following info, I have a page that is required 
once that contains my functions. and I defined a function to print out 
this form. My code for that is:

?php
// create subscribe form
function sub_form() {
print 'form action='.$editFormAction.' method=post name=ml_form 
id=ml_form'.\n;
print 'pinput name=email type=text id=email 
size=25/p'.\n;
print 'pinput type=submit name=Submit 
value=Subscribe/p'.\n;
print '/form';
}
?

So would my issue be that I formatted my function wrong? Or that the 
page is included?

Dustin

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


[PHP] Re: variable not being rendered

2004-12-04 Thread Dustin Krysak
Ok - I have been investigating a little more. I now realized it is a 
question of making my variables available outside of the function. So 
one thing I want to point out is that:

$editFormAction = $_SERVER['PHP_SELF']; is contained in one function.
And that:
print 'form action='.$editFormAction.' method=post name=ml_form 
id=ml_form'.\n; is contained in another function.

The first function contains all my code for a SQL query to insert a 
record. And the second function is just to create the form itself.

Now i know i also need to use the result function. But I am sure that 
since I am using a few functions here - there might be more hitches 
than I realize. So I am just asking for some pointers for dealing with 
this.

thanks!
d

From: Dustin Krysak [EMAIL PROTECTED]
Date: December 3, 2004 11:36:56 PM PST
To: PHP [EMAIL PROTECTED]
Subject: variable not being rendered
Hi there, I have some code where I am using the $_SERVER['PHP_SELF'] 
array to reference my script for a form action... now for some reason 
the file name is not being rendered out. I am including only small 
snippets of my code to see where my error is...

?php
$editFormAction = $_SERVER['PHP_SELF'];
print form action=\.$editFormAction.\ method=\post\ 
name=\ml_form\ id=\ml_form\\n;

?
Now there is much more code, but these are the important points. All I 
am doing is assigning a variable a value from the $_SERVER array. Then 
print out a form with PHP, and reference that variable for my form 
action the HTML is rendered as normal. But the form action page is 
not there when I view my source. I am sure it is a SIMPLE error... But 
my brain block is getting larger the more i look at this.

help cries the newbie!
d
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] executeing another files code

2004-12-04 Thread Ryan A
Hey all,
Heres my problem, I have this written in email.fff
# Start file ##
Hi $firstname $lastname,
We have recieved your request for support.

We will get back to you shortly.
Regards,
$sitename

P.S below is the message you submitted:
$message
# End file ##

Question is:
How can I get the file in my php script and fill in those variables then
send the above email message.
I know how to open a file via fread/file I now how to do the mail() etc...
Just a little confused

Thanks,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.5 - Release Date: 12/3/2004

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



Re: [PHP] Re: intalling pear:db

2004-12-04 Thread [EMAIL PROTECTED]
Ryan, 

Your suggestion led me to the solution.  I was having the same problem with
php returning a fatal error made me think DB.php was to blame.  But it ended
up being an include problem after all...

I use php 4.3.8 and my include path to the PEAR libraries was already set.
The actual problem was including my config file which defined my DSN driver.
Once I was able to successfully include the config file and actually define
the DSN info, everything was fine.

Thanks!
Tim


on 11/26/04 1:18, Ryan King at [EMAIL PROTECTED] wrote:

 
 On Nov 25, 2004, at 1:56 AM, Merlin wrote:
 
 Hi,
 
 that did not help. The pear manual says that this can be installed via
 command line, plus pear list tells me that the package is installed.
 However if I call phpinfo() there is no mentioning about pear in any
 way?! Do I have to enable it first anyhow?`
 
 
 How about trying a var_dump() on your DB object? For me, this is always
 the first step in trying to solve a mystery like this. Chances are,
 your DB object is really a PEAR_Error object because your failed to
 connect to your database.
 
 -ryan

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



[PHP] Re: executeing another files code

2004-12-04 Thread M. Sokolewicz
Ryan A wrote:
Hey all,
Heres my problem, I have this written in email.fff
# Start file ##
Hi $firstname $lastname,
We have recieved your request for support.
We will get back to you shortly.
Regards,
$sitename
P.S below is the message you submitted:
$message
# End file ##
Question is:
How can I get the file in my php script and fill in those variables then
send the above email message.
I know how to open a file via fread/file I now how to do the mail() etc...
Just a little confused
Thanks,
Ryan
well, seen as you've put it in a separate file, we'll need to eval it.
So, let's go.
I'm assuming $sitename and $message are already set with the correct 
values before the script I'm going to show you starts:
?php
// assume PHP 4.3.0+, otherwise use eg. $c = implode(\n, 
file('email.fff'));
$c = file_get_contents('email.fff');
eval('$emailMsg = '.$c.';');
// [EMAIL PROTECTED] can be replaced with eg $emailAddress if you've 
defined it earlier on.
mail('[EMAIL PROTECTED]', 'Re: support request', $emailMsg);
?

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


Re: [PHP] executeing another files code

2004-12-04 Thread Marek Kilimajer
Ryan A wrote:
Hey all,
Heres my problem, I have this written in email.fff
# Start file ##
Hi $firstname $lastname,
We have recieved your request for support.
We will get back to you shortly.
Regards,
$sitename
P.S below is the message you submitted:
$message
# End file ##
Question is:
How can I get the file in my php script and fill in those variables then
send the above email message.
I know how to open a file via fread/file I now how to do the mail() etc...
Just a little confused
Don't execute it, it's expensive. Simply read the file in a string and 
replace all occurences that you need:

$s = str_replace(
array('$firstname', '$lastname', '$sitename', '$message'),
array($firstname, $lastname, $sitename, $message),
$s);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] executeing another files code

2004-12-04 Thread M. Sokolewicz
Marek Kilimajer wrote:
Ryan A wrote:
Hey all,
Heres my problem, I have this written in email.fff
# Start file ##
Hi $firstname $lastname,
We have recieved your request for support.
We will get back to you shortly.
Regards,
$sitename
P.S below is the message you submitted:
$message
# End file ##
Question is:
How can I get the file in my php script and fill in those variables then
send the above email message.
I know how to open a file via fread/file I now how to do the mail() 
etc...
Just a little confused

Don't execute it, it's expensive. Simply read the file in a string and 
replace all occurences that you need:

$s = str_replace(
array('$firstname', '$lastname', '$sitename', '$message'),
array($firstname, $lastname, $sitename, $message),
$s);
actually, as far as I see, that should be equally expensive as 
eval()'ing it :)

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


Re: [PHP] executeing another files code

2004-12-04 Thread Marek Kilimajer
M. Sokolewicz wrote:
Marek Kilimajer wrote:
Ryan A wrote:
Hey all,
Heres my problem, I have this written in email.fff
# Start file ##
Hi $firstname $lastname,
We have recieved your request for support.
We will get back to you shortly.
Regards,
$sitename
P.S below is the message you submitted:
$message
# End file ##
Question is:
How can I get the file in my php script and fill in those variables then
send the above email message.
I know how to open a file via fread/file I now how to do the mail() 
etc...
Just a little confused

Don't execute it, it's expensive. Simply read the file in a string and 
replace all occurences that you need:

$s = str_replace(
array('$firstname', '$lastname', '$sitename', '$message'),
array($firstname, $lastname, $sitename, $message),
$s);
actually, as far as I see, that should be equally expensive as 
eval()'ing it :)
eval has to look for more tokens and is less secure.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: executeing another files code

2004-12-04 Thread Ryan A
Thanks guys,
will report back if I run into any problems.

Cheers,
Ryan


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.5 - Release Date: 12/3/2004

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



Re: [PHP] executeing another files code

2004-12-04 Thread M. Sokolewicz
Marek Kilimajer wrote:
M. Sokolewicz wrote:
Marek Kilimajer wrote:
Ryan A wrote:
Hey all,
Heres my problem, I have this written in email.fff
# Start file ##
Hi $firstname $lastname,
We have recieved your request for support.
We will get back to you shortly.
Regards,
$sitename
P.S below is the message you submitted:
$message
# End file ##
Question is:
How can I get the file in my php script and fill in those variables 
then
send the above email message.
I know how to open a file via fread/file I now how to do the mail() 
etc...
Just a little confused


Don't execute it, it's expensive. Simply read the file in a string 
and replace all occurences that you need:

$s = str_replace(
array('$firstname', '$lastname', '$sitename', '$message'),
array($firstname, $lastname, $sitename, $message),
$s);

actually, as far as I see, that should be equally expensive as 
eval()'ing it :)

eval has to look for more tokens and is less secure.
hmm... true... forgot about the tokens ;)
as for the security. As long as its local and your in control of the 
message, it'll be safe enough.

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


Re: [PHP] executeing another files code

2004-12-04 Thread Ryan A
Hi again,
One last question as am a bit confused, using this method:

$s = str_replace(
array('$firstname', '$lastname', '$sitename', '$message'),
array($firstname, $lastname, $sitename, $message),$s);

do I *have to* pass 4 arguements?

Because I dont really know how many will be passed...the site owner may
decide he wants to use just 3 out of 4...

eg:
he may want to use just $name, $lastname and $submit_date
instead of $name, $lastname, $submit_date and message

Thanks,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.5 - Release Date: 12/3/2004

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



[PHP] Stupid question

2004-12-04 Thread Phpu
Hi,

If i have a php and mysql website...how many connections support mysql at one 
time ?

Thanks

[PHP] Re: Stupid question

2004-12-04 Thread Peter Lauri
Do phpinfo() for that, you will find that information there.

/Peter


Phpu [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
Hi,

If i have a php and mysql website...how many connections support mysql at
one time ?

Thanks

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



Re: [PHP] executeing another files code

2004-12-04 Thread Raditha Dissanayake
Ryan A wrote:
Hi again,
One last question as am a bit confused, using this method:
$s = str_replace(
array('$firstname', '$lastname', '$sitename', '$message'),
array($firstname, $lastname, $sitename, $message),$s);
do I *have to* pass 4 arguements?
 

you can set default values (eg an empty string) to cover that scenario. 
I can aslo offer you a third alternative to the very good suggestions 
already offereed by Marek and Sokolewicz; printf();

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


[PHP] Re: Stupid question

2004-12-04 Thread Matthew Weier O'Phinney
* Phpu [EMAIL PROTECTED]:
 If i have a php and mysql website...how many connections support mysql =
 at one time ?

Depends on your mysql setup; you'll have to look at the mysql
configuration file (/etc/my.cnf on most *nices).

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] Stupid question

2004-12-04 Thread Raditha Dissanayake
Phpu wrote:
Hi,
If i have a php and mysql website...how many connections support mysql at one time ?
 

Sorry people in this list do not know how to configure mysql
Thanks
 


--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


Re: [PHP] Stupid question

2004-12-04 Thread Greg Donald
On Sun, 5 Dec 2004 02:48:09 +0200, Phpu [EMAIL PROTECTED] wrote:
 If i have a php and mysql website...how many connections support mysql at one 
 time ?

The number of connections allowed is controlled by the max_connections
system variable. Its default value is 100. If you need to support more
connections, you should restart mysqld with a larger value for this
variable.

You can increase this value in the MySQL server config file (mine is
in /etc/mysql/my.cnf) using this syntax:

[mysqld]
set-variable = max_connections=200


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Fwd: variable not being rendered

2004-12-04 Thread Jason Wong
On Sunday 05 December 2004 04:57, Dustin Krysak wrote:

 I did run it... that is the reason I posted. As I stated, When I view
 source, the result is blank.

What *exactly* did you run?

Did you run the code as presented in your previous post? 

 OR

did you run it as you state further down in this post where the print form 
part is in a function?

I suspect you're doing the latter (the former should work and if it REALLY 
doesn't you should report it as a major bug), in which case you should be 
ashamed for giving misleading information - stating something doesn't work 
when you're acutally doing something else.

[snip]

 So as you can see the $editFormAction is still not being rendered. So
 I am going to add the following info, I have a page that is required
 once that contains my functions. and I defined a function to print out
 this form. My code for that is:

 ?php
 // create subscribe form
 function sub_form() {
 print 'form action='.$editFormAction.' method=post name=ml_form
 id=ml_form'.\n;
 print 'pinput name=email type=text id=email
 size=25/p'.\n;
 print 'pinput type=submit name=Submit
 value=Subscribe/p'.\n;
 print '/form';
 }
 ?

 So would my issue be that I formatted my function wrong? Or that the
 page is included?

manual  Variables  Variable scope

-- 
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
--
/*
Many are called, few volunteer.
*/

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