Jump to content

Help with Boxes


Vmi90

Recommended Posts

Ok, so far i have this:

<form method="GET" action="send.php">
Username: <input name="name" type="text" size="30" class="box">
<input type="submit" value="Calc">

I want to make it so whatever you put in the box, it becomes a variable, but when you click "calc", i dont want it to send you to another page.  Can someone help me finish that code?
Link to comment
https://forums.phpfreaks.com/topic/28516-help-with-boxes/
Share on other sites

if you want to do work usign the variables done in the form after you hit submit try this in the top <?php section
[code]
<?php
if($_POST['Calc'])
{
    $name=$_POST['name']; // this gets the variable only after you hit submit

}
?>
[/code]

help any? not sure what you are wanting to be honest  :-[
Link to comment
https://forums.phpfreaks.com/topic/28516-help-with-boxes/#findComment-130484
Share on other sites

[quote author=taith link=topic=116351.msg473996#msg473996 date=1164553705]
[code]
<?
$var=$_POST[name];
?>
<form method="GET" action="?">
Username: <input name="name" type="text" size="30" class="box">
<input type="submit" value="Calc">
[/code]
[/quote]

But then how would i make it echo the name once u click calc?
Link to comment
https://forums.phpfreaks.com/topic/28516-help-with-boxes/#findComment-130489
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.