Jump to content

[SOLVED] php and tags - how is it done?


silas101

Recommended Posts

Hi there all. i am not sure if this is possible and my php is pretty limited..(9 days old)

 

I have a function that receives  a few values from the page that calls it and then uses the values to build and send an email.

 

is it possible to say call the function directly? like www.test.com/[email protected]:amount=$50

can this be done so that if i hard code that link in my other non web apps and they can send the paramentres along?

 

the function is as below

 

<?php

include("common.php");

include("db.php");

 

function sms($amount,$policy,$mobile,$company,$co_cell) {

    ?>

    <html>

    <head>

    <script language="JavaScript">

    <!-- Email the new password to the person.

$message = " user_id:100\\n user:test\\n password:testpasswd\\n text:Your Policy Payment was received today.\\n \\n text:Payment of R<?=$amount?>\\n text:Mem No: <?=$policy?>\\n text:From ABC <?=$company?>\\n text:Info on <?=$co_cell?>\\n from:CORESYSTEM \\n to:<?=$mobile?>";

mail('[email protected]',"",

$message, "From:CORE IT<[email protected]>");

        history.back();

    //-->

    </script>

    </head>

    <body>

    </body>

    </html>

    <?

    exit;

}

?>

Link to comment
https://forums.phpfreaks.com/topic/102521-solved-php-and-tags-how-is-it-done/
Share on other sites

Hi there all. i am not sure if this is possible and my php is pretty limited..(9 days old)

 

I have a function that receives  a few values from the page that calls it and then uses the values to build and send an email.

 

is it possible to say call the function directly? like www.test.com/[email protected]:amount=$50

can this be done so that if i hard code that link in my other non web apps and they can send the paramentres along?

 

the function is as below

 

<?php

include("common.php");

include("db.php");

 

function sms($amount,$policy,$mobile,$company,$co_cell) {

    ?>

    <html>

    <head>

    <script language="JavaScript">

    <!-- Email the new password to the person.

$message = " user_id:100\\n user:test\\n password:testpasswd\\n text:Your Policy Payment was received today.\\n \\n text:Payment of R<?=$amount?>\\n text:Mem No: <?=$policy?>\\n text:From ABC <?=$company?>\\n text:Info on <?=$co_cell?>\\n from:CORESYSTEM \\n to:<?=$mobile?>";

mail('[email protected]',"",

$message, "From:CORE IT<[email protected]>");

        history.back();

    //-->

    </script>

    </head>

    <body>

    </body>

    </html>

    <?

    exit;

}

?>

 

echo "www.test.com/sms.php?email=" . urlencode("[email protected]") . "&amount=" . urlencode("$50");

 

That's what you'd pass on the other pages, and the new pages would get the values.

If you want, you could assign a $email and $amount variable that dynamically changes based on something they do, and have this:

 

echo "www.test.com/sms.php?email=" . urlencode($email) . "&amount=" . urlencode($amt);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.