|
Hello Everyone
I need help with html form using php. I have created a form on my web page where customer can fill up the form and with submit button to send to my email the entire data content filled in and to be displayed to my email. When i press the submit button no email is coming, Could someone please help me solve this problem and just for reference i'm new to php technology. I have the php code which i will provide.
<?php
if(isset($_POST['submit'])) {
$full_name=$_POST['full_name'];
$email=$_POST['email'];
$telephone=$_POST['telephone'];
$purposeJourney=$_POST['purposeJourney'];
$Vehicle-Type=$_POST['Vehicle-Type'];
$journeyFrom=$_POST['journeyFrom'];
$startDestinationPostcode=$_POST['startDestinationPostcode'];
$date=$_POST['date'];
$Hour-Field[h]=$_POST['Hour-Field[h]'];
$Minute-Field[m]=$_POST['Minute-Field[m]'];
$AM_PM-Field[ap]=$_POST['AM_PM-Field[ap]'];
$journeyTo=$_POST['journeyTo'];
$endDestinationPostcode=$_POST['endDestinationPostcode'];
$return=$_POST['return'];
$return=$_POST['return'];
$returnJourneyDate=$_POST['returnJourneyDate'];
$Return-Journey-Time[h]=$_POST['Return-Journey-Time[h]'];
$Return-Journey-Time[m]=$_POST['Return-Journey-Time[m]'];
$Return-Journey-Time[ap]=$_POST['Return-Journey-Time[ap]'];
$message=$_POST['message'];
$to="e_chauffeur@hotmail.com";
$subject='the subject';
$message="Name: ".$full_name."\n" "Email: ".$email."\n" .$telephone."\n" .$purposeJourney."\n" .$Vehicle-Type."\n"
.$journeyFrom."\n" .$startDestinationPostcode."\n" .$date."\n" .$Hour-Field[h]."\n" .$Minute-Field[m]."\n" .$AM_PM-Field[ap]."\n"
.$journeyTo."\n" .$endDestinationPostcode."\n" .$return."\n" .$return."\n" .$returnJourneyDate."\n"
.$Return-Journey-Time[h]."\n" .$Return-Journey-Time[m]."\n" .$Return-Journey-Time[ap]. "Wrote the following: "."\n\n" .$message;
$headers="From: ".$email;
if(mail($to, $subject, $message, $headers)) {
echo '<h1>Your message has been send successfully, Thank you' .$full_name.' We will contact you very shortly...</h1>';
}
else {
echo '<h3>Something went wrong!</h3>';
}
}
?>
|
|
|
|
|
|
Hello Jochen
Thanks for your reply, do you think you could help me (with the php code that i provided earlier) i really don't understand it very much. If you can help me it would be great.
thanks in advance
Roni
|
|
|
|
|
Your approach can be only used if there is a local SMTP server (Windows) or a sendmail (Linux) running on the server and able to forward mail. You have to ask the administrator or web hoster.
When it is a web hoster he should have some documentation on generating mail from web pages and might also have already installed a PHP mailer module or some other kind of mail support.
Otherwise use a PHP mailer module as already suggested and configure that (read the documentation) to use the SMTP server of the mail recipient address providing the required authentication credentials.
|
|
|
|
|
display any error masssage after submitting the form?
you can try to change this
$message="Name: ".$full_name."\n" "Email: " to
$message="Name: ".$full_name."\n Email: "
|
|
|
|
|
Creating a web application using ASP.Net and WebForms, properties in the Web.Config file could be accessed in code using the following:
<namespace>.Properties.Settings.Default.<propertyname>
In code within a project using ASP.Net Core, how are properties in the Config file accessed?
|
|
|
|
|
ASP.NET Core applications do not use web.config file for configuration... It may be there in case your application hosted under IIS, but it is there for IIS and not for your application...
Read about your options here: Configuration in ASP.NET Core | Microsoft Docs[^]
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Hello everyone, please i am working on a point of sale system. But i want to use a barcode scanner. How can i do this. I need help please
|
|
|
|
|
Most barcode scanners, at least that I am familiar with, need no interface to work with them. When you scan something they simply put the barcode number into whatever input field is active. So, for example, if you are on a form and have a textbox active and you use the barcode scanner it will automatically put the value into the textbox for you. No code or work required on your part.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thank you. I would give it a try
|
|
|
|
|
I have a php project that is based both online and offline.. How can i update my offline database automatically when it connects to the internet. Someone should please help me out. Thank you
|
|
|
|
|
Member 11786522 wrote: How can i update my offline database automatically when it connects to the internet. Since we don't know how you did your offline database or if you used an existing product there is no way we can answer this.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello I'm really new with React and webpack and after a few days already manage to set up a functional working environment. Now I'm stuck in design issues since I would like to create a 960 wide grid separated into 12 columns with 15 gutters. Then start by creating a 100% high section where you center an image on an 80% white background versus a red main color. In advance grateful for any help or tip that is offered
|
|
|
|
|
That should have nothing to do with either React or Webpack, and more to do with your styling or responsive display framework, whichever is appropriate.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Do you have a specific question?
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have no experience at all with JavaScript. Please help me understand some things....
I'm looking at this small SignalR example.
About halfway down is the HTML, including some JavaScript.
1) First, there seems to be 4 or 5 completely different & unrelated things in this 'function', like a proxy reference, references to the Name dialog that pops up, and variables to store the DisplayName and Message, and the connection stuff??? How can this all be in the same block of code??
2) What does the dollar sign mean/do?
3) There are numerous 'function' words that are nested?? Please explain this. Seems bizarre.
<script type="text/javascript">
$(function () {
<pre>
var proxy = $.connection.chatHub;
<== Client side call back function. The server calls this
proxy.client.broadcastMessage = function (name, message) {
var encodedName = $('<div />').text(name).html();
var encodedMsg = $('<div />').text(message).html();
$('#discussion').append('<li><strong>' + encodedName
+ '</strong>: ' + encodedMsg + '</li>');
};
$('#displayname').val(prompt('Enter your name:', ''));
$('#message').focus();
$.connection.hub.start().done(function () {
$('#sendmessage').click(function () {
proxy.server.send($('#displayname').val(), $('#message').val());
$('#message').val('').focus();
});
});
});
4) In this, " var chat = $.connection.chatHub;", how does the client know about the chatHub??? There are no other references to 'chatHub' outside this, except for the hub itself. How does this work? How does this code know about the hub?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Okay.
- The mix of concerns is largely based on the fact that this block of code is bootstrapping an event handler (proxy.client.broadcastMessage()) and a callback ($.connection.hub.start().done()) that bootstraps another event handler.
- The dollar sign, when used as it is in this example, is often a reference to jQuery. The key indicator is the selector syntax: $('#thing'), $('.stuff'), etc. Where you see it used as an object that's because it is one. Welcome to the joy of frameworks.
- Here's the fun part: in JavaScript everything is an object, to include functions. The nested functions simply represent that a return value or process is required at a certain point. All functions in JS can be trivially assigned a function pointer; in fact that's the way that most functions are handled automatically when they are assigned as arguments.
At any rate, that's a perfectly normal construct, and is appropriate in any place where you want to pass a value that may not be resolved when you call the outer function.
- As noted earlier, the "$" object is jQuery and any extension loaded for it. Think of it like a class library; somewhere before this code execution there was a <script src=".../.../jQuery.js"></script> and a <script src=".../.../signalr.js"></script>. You can safely think of that as a class library import.
So what does this snippet do?
Creates a closure that will be executed when jQuery is loaded, snagging the value of chatHub which is likely loaded as part of a jQuery plugin.
Adds an event handler that informs the hub of what to do when an incoming message is received. You'll notice some GUI logic there.
Bootstraps the local input items.
Once the hub has loaded, define an event handler that will allow the user to send a message.
That's it.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
modified 1-Mar-17 8:37am.
|
|
|
|
|
Thanks for the great explanation!
Nathan Minier wrote: <script src=".../.../signalr.js>
It's up above as
"
I saw this and It's supposed to be an auto-generated proxy. I looked for the SignalR script but couldn't find it.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
modified 28-Feb-17 16:53pm.
|
|
|
|
|
I've never played with the SignalR templates so I'm not sure why it wouldn't be building that portion.
Drop the HTML, let's take a look.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
How do I incorporate Review Markup Schemas in a WordPress website? Thank you.
|
|
|
|
|
There are a lot of plugins with related titles, but I recommend to do it manually
|
|
|
|
|
up what i need is a lots of plugins, for it.
|
|
|
|
|
I'm very new to web development, so forgive my ignorance...
I've got a grid on a page, and it loads fine on startup. I then receive an event from a SignalR service. I want to reload the grid at this point. Here's my controller:
public class HomeController : Controller
{
private IDataAccess _dal;
private DashboardClientProxy _dashboardProxy;
private bool _isConnected = false;
public HomeController()
{
_dal = new DataAccess();
_dashboardProxy = new DashboardClientProxy();
_dashboardProxy.ResultsAdded += _dashboardProxy_ResultsAdded;
try
{
_dashboardProxy.Connect();
}
catch (Exception e)
{
throw e;
}
}
public ActionResult Index()
{
var data = _dal.GetDashboardInfos(new DashboardInfoQueryArgs());
return View(data);
}
private void _dashboardProxy_ResultsAdded(object sender, EventArgs data)
{
RedirectToAction("Index", "HomeController");
}
}
I thought that by calling "RedirectToAction("Index", "HomeController") that the Index method would be run again, yet it doesn't work.
What am I doing wrong here?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
RedirectToAction returns a result to the client telling it to make a new request to the specified action. But it only works in response to a request from the client.
If it fires at all, your event is being fired on a background thread, long after the index view has been rendered. The client is no longer connected to your server, and is not waiting for a response.
But I suspect it will never fire. I believe the default is for MVC to create a new instance of your controller class for each request, and dispose of it once the request has completed. Since the controller owns the object which raises the event, there will be no reachable references to the instance, so both the controller and the proxy will be deleted.
Instead, you'll need to have the client connect directly to your SignalR hub in Javascript. It will need to listen for the event, and when it receives the event, either reload the page, or make an AJAX request to reload just the grid.
ASP.NET SignalR Hubs API Guide - JavaScript Client | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am using MVCGrid.Net.
From what I can see from their documentation the GridColum doesn't have a width property.
Anyone used this grid before? Any way to set a column's width?
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|