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.





It Wont Delete The Entry From The Database. The Page Just Refreshes?


It wont delete the entry from the database. The page just refreshes? Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Creating A Page From A Database Entry?
I have a database for reviews, and from it I am able to call a mini index of it's content, listing only the date of the review and the author.

I currently have a 'review icon' which links to the main review on another page via the review's id in the datebase. ie fanreviewid.php where id is replaced by the numerical equivalant in the database.

Anyway, what I was wondering is rather than actually manually having to create this fanreviewid.php page, if there was a way that I could automatically create the page to a set template and by using the same input that's used when the review is initially entered into the database. Code:

View Replies !
$PHP_SELF - Create A Link Which Refreshes The Current Page, And Based On Certain Items On The Page
On a page, I want to create a link which refreshes the current page, and based on certain items on the page (simple form objects like radio buttons)the page will load differently. My link looks like this: PHP Code:

View Replies !
How To Prevent Page Refreshes
I am trying to come up with a method to prevent users from refreshing/reloading a page using PHP

I am making a PHP web based game. I don't want players to reload the page because it will reset the game -- this will be a way for them to cheat. It isn't a Flash game -- it's a pure PHP based combat system.

The best way I can think of this is to generate a random number and use that number for the combat instance. Store that number in a mySQL table and do a check to see if the number is the correct random number for the combat instance.

If the page reloads then a new random number is generated and the check fails, which doesn't allow the combat instance to display thereby preventing the player from cheating.

View Replies !
Login Script Just Refreshes The Page
i have a script but whenever I try to register a test user it just refreshes the page i need help finding the problem. PHP Code:

<?
if (strlen($_POST['username'])<1 || strlen($_POST['password'])<1 || strlen($_POST['passworda'])<1 || strlen($_POST['email'])<1)
{
    echo '<div align="center">Please enter your registration details.</div>'
}
elseif ($_POST['password'] != $_POST['passworda'])
{
    echo '<div align="center">Your passwords do not match.</div>'
}
elseif (strlen($_POST['username'])<4 || strlen($_POST['username'])>16 || strlen($_POST['password'])<4 || strlen($_POST['password'])>16 || strlen($_POST['passworda'])<4 || strlen($_POST['passworda'])>16)
{
    echo '<div align="center">Username and password must be between 4 and 16 characters.</div>'
.........................

View Replies !
Login Refreshes Current Page
Currently, when a user logs into my site, they are directed to a specific page upon success. Now that I have added some depth to my site, I want users to be able to login from any page, and when the login program executes, they are brought back to same page they were at, but in a logged in state. Code:

View Replies !
Error Deleting Photo Once The Page Automatically Refreshes
I have some script that takes an album id and deletes that album and the specific photos in that album. The code does run. The problem is that an error message i set to echo appears saying error deleting photo once the page automatically refreshes. When i check the image folder the images actually have been deleted. Code:

View Replies !
Script Refreshes The Page When It Sees The User Isn't Logged In
Say I have a page named secret.php and I want only logged in users to access it, how can I stop others from briefly viewing it (my script refreshes the page when it sees the user isn't logged in, so they see it for a split second).

View Replies !
XML Trouble - Delete Particular Entry Tag
Dear All

I have an xml file of the following format

<?xml version="1.0" encoding="ISO-8859-1"?>
<contacts>
<entry uri="sip:vinayg@...">
<name>Vinay</name>
<sip> sip:vinayg@... </sip>
<Number> 9885821530 </Number>
</entry>
<entry uri="sip:vivek@...">
<name>Vivek</name>
<sip> sip:vivek@... </sip>
<Number> 9885821530 </Number>
</entry>
</contacts>

I need to device a function to delete a particular entry tag. Please
note that the entry tag is an array. Hence I need to device such a
function

deltag("abc.xml","sip:vivek@...")

which will remove only the entry tag with id vivek@... and
result in

<?xml version="1.0" encoding="ISO-8859-1"?>
<contacts>
<entry uri="sip:vinayg@...">
<name>Vinay</name>
<sip> sip:vinayg@... </sip>
<Number> 9885821530 </Number>
</entry>
</contacts>

I tried the following code but its not working.

$userfile = new DomDocument();
$userfile->load("test.xml");
$pt = "entry";
$temp = "sip:vinod@...";
$suser = simplexml_load_file("test.xml");
$count = 0;
foreach($suser->$pt as $val) {
if ($val[uri] == $temp) {
$userfile->documentElement->removeChild($val[uri]->name);
$countt--;
}
else
echo $val[uri];
$countt++;
}
$userfile->save("test.xml");

View Replies !
Delete Specific Entry
I'm working on a CPanel on my website that gives me the posibility to edit both the blog, news and shoutbox. So far I'm done with adding new: news, shout & blog. But I'm stuck when it comes to deleting. Like if someone is spamming my shoutbox I want to be able to log in and delete the spam shout. I wish I had some code to show you for the delete part, but I dont even know where to start.


View Replies !
Simple Login Page To Delete And Edit Things In Mysql Database
How do I build a simple login page on my site? I need a way to login to my admin area in my webshop, so I can add, delete and edit things in mysql database. I don't need help with add, delete and change things, only the login thing.

The users should not even know that there is a admin login page. The users don't login to shop, they just shop so I can't use the user login page because there is no such page. Can someone please give me some guidelines for this?

View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

<?
include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

View Replies !
Database Entry
I am creating a bulk e-mail sender to send e-shots to our clients. I have many e-mail address in excel and simply want to copy and paste them into a form textarea field and use php to insert each email address into a database.

View Replies !
Mulitple Database Entry
If I want to enter some info into 2 database's with some fields being the same eg name and pass and the key 'uid' to be the same i got this code and it give me a error, PHP Code:

View Replies !
Add Entry Into Database OnClose?
i've got a javascript timer that starts when someone visits my page. And when they leave i need to add the duration to a database. how can i do this?

I can't get anything to work with onClose or onUnload! would it be better to use sessions? how can i get the duraation into the db when someone leave my site?

View Replies !
Random Entry From Database
How can I make a random item from my database be displayed. I'm trying to do that, and also let people click a button and get a random item. something kinda like a random quote, but go to the page of the random item. Would this be hard. This is what I've been developing for a few days, check it out and let me know what you think. btw, it has a few quirks in the design in mozilla/linux right now. so use IE if you want to see it like it will be soon in all browsers.

View Replies !
Create Entry From Database
i am hoping someone can help me solve this problem i have spent the las 5 days over. Code:

View Replies !
Display The Latest Database Entry?
how I can display the latest database entry? PHP Code:

View Replies !
How To Change A Number Entry In A Database
I need to change an entry in a database and I don't know how...they said..i should use update..but still ..it's all too vague for me... See, I need to modify a function which deletes ads. The ads are grouped in one table aptly named "ads".

Now, in a seperate table "category" is where I have saved the total number of ads in a record aptly titled = "total". These two tables have two things in common, they are joined by the category number=catid

Now, my problem is that whenever somebody deletes an ad. It just does that. It deletes the ad in table "ads". Now I need to change the total number of ads ("total") in table "category". Please do tell me how do i do this?

View Replies !
Display Entry From Database To Browser
I can't display entry from database to browser, what's wrong with my code? Thank you for your kind attention. Code:

View Replies !
Link Entry In MySQL Database
i have a database with rateid, bandid and a rating,

how can i like each bandid to different pages, so bandid 1 will link to bandid 1's profile page and bandid 2 will link to bandid 2's profile page. any ideas?!

View Replies !
Browser Refresh On New Database Entry
I have a free-ads type website and when a new ad is uploaded it needs to be sent for manual authorisation. What i would like to do is have a pop-up window that will refresh itself or something similar when a new ad has been uploaded so it flashes orange in the start bar much like msn messenger would do.

I was wondering if this can be done in php? (I'm very doubtful) but im sure it can be done somehow using JavaScript or AJAX? (which i know nothing about). If possible can anyone help with this. I have my website coded in PHP so if possible, i would prefer help in PHP but i'll use a different language if it makes better sense.

View Replies !
Inserting New Entry Into Database Via Email
I have seen this at a small blogging website where members are allowed to add new entries to their journal via email. I believe they send it to some specified email address and add their user/pass as the first line of their text entry.

This is quite useful if you are at work or behind a firewall and can only send emails. I was wondering if anyone has ideas about how such a system could be setup. I'm not looking for code necessarily, just semantics, but if you have built such a system, please feel free to post.

View Replies !
SUBMIT The Data In The Same Entry Page
I have one page, which is for data entery. Another page that run the SQL insert and stores the data in the database.

WORKING:
When the data is entered in data entry page and SUBMIT button is pressed then it takes the user to another page which saves the data in the database and shows the message that the data has been entered successfully.

PROBLEM:

I'd like to do the data saving by the same page upon data entry after pressing SUBMIT. How can I do this job? I would like to have a messagebox saying that the data has been entered, and reappearing the data entry page blank. Code:

View Replies !
PHP Devloping A Post Variable Name With A Database Entry
I am developing a regisration page that will present a set of check
boxes to the viewer. This list of checkboxes is developed from a list
in a database so the amount and names of the boxes will change. This
portion works just fine.

The page content has a user name and password along with several sets
of these checkboxes. All the form content of this page is presented in
one form.

The problem:

I want to store the values presented in these checkboxes back into the
database based on what the user selects. The data will be stored in a
table that has the id for the user and the id for the checkbox item.
As anyone knows, checkbox's only send a boolean value through POST so
once the data is sent it is nearly impossible to test for its value
and work on it since these are dynamically presented.

What I mean by dynamically presented is that the list is pulled from a
database. The checkboxes are build as such: <p><input
type="checkbox" name="{$row['name']}">{$row['name']}</p>. $row is
the reference to the database result set that has been affected by the
row_assoc function.

Since I have no idea what the contents of $row['name'] will be. I
cannot use isset($_POST['checkboxname']) to test its value as you
would normally do. As I see it 'checkboxname' is just a string and so
it seems logical to me that this would work:
isset($_POST['$row['name']']), but it doesn't.

My request:

I need to be able to check to see if the checkbox is check like such:
isset($_POST['$row['name']']) so I can check the value of
$_POST['$row['name']']. What is the correct way to run this check if
it is at all possible? Or is there another way to do this or a more
effective way to do this?

View Replies !
Duplicate Entry - Insert A Record To My Database
When I am trying to insert a record to my database I get this error: Duplicate entry ?' for key 1

but when I check my database from phpMyAdmin I dont have any record with this ID. show me 17866 for Next Autoindex in Row Statistics section too. What's the problem?

View Replies !
I Want To Display Only A Certain Number Of Words From A Database Entry
I want to be able to take a description from a database, row called {car_description} and cut it to a certain number of words and display only that for the main gallery of cars before you click to get the full description ...

like many other sites do with the short description and the "more" button next to it.. I can do the mroe button but how do I right the rest of the tag..

View Replies !
Pre-selecting Options In Html-form According To Database Entry
I've got a html-form consisting - among other fields - of several drop-down-boxes and radio button groups. With this form you should be able to either create a new dataset or to edit an existing one.

If the latter is the case, my application should propose values (the ones which are already in the database) and write them into the input-fields. My problem is, it should have the according options pre-selected and the checkboxes checked, and I've no idea how to do this.

(Example: I've a dropdown box for languages, and my dataset says the language is English, then in my dropdown box the option "English" should be preselected when this dataset is to be edited).

View Replies !
Convert The Entry Back To Yyyy-mm-dd Hh:mm:ss For The Database To Be Updated?
I have a table with a datetime field which is in the format "2007-06-20 00:00:00.000" using the following code I can display this nicely as dd/mm/yyyy (e.g. 20/06/2007).

<?php 

$Format_Start_Date = ($Start_Date != '')?date("d/m/Y",strtotime($Start_Date)):''; ?>

My question is this.... I now want to be able to edit these values by updating a form and I want the users to be able to enter the date in the format dd/mm/yyyy, can I edit the field so that it reads and updates as dd/mm/yyyy or alternately how would I convert the entry back to yyyy-mm-dd hh:mm:ss for the database to be updated?

View Replies !
Cannot Retrieve Database Entry When Digits Are Part Of The Link
I have been trying to figure out why a link such as:

/my-link-1234-test.html

is not picking up the database entry, which is "my-link-1234-test"

BUT when the database entry is

my-link-one-two-three-four-test.html

the entry is found without any problem when clicking on the link. The issue is related to the digits since when the link does NOT include digits, it all works fine.

I wonder if the issue comes from my php SQL filter, which looks like this:

SELECT * FROM article_content WHERE articletitle LIKE '%%%s%%'

I have tried to edit the "%" characters in many ways but still no luck.

Any help would be appreciated since I cannot figure this out.

View Replies !
Competition Entry Form / Random Entry Draw Script
I'm looking for an easy method to implement an 'entry form' for an online competition on my website (a competition page, if you like).

As I am running a 'trade promotion' I will need to apply for a trade permit license, therefore will need to satisfy the local authorities that the entry form and drawing method are acceptible.

The competition page will feature the prize on offer and the fields for entrants to fill in their details.

The tricky part I think is that I then require the entries to be able to be 'drawn randomly' once the competition has ended. Any tips here on how to successfully and easily run a competition from your site?

View Replies !
Query Database And Echo Results Where The Date Of The Entry Is Equal To Or Greater Than Today
I am trying to query my database and echo results where the date of the entry is equal to or greater than today. Currently, it kinda works, but it echoes everything. Below is my MySQL query which is in my code:

$today = date("j, n, Y");
$sqlquery = "SELECT timestamp, diwtitle, id from diw_alpha WHERE timestamp >= '$today'";

The variable 'timestamp' is a timestamp column in my table in the format:

date("Y-m-d h:i:s")

I am not sure if my query echoes everything because there is a difference in date syntax ("j, n, Y") vs. ("Y-m-d h:i:s") or if there is a correct way to do the query. Does anyone have an idea what I am not doing right?

View Replies !
Delete From Database
I have code that does not delete from a database. The same code (cut an
paste in the same file, but different function and having a different query)
works. So, of course, I tested the query interactively. I echoed the query
and did a cut and paste when interactively connect to the database. That
one worked so it isn't the query since interactively it is seeing exactly
the same thing as the code produces.

Here is the code:

function deleteCatalog($catalog) {
$query = "DELETE FROM CatalogNames WHERE sCatalogID='" . $catalog . "'";
mssql_select_db($database_Login, $_SESSION['Login']);
$result = mssql_query($query, $Login);
...
}

The $query echos:
DELETE FROM CatalogNames WHERE sCatalogID='CMP'

As an example of code that works (in the same file)
function addToCatalog($cat_id, $cat_name) {
$query = "INSERT INTO CatalogNames (sCatalogID, sCatalogName) " .
"VALUES ('" . $cat_id . "', '" . $cat_name . "')";
mssql_select_db($database_Login, $_SESSION['Login']);
$result = mssql_query($query, $_SESSION['Login']);
...
}

The second and third lines are identical (cut and pasted) as in other places
in the same code. In fact, it is only in this file that I do all the
database work. Every other function works. This is the only delete,
however.

View Replies !
Delete Database
using php and mysql how can i tell the my website to move any entry older than 30 days to a different table and then delete it below i have some script i did try but this doesnt work (im using unix timestamp incase that changes anything)

mysql_query("
INSERT INTO newsarchive (id, postdate, title, newstext)
SELECT id, postdate, title, newstext FROM news WHERE postdate < DATE_SUB(curdate(), INTERVAL 30 DAY)");

mysql_query("DELETE FROM news WHERE postdate < DATE_SUB(curdate(), INTERVAL 30 DAY)");

mysql_close($link); //clean up

View Replies !
Recursive Database Delete
I have two tables in my database, one for the folders, where each folder has a parent id and an id itself, and one for the files where each file has a parent id for the folder its in. Now If the user deletes a folder, every file and folder within it, no matter how many there are, should be deleted. Can anyone give me the idea?

View Replies !
Delete Item From Database
I still can't figure out how to delete an item from my shoppingcart. I have tried different ways to do this, but its impossible.

-a button or link that deletes a item from my database
-the php script that deletes it

here is a suggestion:

$slett = "DELETE ID, VARE, MODELL, STR, ANTALL, PRIS,
TOTALPRIS FROM USER_TRACK
WHERE USER_ID = "$user_id"";

But how can i assign this to a button?

View Replies !
Delete Row In Database By A Selectbox?
I'm having a world of trouble with this. I have a selectbox of names....when they selectone and hit delete I want it to delete it from the database. I dont think i'm getting any value from the select box. Here is the code I have : PHP Code:

View Replies !
Delete A Row From A Database Table
I'm trying to delete a row from a database table.  I've made a connection yet it's not working.  Is there something wrong with the following code?

mysql_query("DELETE * from  `contactinfo` WHERE Submission_Number = 1 ");

View Replies !
How To Delete MySQL Database.
I've got three hostings with the GoDaddy hosting service. The hostings are supposed to provide only one MySQL database each. I've just recently noticed in the phpMyAdmin program that separate databases, each with the name "test," has appeared in two of the three hostings.

I don't know how they got there. I didn't put them there. I contacted GoDaddy's technical support. They said that the "test" databases automatically comes with the phpMyAdmin program. Of course, that's not right. Anyway they said that I could delete the extra database without damaging anything.

View Replies !
Delete Data From Database
Let's say i have two tables,

table_one;
userid,userinput,indexno

table_two;
cond,qant,amp,indexno

the indexno in table_one and table_two are the same.if i choose to delete one row of data in table_one,i want the data with the same indexno in table_two be deleted as well.
how can i achieve this?

View Replies !
Redirect Does Not Work.Instead It Refreshes Itself.
I am using the following insert script in a form with executes on the same page using : action="<?php echo $_SERVER['PHP_SELF'] ?>" . however the redirect does not work.Instead it refreshes itself.. Code:

View Replies !
Pressing Submit Refreshes
Last night i coded a silly little login script for practice. I'm not the world's best programmer, and I've not used php in over a year, I've been using pascal and C++. Can anyone see why, when I push submit, the script just refreshes rather than submitting the data to MySQL? PHP Code:

<html>
<head><title>Register</title></head>
<body>
<?php
$self = $_SERVER['PHP_SELF'];;
$username = $_POST['username'];
$password = $_POST['password'];

if( ( $username == NULL ) or ( $password == NULL ) ) {
        $form ="Please enter all new user details...";
        $form.="<form action="$self"";
        $form.="method="post">Username: ";
        $form.="<input type="text" name="username"";
        $form.=" value="$username"><br>Password: ";
......................

View Replies !
Delete An Image From Web Page
i have a script (below) which lists all the images in my images folder on my website - I was wondering if somebody could give me some idea of how to add a delete link to the following script so that i can easily delete each image. Code:

View Replies !
Mark A Row In My Mysql Database As To Be Delete
Is there a way in php that I can mark a row in my mysql database and then later so delete these rows that have been marked?

View Replies !
Database Auto Count What About Delete?
I have a table that give a unique ID to certain Articles.
To give the ID i simply use the Auto count of the DB.

But what happens when i delete a record? i am now missing an ID.
How can i insert a row and give it the first available number?

For example ID 1, 2, 4, 5, 6

i would Insert and set the ID number to 3.

View Replies !
Delete Data From MySQL Database
I am new to PHP and MySQL but I have setup a MySQL database. I can view the information in an HTML table using PHP scripts and can delete an entry form the database table, but what i need to do is to be able to delete an entry by selecting a radio button next to the relevent information however when i try to add a form in the PHP script i get an error.

View Replies !
How To Delete Multiple Entries From Database?
I ran this script Im working on twice by accident which caused a ton of duplicate entries. I dont want to start over so how would I delete multiple entries in a database?

View Replies !
Database Update/edit And Delete
i have spent the last few days trying to create a simple script to add/edit and delete entries in a mysql database with php. i have 1 database with 40 tables, each table has 3 fields (id, header and body)

i created an input page with input fields for header and body. the table to store the information in is selected from a drop down menu. all this works fine.

for some reason i cannot get the edit and delete page top work at all. would someone mind taking a look at the code and let me know what i am doing wrong? Code:

View Replies !
Delete From Flat File Database ?
I have recently started to code a Flat file database (just for fun) and it's going fine, but I was wondering whats the best way to delete a line from the file.

I have this code below and I would like to add a delete button besides each line, which would obviously delete that line. But I do not know the best way to go around doing this as I don't know any specific functions to use. Code:

View Replies !
Using Checkboxes To Delete Record From Database
i would like to use check boxes to delete records from the database. my problem is, the records belong to different tables. how do i indicate in my code "DELETE from blah blah... " from which table to delete from..

View Replies !
Pressing Submit Refreshes My Login
I've made a log in script but when I press submit...The script just appears to refresh. Code:

View Replies !
OOP Page: Where To Put Update, Insert, Delete
I have a page that shows info from MySQL. It is for an online education
site. It uses different classes arranged in a hierarchy. Each lesson is
roughly laid out like this:

Lesson
|-Intro
|
|-Section
| |-Procedure
| |-text, video, images
|
|-Section
| |-Procedure
| |-text, video, images
|
|-Summary

I have all the classes working properly for displaying info from the
database. Now I am building the admin site.

Where should I put the update/insert/delete code? Would those go inside the
classes? Should I use the lesson object when doing the maintenance? Or,
should I just have a separate page that handles the database stuff and only
use the objects to display the data from the database?

View Replies !
MySQL DELETE: How To Get Page To Refresh?
I have a script that deletes records in a table. It works fine. However, it redirects the browser back to the page and the record stills shows there. Only after the page is manually refreshed does it disappear.

I've used both header("Refresh...") and header("Location...") to accomplish the redriect, but no dice. The only thing that seems to work is if a unique URL is pushed into the address bar, which I do by appending md5(microtime()) to the end of the redirect URL.

View Replies !

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