Hi Experts, here i come again and wanna ask how we can perform record update in PHP & MySQL without passing the id in the URL for the $_GET method to be used in the processing page. I mean I have records of tenders displayed in a page and each of the records are hyper linked to edit and delete links. And at present what i am doing is embedding id in the URL i.e
- <a href=edittender.php?id=$id>Edit</a>
. Now, i dont want the id to be embedded in the URL and instead want any other methods to be applied to get this workdone. Can you all advice me how i can go about?
12 1826 Dormilich 8,658
Recognized Expert Moderator Expert
use the POST method, though this requires either form submission or AJAX procedures.
regards
thankyou but i am not sure how POST can be used in this situation. Can i have an example please?
Dormilich 8,658
Recognized Expert Moderator Expert - <form action="edittender.php" method="post" accept-encoding="UTF-8">
-
<input type="hidden" name="id" value="id_to_submit">
-
<input type="submit" name="send" value="send request">
-
</form>
sorry but i think you didnt understand me. well, i please see my code below: -
<?php
-
$q= "SELECT * FROM ".TABLE." order by field";
-
-
$result_ = $database->query($q_);
-
-
$num_rows_ = mysql_numrows($result_);
-
-
for($j=0; $j<$num_rows_; $j++) {
-
$id = mysql_result($result_,$j,"id");
-
$tender = mysql_result($result_,$j,"tender");
-
?>
-
<table>
-
<tr>
-
<td><?php echo $tender; ?></td>
-
<td><a href="edittender.php?id=$id">Edit</a>
-
</tr>
-
</table>
-
<?php
-
}
-
?>
-
The code above can generate all records available in a table and each of it has a EDIT link. Now what i meant to say was that i dont want the id to be passed in the URL which i have done at present. In this case i can't use a form with buttion to pass the id for a POST method.
Markus 6,050
Recognized Expert Expert
- butts in.
Then your other option is AJAX. Although, I don't understand your issue with using GET.
Dormilich 8,658
Recognized Expert Moderator Expert @raamay
why not?
does it matter if you use a button (form) or a link (href) to trigger the edit? I could have named the button EDIT to make that clearer (but I've had little time, so...)
TheServant 1,168
Recognized Expert Top Contributor
To submit forms without having to click a submit button your best bet as has been said twice is AJAX. PHP will do your server side stuff but if there is a problem on the client side (eg. submittting a form in a fancy way) you want to go javascript/AJAX.
Dormilich 8,658
Recognized Expert Moderator Expert @TheServant
that's a rather complicated way of submitting a form.... and kind of spoils the intention a form.
the only thing is that you (normally) don't leave the page with AJAX, whereas a link will make you leave the page (so does a form).
but still I've not been told why a form is here impossible to use. I'd really like to know that.
Atli 5,058
Recognized Expert Expert
Hi.
What I am wondering is... what is the point of removing the ID from the URL?
Whether you pass it via the URL, a typical form using POST or AJAX, the result is the same.
And from a security standpoint, they are all pretty much equal. (Given that you designed the server-side portion properly.)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard C Buchanan |
last post by:
I have a table as follows:
- user_id (key)
- user_email_address (text)
- user_request_date (text)
- user_sent_date (time/date)
An automated macro will run every 5 minutes and needs to run a SQL UPDATE
that:
|
by: Ilan Sebba |
last post by:
When it comes to adding records in related tables, Access is really smart.
But when I try to do the same using ADO, I am really stupid.
Say I have two parent tables (eg Course, Student) and one child table
(StudentProgress). The course progress records how a student progresses on
a course. I have one course (History) and one student called Maya. I now
want to record her grade (64). If I do this in Access using a form, then
the form...
|
by: James P. |
last post by:
Hello there,
I have a bound-form using Navigator so that the user can move back and
forth to update record in the form. Every time a record was modified
and the user clicks the Navigator to either move backward or forward
to the next record, a message is popped up asking the user to confirm
the change. If the user clicks "Yes", the record should be updated
and the Navigator takes the user to the next record as clicked. If
the user...
|
by: Zlatko Matiæ |
last post by:
There is a form (single form) and a combobox. I want that current record of
the form is adjusted according to selected value in the combobox. Cuurrent
record should be the same as the value in the combobox.
What is the solution?
Thank you in advance.
|
by: todholt |
last post by:
Hello,
I am trying to bypass a form's automatic update, and instead call a
stored procedure in sql server. I am using continuous forms. The
problem I am having is with returning to the next selected record once
I have performed the update.
i.e. user edits record A and then clicks on record B. Record A is
updated, and selection moves to record B. I don't know how to
determine what record B is...
| |
by: Mihaly |
last post by:
I want to update a record into a table in SQL Server 2000 database from
C#. This table is used concurently for other users too, and I want to be sure
that from the read of record to the update no other user was updated the
record.
Please tell me how can I do this.
Thank you!
|
by: PAUL |
last post by:
Hello,
I have 2 datasets I am trying to update. The parent table seems to
update fine but when I go update the chiled table I get an error message
that says I need a related record in the parent table. However I put some
code in to display the key field of each parent table record (parent
dataset) and the value I am trying to put into the child table is there.
ParentTable ChildTable
ID------------------------<...
|
by: smugcool |
last post by:
Hi,
I have created a form in Visual basic 6.0 for adding/updating the change request made by various users.
Well i am able to update the record through my code in access database.
Can anyone tell me what code should i use to Add record in the database, i also want the new record which will be added in the access database is having some unique no like CRC-CC-date/month/year-incremental number?
I mean as soon anyone will hit the add...
|
by: emalcolm_FLA |
last post by:
Hello and TIA for any help with this non profit Christmas assistance
project.
I have an applicant (app history) and child (child history) tables (4
total). I need to grab the next available (in house case number, appt
date and time) for the applicants yearly history and the childs yearly
history and then print a report with the applicants info and this in
house case number. The forms are linked with ID_app (from the
applicant table).
|
by: Andy_Khosravi |
last post by:
I'm having issues with updates being blocked due to some sort of
record locking issue. The error does not occur consistently, so I've
had a hard time nailing it down. It does happen enough to cause major
problems for my users though as they are working in this all day. I've
been pounding my head against the wall for the last week trying to get
this figured out.
BACKGROUND
I have an Access 03 DB that is split with the BE on a network...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
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();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |