This topic is locked

Action Button

2/6/2009 9:27:55 AM
PHPRunner General questions
N
netmedia59 author

Hello,
Is there a way to add an action button on a View page
Example :

On a view page with some infos of a company (IDNum, Name, Address, City, Zip, Email, Web, ...)

Is it possible for the logged User to push a SEND EMAIL Button wich will send a mail from him to the viewed company

Sender : the logged user

Reciever : the company on the View Page (Email),

Subject : variable or imposed

Message : variable or imposed
Is it possible to add more than one button to give other actions
Thanks
netmedia59

J
Jane 2/9/2009

Hi,
you can add this button manually on the Visual Editor tab in HTML mode.

Here is a sample:

<input type=button class=button value="send email" onclick="window.location.href='tablename_view.php?editid1={$show_key1}?mail=yes';">


Then check $_REQUEST["mail"] in the View page: Before display event and send email if needed:

if ($_REQUEST["mail"]=="yes")

{

$email="...";

$message = "...";

$subject = "...";

mail($email, $subject, $message);
header("Location: tablename_view.php?editid1=".$_REQUEST["editid1"]."");

exit();

}

N
netmedia59 author 2/10/2009

Hello Jane,
Thanks for your good advices.

Unfortunately, it works partialy because it doesn't wait the click of the button and sends directly the mail

Is there a way to do it after the click of the button ?
Thanks
netmedia59

J
Jane 2/13/2009

Hi,
sorry for my fault.

Here is the correct code:

<input type=button class=button value="send email" onclick="window.location.href='tablename_view.php?editid1={$show_key1}&mail=yes';">


If it doesn't help publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

N
netmedia59 author 2/16/2009

Hi Jane,
Thanks it's OK <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=37817&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

Great
netmedia59