Get PHP Contact Form to Work - php

I am creating my first ever website. I have created a PHP Contact Form. Right now, my html and php files are stored locally, and I do not have a web host yet.
When the Submit button is clicked, the PHP file is downloaded, rather than the email message being sent. How can I get the Contact Form to send an email? Do I need a web host, first, before I can do this?

Sounds like you are loading your HTML files in a web browser and when they submit to the PHP page it loads the page. This is because you need a web server to actually process the PHP script.
If you're running Windows you can look into WAMPServer.
There's also MAMP for Macs.
And Xampp which works on Windows, Macs, and Linux.
There are lots of tutorials for using each f them so getting started should be easy to do.

Related

PHP Desktop Not responding on AJAX CALL

I am trying to convert my existing website into PHP Desktop Application using PHP Desktop, everything is working fine but when i am trying to login i am using ajax call for login it does not responding. it does not even print any error message on php desktop console.
It might be that your ajax code is making a request to http://127.0.0.1/some_resource, but phpdesktop web server is running at http://127.0.0.1:1673/ - as you can see in your console logs. PHP Desktop assigns a random web port to avoid conflicts with existing software. In a php script you can know the port by checking $_SERVER variable. If you want to set a fixed web server port then you can do so by editing settings.json file (see the Settings wiki page in phpdesktop project).
You have to check your ajax code to know what url it is trying to access, you can do this using Developer Tools window, you can open it in phpdesktop using mouse context menu.
You don't really have to set fixed web port if you can modify your ajax code to not use full paths with domain names and just the path like "/some_resource".

I Want to connect my arduino code sim900 parameters to localhost database. Help me

I want to connect my arduino code data to php webpage using database. While inserting parameters manually it was successfully done but when connecting arduino code to php webpage it doesn't work I am writing like this
SIM900.print("AT+HTTPPARA=\"URL\",\"localhost:8012/phpgang/getdata.php?");
Setting the httppara, the second parameter is the website you want to access
but it doesn't working.
Anyone can help me in writing in correct form or any other related procedure of connecting it? php code os simple as inserting data through .GET process.
localhost isn't a real server. It's a placeholder name (and IP address) that always refers back to the local system. On the SIM900, this is the SIM900 itself, which is not running your web site.
If you are running your web site on your personal computer, that won't work. You will need to upload and run your web site on a publicly accessible web server to access it from the SIM900.

Can I use a remotely hosted phpmailer file to send email from static html page?

Here is what I want to do:
I have a static shared web page on dropbox, since dropbox is not a server it cannot send mail via php.
My page has an email form, and I wish to point it to a phpmailer file I host on my regular hosting account (instead of the usual setup, where the php file is on the same server).
Will this work? Will the javascript be able to send the values to the php file if it does not reside on the same server?
Off course I can test it, but I thought I might ask the community before I start.
Thanks in advance!
Yes. You will need to host a PHP script somewhere else, but you can point at it from anywhere. You just need to put the full URL of the handler as the action in your form:
<form method="post" action="http://www.example.com/formhandler.php">...
You can do the same thing with javascript XHR/ajax requests.

send text to gmail via PHP form

I have a question about PHP.
I want to create a really simple page with only one function.
a text box, and a button to send it to my e-mail address.
**/ I don't really even get the concept of a .php file, or how to implement it to a html file (or do I just create a php file?)
I've been surfing on the web for a way, but quite can't get it.
If you can give me some advice on it, I'd really appreciate it.
I wrote the program, but won't send it to the address("itoyanlifelog#gmail.com").
I'm running it on MAMP, local server.
1) use php mail() function: http://fr2.php.net/manual/en/function.mail.php
2) if you are on a local machine be sure that you can send emails from local. Take a look here: http://wiki.uniformserver.com/index.php/PHP_mail_function

Form to mail tools

I've just made some fixes to a web site that uses the Form2Mail PHP script. This worked on my home machine, a while back, but I have suddenly been pressured to release today, and it is already 3pm here.
I am an ASP.NET developer and know very little PHP, so if I have to improvise, writing my own version of the script is not a very feasible option. What other options to I have that can allow me to, out of the box, cause an HTML form's submit event to result in an email being sent to a configured email address?
sending mails in php is very simple http://php.net/manual/en/function.mail.php
you would just put a form that submits to something like mail.php, stick some mail code in there and you are done

Categories