Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Stopping Another Data Insert When User Reloads Page


My PHP script inserts data into a mysql table that has been passed into it.

My question is, what is the general method by which to ensure that if a user reloads the screen, the same set of data doesn't get duplicated into the database?

For instance, I am inserting ticket data (its an ecommerce event system) into a mysql and really dont want duplicated entries if the user happens to press reload or back or whatever

Any ideas?




View Complete Forum Thread with Replies

Related Forum Messages:
Page Reloads Keep Entering Data In Db
The problem is I have a small form that allows a user to input data into a database. Everything works fine, after a successful submission, the user get a message saying that their info was accepted.

The problem is that if that page is reloaded, it enters the info again. There is only going to be one person doing the submitting so I could explicitly say...DO NOT RELOAD the page, but that seems kinda half as**d.

View Replies !
Let User Insert Only Numeric Data
i was thinking would it be possible to make a textfield only possible to insert numeric data so when you would press an other button nothing will happen.

View Replies !
INSERT Data On Page Load?
I have an avatar system where certain avatars are locked until the user unlocks them by going to certain pages of the site.

So far ( being the newb I am ) I only know how to INSERT data from a form. Is there a way to do it on page load or similar?

I also need it to first check if the data already exists and if not it inserts the data and then displays a message to the user that they have unlocked the avatar. Code:

View Replies !
Stopping People From Reloading A Page
I have a form, and when submitted it inserts a new row into a database. If people reload the target page, I'm sure that it'll reinsert another duplicate row. How do I stop people from submitting info numerous times?

View Replies !
Stopping <a> From Loading New Page But Still Performing Onclick Action
I want to use hyperlinks to 'load' content by changing the display of
div tags. the problem i have is that unless i specify a href the anchor
does not change the mouse pointer on hover even if display is set to
block. it only look changes when there is a href there. but if i have a
href there then when i click it will load the page, which i dont want.

how can i get the anchor to look like a proper link where the users
pointer changes on hover (in firefox) but a page does not get refreshed
onclick only the onclick function gets loaded.

View Replies !
Errors To Appear On The Same Page As The Form Where The User Puts In The Data
I want my errors to appear on the same page as the form where the user puts in the data, and I want "non-error" results generated to appear on a different page. Right now, both the errors and any actual results appear on the new page, requiring the user to use the "Back" button when an error is made in order to re-enter the values on the form. I want the errors to appear on the same page as the actual form. On the page where the user enters stuff into the form, I've got: <FORM method="POST" action="res_search.php"> which is the page that the results and the error messages are being shown. Is there any way I can jig that second page so's the error messages show on the originating page instead.

View Replies !
Insert A Page Break For Printing Purposes After X Records On Page.
I need to insert a page break for printing purposes after X records on page. I'm querying five diffrent records with 5 different results and displaying them like:

$record1
$record2
$record3 and so on

So I want to get total number of records which is pretty easy I just add all the totals let's call it $subtotal. Then I want a page break after every 20 records of the $subtotal. Is this possible?

View Replies !
Unable To Insert User Input Into Ms Sql Database.
i have tried to insert user input into ms sql database but still unable to do so. my code has no errors in it. its just that the user input cannot be submitted into the ms sql database. Code:

View Replies !
Session Problem - Login Screen Continually Reloads After Pressing The Login Button
I am trying to get sessions to work on a log in screen to give certain
users access to certain pages/directories. The problem is that when
the login button is pushed (or the enter key pressed) the login screen
redraws, never loading the next page. I don't get any error messages.
I am using FreeBSD-5.1/Apache-2.0.46/MySQL-4.1.0.1/PHP-4.4.3.4

I have pasted the code below:

View Replies !
Login In A User, And Then Pass The Username And Session_id From Page To Page
I want to login in a user, and then pass the username and session_id from page to page until the leave the admin area of the site. Here's a simplified function: PHP Code:

View Replies !
User Login Page - Password Requiring Page
i just created a user login page which works. However, I don't know how to get them to a new password requiring page after they press the submit button. How do I go about getting them there?

View Replies !
Page Redirection - Allow The User To Click A Button That Sent Them To A New Page
I am writing a little section of a home made shopping basket. I collect information and put it in the basket / db. However, I want to update into a new database the final order as and when I click a button that directs the usuer to Pay Pal. My thought was to allow the user to click a button that sent them to a new page that updates the final order database and then redirects to PayPal the information required for billing without the user having to press another button. Would this be a sensible wat to go about it.

View Replies !
How To Insert Data Into One Form ,the Form Include 2 Table Data In Database
i had create a form and i want to insert the data, but my form was include the data from 2 table , wat will be the query looked like, can somebody give me the example ? How to do it?

View Replies !
How Can I Insert Data In A Pdf From Php??
I have been reading this group but I can not find the simple answer
tohow i can solve what i need to do. I have a pdf template, it is, a
pdf with some data like name, surname,etc ...and i want from web
(using php) to open this pdf, fill thesedata and repeat it so many
times as number of students there are... I have read about fdf , etc,

View Replies !
CSV Data Insert To Db
I am having a problem, when I need to update a database from a csv file. What I am doing is that I am reading the CSV file and splitting it where I am finding comma, putting data into an array, and updating database. Noe, in a field I have data with multiple fields.

The counter is setting to zero when I am getting new line character in the field. I have very little idea abou LOAD DATA.

View Replies !
PHP INSERT Bad Data
It builds an INSERT command, and it gets run on the database. Everything works fine except the database is only receiving the first 6 characters of the phone number. Code:

View Replies !
Cant Insert Data
my registration page at www.hoopstart.com/registration.php is not letting me insert data. The error message on the bottom of the page. Looking at my page is it possible tell me why?

View Replies !
Insert Data
I try to insert data from a form into a mysql database, but it did not work. There is no error, but the data did not pass thru the table. This is the short script:

<html>
<head>
<title>Insert Address</title>
</head>
<body>
<p><strong>Insert Address</strong></p>
<?php
print_r($_POST);

$link = mysql_connect("aaa", "aaa", "aaa")
or die("Could not connect: " . mysql_error());
mysql_selectdb("db182527668",$link) or die ("Can't use
dbserver : " . mysql_error());........

View Replies !
Detect What Option The User Selected And Then Direct That User To The Selected Page.
Quick question regarding HTML forms and select fields. I want to be able to detect what option the user selected and then direct that user to the selected page.

<select>
<option name="1">1.html</option>
<option name="2">2.html</option>
</select>

when the user selects, 1.html, it'll direct them to http://www.domain.com/1.html same with 2.html. I wasn't sure if this was done with PHP or Javascript, if its possible on both, which is better?

View Replies !
Checking For Data Before Doing Sql Insert
I have a html form (generated by PHP) that users can fill out and submit
into a database. Everything works fine. However, I'd like to check to make
sure that each field in the form actually contains data (no null/void
fields) before doing the insert into the database. Any tips on how to do
this?

View Replies !
Trying To Insert Data In A Database
I am trying to insert data in a database
Code:

View Replies !
Insert Data Into Variables,,,
How can i insert the data into variables from the tables,,,

$query = "SELECT * FROM users WHERE name = '$username'";
$result = mysql_query($query, $connection) or die('error making query');

while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {
$organization = $row["organization"];
$contactperson = $row["contactperson"];}

View Replies !
Using Php To Insert Data Into MYSQL
I just whipped up this script for part of our project. Do the insert statements and script look legit in order to make php insert data into my mysql tables which I already created in previous scripts? Code:

View Replies !
Insert Data To A Table
I just can't figure out why it isn't sending the data to the table, I've check the names over and over, all the info is parsed correctly, but it falls flat at: $result = mysql_query($sql);

View Replies !
Insert Data Into An Array
How do I insert data into an array, from a form?

View Replies !
Take Data From A Csv .csv File And Insert Into The DB.
I have a .csv (comma delimited) file that is on my server with information like:

ID,Headline,Description

What I would like to do is write some PHP/mysql code so that when I go to the PHP code page it reads/opens/whatever the .csv and takes the content of that file and inserts it into the database.

$ID = first column;
$headline = second column;
$description = third column;

$sql = "UPDATE mytable SET headline = $headline, description = $description WHERE ID = $ID";
$add_rs = $conn->Execute($sql) or die ( $conn->ErrorMsg() );

View Replies !
Mysql_real_escape_string After Data Insert
I used this function to insert data into the database because I heard that it was a safer method.

function check_input($value)
{
// Stripslashes
if (get_magic_quotes_gpc())
  {
  $value = stripslashes($value);
  }
// Quote if not a number
if (!is_numeric($value))
  {
  $value = "'" . mysql_real_escape_string($value) . "'";
  }
return $value;
}

$category = check_input($_POST['category']);

$sql = @mysql_query("INSERT INTO `category` (`cat_id` , `category` , `sub_cat`) VALUES (NULL , $category,NULL)");

Category inserted as '$category' with those single quotes in the DB

I now need to disable those apostrophes or is my script broken. I need just the $category to be echo and not '$category'

View Replies !
Insert Data On Different Rows
I am still relatively new to all the intricacies of PHP and am having a problem.
I have 10 different students (S1-S10) from the same school who all are given the same foods for lunch on a particular date. 

They each get the same entree, condiment (like ketchup), grain, fruit, veggie1, veggie2, beverage1 and beverage2.

I need to be able to enter the amount of each item consumed (like 8 tater tots for the grain) and proportion consumed (i.e. None, 25%, 50%, 100%, other, etc.) for each student.  The proportion consumed can be a drop down but it needs to allow you to type in a value if over 200%.

This data then needs to go into an Access table with each student (S1-S10) as a separate row. Code:

View Replies !
Data Insert Problem
I need a help with passing dynamic value into database like :

HTML Code:
[php]$content = "Name of the Company : ‘.$company .’";[/php]

HTML Code:
][php]$company=â€&#65533;mycompanyâ€&#65533;;

echo $content;][/php]

I want to store $content with dynamic $company name into database so that while display $company name is displayed dynamically.

View Replies !
Submit/insert Data
i have this error when i try to submit/insert data into the database. the following error:
Error in query INSERT INTO (ttNo) VALUES (ðu') You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(ttNo) VALUES (ðu')' at line 1

is it my source code or my database?

View Replies !
Insert Data To Table
i have a user(members) form that pulls from my database 3 fields: name, age, about. i want the user to be able to edit their info then re-submit back to the database. however, i want to have some control as to what they edit their info to. so instead of just update the info back to the database.

i want to hve any fileds that have 'changed' by the user get put to a different table(review), so after i have approved the changes i will 'update the master user table. is there a logical way that i could do this, i guess just flag any fields that have changed when the user form is submitted.

View Replies !
Insert Data Into Two Different Host
I would like to know if there is a way to insert data into two different host with the same fields and table, the first one is the localhost, and the other a remote host, can you please tell me if that is possible and if so how. Code:

View Replies !
Insert Data Into Two Tables
I am working with a preexisting script which uses a form to submit data to a database. It works fine, but I want to submit some of the form data to one table, some to a second table and some to both tables. Code:

View Replies !
Select And Insert Data
Can't I select and insert data into the same table in PHP?

$SQL = "INSERT INTO c (name, prices, prices2, del, loc) SELECT D.name, D.prices, D.prices2, D.del, 7777777 FROM c D WHERE D.loc = '". $_POST['txtCopyFrom'] ."'";

View Replies !
Insert Data If Cookie Is Set
I want to put some data in my database when a cookie is set the first time. It works fine by typing. PHP Code:

if( isset( $_COOKIE[$cookiename] ) ){$temp = $_COOKIE[$cookiename];}
else {
setcookie( $cookiename, $temp, time()+315360000);
mysql_query ("INSERT INTO CountUser (Dato) VALUES (now())")
;}

BUT, this way it puts the data in the database even though the cookie is set or not. How do I get it to only INSERT the data if the setcookie is succeeded. So if people have disabled cookies so the cookie can't be set, the data won't be inserted ?

View Replies !
Insert Data To MYSQL
I am writing one guestbook script , create_entry.php is the file to insert data to MYSQL from form ! I would like to know the scripts: "wait X seconds to insert data to MYSQL" to anti-flooding ?

View Replies !
Insert Data Into A Table
PHP Code:

<?php
$connection = mysql_connect("localhost", "******", "******");
if (!$connection)
{
    die('Could not connect: ' . mysql_error());
}

mysql_select_db("trickyph_testdb1", $connection) or die('Could not select DB.');
$query = "INSERT INTO users (FirsName, LastName, Address, City) VALUES ('Jimmy', 'Watts', &#39484; Wolfer Ln.', 'Springston')";
mysql_query($query, $connection);
mysql_close($connection);
?>

View Replies !
Insert Form Data
I have a form page called "index.php" which contains data that should be inserted into a MYSQL DB. When the user hits the submit button I want the "index.php" page call a function located in another php file called "manage_advert.php". Code:

View Replies !
Update And Insert Data Into The Db.
I need to figure out the best way to update and insert data into the db. I have 3 tables

room[id, room_num, building, numcomps]
software[id, title, version]
softroom[rid, sid, date]

The site is meant to print out software for a room, example: Code:

View Replies !
Insert Data Not Working
i have a problem with inserting data to database. i have to insert array as well,which is not working.the first query work, but the second query didnt work.the second query should insert array of data. Code:

View Replies !
Insert Data In Tables
I have a form with many different fields from which data will go to many different tables. What I want to know is whether I can do it all at the same time. So I have

$query="INSERT INTO tbl1 (fields) VALUES(values)"; "INSERT INTO tbl2 (fields) VALUES(values)" ;

The above format is not correct and I want to know what is the correct format for doing all this in the same $query.

View Replies !
Insert Page Into Template
I have a script that uses a template for my site. I am trying to add a page(s) to it and have the pages use the template. The template has an area where I want the contents of my other page to appear. The other parts of the script use this PHP Code:

View Replies !
Insert A Page Break
I have a for statement that looks something like this: PHP Code:

for ($i = 1; $i <= 100; $i++) {
        
        echo '<a href="someurl.php?p=$i">Link</a>&nbsp;|&nbsp;'

}

I'd like to put in a <BR> tag after every multiple of 10. I've tried to use a nested for statement, but I just get errors. I don't think I'm doing it right.

View Replies !
How To Insert Tab In An Html Page???
i am making one appllication inwhich the user enters text in textarea field. i am saving this value in database and when user accesses value from database, i want to display text in a format entered by user.

i.e. if the user has entered some text in 2nd line then it should be displayed on second line and not after the end of first line in continuation. if user has entered tab in some location, the tab will be displayed while viewing data from database.

View Replies !
Insert/select From Same Page
I was wondering (and I suspect I already know the answer) if it's possible to insert data into a mysql table and select that same data from within the same php page.

View Replies !
How Do I Redirect A User From A Page To A Different Page ?
How do i redirect a user from a page to a different page ? i don't want variables to follow behind the url of the pageg being redirected to.

View Replies !
Using An Array To Insert Data Into A Table.
This works:
$col1 = 2;
$col2 = 2;
$col3 = 2;
$col4 = 2;
$query = "INSERT INTO test (a,b,c,d) VALUES ($col1,$col2,$col3,$col4)";

and this does not

$col = array(2,2,2,2);

$query = "INSERT INTO test (a,b,c,d) VALUES ($col)";

View Replies !
Insert Data Into Two Tables Of A Database
I want to insert data into two tables of a database. Basically i want to insert into table1 then use the automatically generated auto increment id number as a variable in the second part of the insert. any ideas how to go about doing this?

View Replies !
Using More Than One HTML Form Box To Insert Data
I want to be able to use multiple form boxes to insert data into one field in a mySQL database. Is their a PHP processor function or script that will do this?

View Replies !
Insert Data, Then Send An E-mail?
I'm creating a user registration form where I want these actions to run when a button is submitted:

1.  Insert data from form fields into my database (Mydb)

2.  When data is inserted, then send an e-mail with to the adress defined in one of the form fields. The e-mail is carrying a userid defined in one of form fields.

Right...what I want is to create a user. Insert the data into my table in my database. Then send en e-mail with the user-id (defined in my form) to a e-mail adress also defined in my form.

View Replies !
Insert Data From A Form Into 2 Tables
I'm trying to insert data from a form into 2 tables, and I just can't find out whats the matter with this. The following is the insert function, which works fine inserting into the product table, just no information goes into the track table from the form. Code:

View Replies !
Could Not Insert Data Because You Have An Error In Your SQL Syntax
$insert = mysql_query("insert into $table values ('$week', '$date', '$time', '$ip', '$host', '$browser', '$referrer', '$query')", $dbh)
or die("Could not insert data because ".mysql_error());

The $table is 06 and I get this error message:

Could not insert data because You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near &#3906; values (&#3923;', &#392005;-06-07', &#398;:24:49', 'xx.#*$!.xxx.xx', ''

So what have I done wrong here?

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved