I've tried looking online before actually asking for help, but I've been looking for about the past 3-5 hours and have found nothing that'll help me.
This is a project for school, and well I have to use Access as a database. I am using PHP for coding, and I'm fairly new to PHP. Now for the problem...
When I type in a Name in my Text Field all is good, I hit submit it works, if I hit reset it resets. My issue happens after I hit submit once the item is added, then if I refresh the page the item is added again, and it happens as many times as I hit refresh. I've tried numerous ways to make my text fields clear. I'm not coming up with anything. I started out having two files a PHP and HTML, I combined them hoping I could figure out a way to fix this, but to no avail.
If you look at my code you'll find that "odbc_exec($conn,$input);" is missing I took it out cause I have no idea where to put it, or what to do with it, or how to clear the fields upon having that executed.
If anyone could help me even the tiniest bit that'd be great
Code: <?php
$conn=odbc_connect('database','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$Name = $_POST["Name"];
$Submit = $_POST["Submit"];
$Reset = $_POST["Reset"];
$input="INSERT INTO Registry (FirstName) VALUES('$Name')";
$sql="SELECT * FROM Registry";
$rs=odbc_exec($conn,$sql);
?>
<html>
<body>
<form name="TestForm" method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
Name: <input type="text" name="Name" maxlength=50/>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
</form>
</body>
</html>
<?php
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>FirstName</th>";
echo "<th>LastName</th></tr>";
//Writes Table Values
while (odbc_fetch_row($rs))
{
$firstname=odbc_result($rs,"FirstName");
$lastname=odbc_result($rs,"LastName");
echo "<tr><td>$firstname</td>";
echo "<td>$lastname</td></tr>";
}
odbc_close($conn);
echo "</table>";
?>
Function
How can I make this function that once you click the link in the code it takes you to a new page without html but so the menu_name and content load in it.Code: function public_navigation($sel_subject
System copy error in RUN ABAP REPORT PHASE
Hi,
Help with explandable category tree
I have the below query: SELECT l1.id as lev1_id,l2.id as lev2_id,l3.id as lev3_id,l1.category AS lev1, l2.category as lev2, l3.category as lev3 FROM categories AS l1LEFT JOIN categories AS l2 ON
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignored, rejected, or misunderstood in this forum. I'm surprised there isn't already any
double and single quotes in text fields acting up... help please
Single quotes, when entered into a text field, create an sql error upon Submit. It seems to create the query OK but says there's an SQL syntax error and stalls out on that field.Also any time a
writing a screen scraper
Hello,I'm writing a screen scraper application and want to be able to get absolute addresses for images from relative links.So a link like this: Code: <img
array & querys help/advice.
Ok so here goes , I have a mysql database and basically here's what I need to do.// foreach store id// foreach product id {// query with where store id and product id// get price row for each
PHP not creating file.
Its supposed to create a .ini file in the /scriptfiles/users/ with the name they entered into the field then its supposed to create a password in the file in md5 encryption like this
Adding to the next element in a multidimensional array
Hi, I'm trying to add a value to $node->field_spaces['nid'] where x is the next available spot in the field_spaces array. Always adding to the next spot. I'll be calling this in a for loop to
Help with search.php
Hello AllI need the search engine on a site I am building at the moment to display the search results inside the main section of the web page. At the moment I have got as far as connecting the search