473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Execute script based on the parameter passed with the URL

Ajm113
161 100+
How do I have it so if a word in the url was entered then php will run a part of a script?

Example: Since I want to save server space I want to be able to update my database in one file. Which means deleting, updating, and adding data. So I want to trying to keep everything in one file. So if the user lets say wanted to delete something it will go through the update.php page. But after the ".php" it will show something like "delete" and then php will run a part of the script set up for it and delete what ever the user wanted to delete in mysql,
Jul 7 '07 #1
3 1607
mwasif
802 Expert 512MB
You can use a parameter named 'action' and passed the appropriate action value. e.g.

[PHP]if($_GET["action"]="edit")
{
// edit procedure
}
elseif($_GET["action"]="delete")
{
// procedure to delete
}[/PHP]
Jul 7 '07 #2
ak1dnar
1,584 Expert 1GB
Thread title changed – Ajaxrand
[please read why]

Earlier: How do I have it so if a word in the url was entered then php will run...
Recent: Execute script based on the parameter passed with the URL
Jul 8 '07 #3
kovik
1,044 Expert 1GB
Use a query string (page.php?delete).
Jul 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

31
by: Brian Sabbey | last post by:
Here is a pre-PEP for what I call "suite-based keyword arguments". The mechanism described here is intended to act as a complement to thunks. Please let me know what you think. Suite-Based...
4
by: paul dallaire | last post by:
HI! I want to execute a link witch is in JavaScript, How do we execute this in asp server side if possible? Basically I don't want anyone to see this link in the code view. this is the link...
12
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc...
1
by: CR1 | last post by:
I found a great cookie script below, but don't know how to make it also pass the values sent to the cookie, to a querystring as well for tracking purposes. Can anyone help? If there was a way to...
2
by: Peter Kirk | last post by:
Hi there in c# what is a good way of selecting which method to call based on a string? For example, my method can accept a string parameter (there are 50 or so valid strings that can be...
10
by: m.epper | last post by:
Hi to everybody. First of all sorry for my english, I'm italian. How can I execute a portion of code, in a function, into the global scope? Example: <?php
2
by: peteinglastonbury | last post by:
I'd be most grateful if someone would help me. I hope I'm in the right forum (apologies if not) - I'm not sure whether my problem is CGI or Javascript related. I found a script called...
2
by: tommygrealy | last post by:
Hi, I am trying to make a perl script that will display an image (passed in as a parameter to the perl script) and also add a drop shadow around it. The problem is that I need to create a...
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.