473,670 Members | 2,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help with this

1 New Member
i am new to php and need some help. i have 2 pages one is html and other is .php

when i run the program it just spits out the code. i am stumped

here is the html file

<html>
<Head>
<title>Triangle </title>
</head>
<body>
<form action="triangl e.php" method="POST">
<p>
sideone:<input type="text" name="a" />
sidetwo:<input type="text" name="b" />
sidethree:<inpu t type="text" name="c" />
<input type="submit" />

</p>
</form>
</body>
</html>

here is the php


<html>
<head>
<title>Triangle </title>
</head>
<body>
<?php



function calculate($firs tside,$secondsi de,$thirdside)
{

$firstside=$_PO ST["a"];
$secondside=$_P OST["b"];
$thirdside=$_PO ST["c"];

$total = ($firstside + $secondside);


if ($total > $thirdside)
{
echo "(you have the correct side lengths)";
}
else
{
echo "(please re-enter the side lenghts)";
}
}

calculate("firs tside","seconds ide","thirdside ");


?>

</body>
</html>
Mar 29 '07 #1
1 1122
Motoma
3,237 Recognized Expert Specialist
What version of PHP and Apache do you have installed?
What OS are you using?

i am new to php and need some help. i have 2 pages one is html and other is .php

when i run the program it just spits out the code. i am stumped

here is the html file

<html>
<Head>
<title>Triangle </title>
</head>
<body>
<form action="triangl e.php" method="POST">
<p>
sideone:<input type="text" name="a" />
sidetwo:<input type="text" name="b" />
sidethree:<inpu t type="text" name="c" />
<input type="submit" />

</p>
</form>
</body>
</html>

here is the php


<html>
<head>
<title>Triangle </title>
</head>
<body>
<?php



function calculate($firs tside,$secondsi de,$thirdside)
{

$firstside=$_PO ST["a"];
$secondside=$_P OST["b"];
$thirdside=$_PO ST["c"];

$total = ($firstside + $secondside);


if ($total > $thirdside)
{
echo "(you have the correct side lengths)";
}
else
{
echo "(please re-enter the side lenghts)";
}
}

calculate("firs tside","seconds ide","thirdside ");


?>

</body>
</html>
Mar 29 '07 #2

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

Similar topics

2
1307
by: kmunderwood | last post by:
How do I show only one Element with this code Help Me, OH!!! Help Me ;) I have code that works, but... This is the way it comes out in html The Level, or Element "v1"(background) turns red when under 600 Bulk Storage Tanks
6
2565
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a "SEGV" when run (presumably - attempt to delete deleted memory. Please take a look and see if you can notice any mistakes I'm making. Basically, I want to store classes of my objects in a vector. I also have three further questions:
2
2163
by: atv | last post by:
Hi, is there something wrong with this code? It seems that it crashes at the else { clause, when allocating a second record. Excuse for the indentation, the g_warnings are from gtk. Also, i'm using 2 pointers in the struct, which consists of 3 ints, and 2 pointers, which i give 256 bytes each. Much to much ofcourse, but it's just testcode. The code doesn't even reach the g_warning in the { code.
4
353
by: momo | last post by:
Hello all, I need help with this. I have a datagrid (dg1) with checkboxes and I want when some rows are selected to populate another datagrid (dg2) with the selected rows from (dg1). Thanks Momo
0
1621
by: TN Bella | last post by:
Hi, I am trying to get my compare validator to fire properly...Since I have panels the validator wouldn't work properly, the app would fire right but would insert the data regardless and the user couldn't fix an error if they had an error. So I added another sub and fixed the panels, but the compare validator still doesn't work right. Right now the validator pops up with the error that the two values (txtAcctAmtSum and txtInvAmt) are...
4
3053
by: Maziar Aflatoun | last post by:
Hi everyone, I am working on the 'Delete' section of my program. What I need to do is query my database and for every ID that it finds I want to remove a file+ID.jpg from my file folder and update another table with that information. However, I'm getting the following error message. There is already an open DataReader associated with this Connection which must be closed first. Description: An unhandled exception occurred during the...
2
1662
by: Merdelus | last post by:
I'm a new visual basic learner, I need some help with this program below: create an application that either sums or averagethe rows or columns of a two dimensional array depending on user choices. create a menu bar with a file that includes a perform action command and an exit command. the perform action command computes either the sum or the average of the rows or columns in the array and displays the result in a
2
1296
by: carly | last post by:
Hi......i need some help with this C program. I have created a array called "data" of 100 integers, im just having problems with writing the funtion call that will sort the 100 elements data through data. My program should run as: ./my_sort input_file sorted_file Thanks!! Carly
20
7203
by: fniles | last post by:
I am using VB.NET 2003, SQL 2000, and SqlDataReader. As I read data from tblA, I want to populate tblB. I use SQLDataReader for both tables. I do not use thread. When I ExecuteReader on tblB, I get the error "There is already an open DataReader associated with this Connection which must be closed first." How can I fix this error ? For each DataReader, do I want to open and close the connection (in this case adoCon) to avoid this error ?...
6
4389
by: Falcco | last post by:
Hi all, i have a sql scripts and i need to make new database based on this scripts but i dont know how, because this ist my "first meet" with this PostgreSQL. I need that for project to school, and i really need your help. Is something like "how to" manual? thx a lot.
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8591
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8660
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7415
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.