php-general Digest 5 Dec 2004 13:17:28 -0000 Issue 3152

Topics (messages 203502 through 203515):

Re: executeing another files code
        203502 by: Ryan A
        203503 by: M. Sokolewicz
        203504 by: Ryan A
        203506 by: Raditha Dissanayake

Stupid question
        203505 by: Phpu
        203507 by: Peter Lauri
        203508 by: Matthew Weier O'Phinney
        203509 by: Raditha Dissanayake
        203510 by: Greg Donald

Re: variable not being rendered
        203511 by: Jason Wong

GD lib not working
        203512 by: Dade Register
        203513 by: Jason Wong

Session variables not unsetting
        203514 by: steve

Re: PEAR::SOAP <return> tag trouble in migration to PEAR::SOAP from NuSOAP
        203515 by: Roland Schorr

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

--- End Message ---
--- Begin Message ---
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.

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

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

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

Thanks

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
* 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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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/

--- End Message ---
--- Begin Message ---
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 '<p><input name="email" type="text" id="email"
> size="25"></p>'."\n";
> print '<p><input 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.
*/

--- End Message ---
--- Begin Message ---
It seems that my install of php does not like the GD library. I've tried 
everything, and read past forum messages. Here's what I'm running:
FreeBSD 5.2.1
Apache 2.0.52
Php 5.0.2
GD 2.0.32
 
Php compiles fine, and even the tests pass for the GD lib, but any GD function 
fails including gdinfo() and imagecreate. Fatal error: Call to undefined 
function imagecreate().
 
I need some help. Anyone have any ideas? Thanx.
-Dade

                
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - You care about security. So do we.

--- End Message ---
--- Begin Message ---
On Sunday 05 December 2004 17:37, Dade Register wrote:
> It seems that my install of php does not like the GD library. I've tried
> everything, and read past forum messages. Here's what I'm running: FreeBSD
> 5.2.1
> Apache 2.0.52
> Php 5.0.2
> GD 2.0.32
>
> Php compiles fine, and even the tests pass for the GD lib, but any GD
> function fails including gdinfo() and imagecreate. Fatal error: Call to
> undefined function imagecreate().
>
> I need some help. Anyone have any ideas? Thanx.

Is this a new installation? A re-installation? An upgrade?
Did you restart apache?
Does phpinfo() show:

 (i) that the ./configure command was indeed that one that you used?
(ii) that you have a GD section showing GD info?

-- 
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
------------------------------------------
/*
People don't usually make the same mistake twice -- they make it three
times, four time, five times...
*/

--- End Message ---
--- Begin Message ---
I'm having a problem with session variables. A site that works fine on my
local system (PHP 4.3.4) is not working on the live server (4.1.2). In both
cases, register_globals is OFF. Every page starts with session_start() and
I'm setting session vars by simply assigning them to $_SESSION, eg:

   $_SESSION['message'] = "Some message for the next page";

I have a function that is included into every page that goes like this:

   function show_message() {
      if(isset($_SESSION['message'])) {
         echo $_SESSION['message'];
         unset($_SESSION['message']);
      }
   }

Calling tha function prints the message okay, but doesn't unset the session
var, so once the message is set, it shows on every subsequent page until
set to a different message. I even tried using
session_unregister($_SESSION['message']) even though the manual says not
to. What am I missing here?

-- 
@+
Steve

--- End Message ---
--- Begin Message --- I had the same trouble, this is another bug which causes big trouble with many SOAP-Clients. My bugfix now works well with all the clients I use, so maybe this helps you as well:
See http://pear.php.net/bugs/bug.php?id=2877


Rgs - Ro!and.

Jeff Rodriguez schrieb:
I'm trying to migrate to PEAR::SOAP from NuSOAP, but I'm confused as to
why the result sent back from a function is wrapped in a <return> tag.
The return part of my code is simple enough:

return array('lastStatus' => 'ok');

But this gets wrapped in a <return> tag:
<return xsi:type="xsd:string">
<lastStatus
xsi:type="xsd:string">ok</lastStatus></return></ns4:reportInResponse>



Here is the SOAP response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:ns4="urn:mwsWSDL"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
<SOAP-ENV:Body>


<ns4:reportInResponse>
<return xsi:type="xsd:string">
<lastStatus
xsi:type="xsd:string">ok</lastStatus></return></ns4:reportInResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--- End Message ---

Reply via email to