| | |
PHP and HTML inside ASP.NET
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 42
Reputation:
Solved Threads: 0
I have a template for web pages which is asp.net
Inside the content object or whatever it's called, it wish to place a simpe PHP form. I tried it and the PHP code doesn't seem to be recognized as PHP but as text.
Can this NOT be done?
Inside the content object or whatever it's called, it wish to place a simpe PHP form. I tried it and the PHP code doesn't seem to be recognized as PHP but as text.
Can this NOT be done?
ASP.NET Syntax (Toggle Plain Text)
<%@ page language="VB" masterpagefile="~/pages/airedale911.master" autoeventwireup="false" inherits="feedback, App_Web_i5ksdbwd" title="airedale911.org: Feedback" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder" runat="Server"> <?php if(isset($_POST["Submit"])) { require("c:\php\includes\class.phpmailer.php"); $mail = new PHPMailer(); //////////////////////////////////////////////////////////////// // Customize the following 5 lines with your own information. // //////////////////////////////////////////////////////////////// $toaddress = "rocky@airedale911.org"; //Change this to the email address you will be receiving your notices. $mailhost = "mail.airedale911.org"; //Change this to your actual Domain name. $fromaddress = "rocky@airedale911.org"; //Change this to the email address you will use to send and authenticate with. $frompwd = "password"; //Change this to the above email addresses password. $subject = "Airedale 911 Application Form"; //Change this to your own email message subject. ////////////////////////////////////////// // DO NOT CHANGE ANYTHING PAST THIS LINE// ////////////////////////////////////////// $fromname = $_POST["TName"]; $body = $_POST["TBody"] ; $rplyto = $_POST["TEmail"]; $msgbody = $fromname . "<br>" . $rplyto . "<br>" . $body; $mail->IsSMTP(); $mail->Host = $mailhost; $mail->SMTPAuth = true; $mail->Username = $fromaddress; $mail->Password = $frompwd; $mail->From = $fromaddress; $mail->FromName = $fromname; $mail->AddReplyTo($rplyto); $mail->AddAddress($toaddress); $mail->IsHTML(true); $mail->Subject = $subject; $mail->Body = $msgbody; if(!$mail->Send()) { echo "Message could not be sent. <p>"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } echo "Thank you, your message has been sent!"; } ?> <html><body> <form name="SendEmail01" method="post"> <table border=0> <tr> <td>Name:</td> <td><input type="text" name="TName" size="30"></td> </tr> <tr> <td>Email:</td> <td><input type="text" name="TEmail" size="30"></td> </tr> <tr> <td>Body:</td> <td><textarea rows="4" name="TBody" cols="30"></textarea></td> </tr> <tr> <td><input type="submit" name="Submit" value="Submit"></td> </tr> </form> </body></html> </asp:Content>
•
•
Join Date: Nov 2008
Posts: 42
Reputation:
Solved Threads: 0
One last question since I added to your reputation, please.
You know how I added the Iframe to point to the php like you suggested. The php is a simple php form.
There is a SQL database also. It it technically possible to add lines to code beneath each form field stating that upon successful submission, add these variable values to the database?
We have a tracker that tracks submissions. Since I'm doing this differently from aspx I will have to find a way to get the NAME towhomemailed DATE etc into the tracker so there is a database listing of each submission.
Can this be done sort of after the fact in my php script?
Thx
You know how I added the Iframe to point to the php like you suggested. The php is a simple php form.
There is a SQL database also. It it technically possible to add lines to code beneath each form field stating that upon successful submission, add these variable values to the database?
We have a tracker that tracks submissions. Since I'm doing this differently from aspx I will have to find a way to get the NAME towhomemailed DATE etc into the tracker so there is a database listing of each submission.
Can this be done sort of after the fact in my php script?
Thx
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 123
yes you can do that, you are going to use ajax in this case. when you click submit button, it will call javascript function to post aspx page. this is not an intriguing issue but you have to have a solid understanding of ajax. But i think the better thing to do is to synronize your sql server with mysql regarding that tracking tables. that way your application will be secure and more robust.
Due to lack of freedom of speech, i no longer post on this website.
![]() |
Similar Threads
- help!! (Viruses, Spyware and other Nasties)
- To Those Who Robbed My Life (Geeks' Lounge)
Other Threads in the ASP.NET Forum
- Previous Thread: How to read text file and display it in a messagebox
- Next Thread: Hi, a super website
Views: 832 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class complex contenttype control countryselector database datagrid datagridview datalist deployment development dgv dialog dropdownmenu dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi iis image javascript languages list listbox maps menu mobile mssql nameisnotdeclared news novell opera order parent problem profile radio redirect refer registration relationaldatabases reportemail response.redirect richtextbox rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql sql-server ssl tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl






