473,385 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

PHP else not working

Here is my code, whenever i am testing if its false (I dont type in the from box it says message sent anyway?

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if (isset($_REQUEST['from']))
  3. {
  4. $from = $_REQUEST['from'];
  5. $to = $_REQUEST['to'];
  6. $subject = $_REQUEST['subject'];
  7. $message = $_REQUEST['message'];
  8. mail("$to", "$subject", $message, "From:".$from);
  9. echo "<div align='center'>Message sent!</div>";
  10. }
  11. else
  12. //Else show form again
  13. {
  14. echo "<form action='cheaposend.php' method='post'>
  15. From:<input type='text' name='from'/><br />
  16. To:<input type='text' name='to'/><br />
  17. Subject:<input type='text' name='subject'/><br />
  18. Message:<input colspan='60' height='30px' type='text' name='message'/><br/>
  19. <input type='submit'/>
  20. </form>";
  21. }
  22. ?>
I am using method="post" on other webpage
Nov 4 '11 #1
3 1565
zorgi
431 Expert 256MB
What method are you using get or post?

The form-data can be sent as URL variables (with method="get") or as HTTP post (with method="post").
Nov 4 '11 #2
I am using method="post"
Nov 4 '11 #3
zorgi
431 Expert 256MB
Did that change help?
Nov 4 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Drew | last post by:
I am building an application for keeping track of user permissions here at work. I have built the interfaces, and am now working on the processing page for inserting to the database. I am having...
3
by: Athmaus | last post by:
Hello, I have this ecom page that i am making where customers can select to choose additional licenses before they purchase. I have that part working with javascript. Problem is that when the...
33
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
3
by: BibhuAshish | last post by:
Hello guys i have one function which converts the ip/netmask into networkid/netmask and also it shows the message to user that his ip is changed to network id. but that function is working in...
2
by: kigoobe | last post by:
I am having a very weird issue here, a simple form submit not working. Trying for several hours now ... must be something stupid ... help appreciated. First, the html - <form id="formFinale"...
7
by: Ja NE | last post by:
(as first - thank you for all your help several years ago, and second - please apologise me for my clumsy enlgish) so, preface: some users on my photo related site sometimes enter (link) giant...
1
by: filch | last post by:
Hi, I am new to this forum ... so hello to all! I am trying to get a script working which will show or hide a table based on a user checking or unchecking a parent checkbox. This is the...
2
by: anandjuventus | last post by:
function VisibleDiv(obj) { if (obj == BaseLog) { var objStyle = document.getElementById('DivCalls').style; if (objStyle.display == "block") ...
12
by: flower88 | last post by:
Hello, I'm working on a search form. I have 3 combo boxes and I want to find combinations on a query to later show it in a report. Perhaps this is too complicated but I don't know how else to do it....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.