Thanks Again for your help Niheel. I am only new to php and uni hasnt really touched on security yet. I have cleaned and secured it as it submits into the database on the insert page, but are you saying i have to do some security on the .php$city=usa candada page itself? If i stopped users from changing the value of $city would that be sufficient?
Thanks matt.
User Profile
Collapse
-
How to use input data from a form with multiple values in a sql search?
Hey,
Is it possible to use the value of an input such as <input name=city type=hidden value=usa> to include in a sql select? For instance i would be wanting to
SELECT * from cities where city=the input value above. Can i make it into a variable or something to make it usable in an sql select?
Otherwise i have currently passed it to the header which works fine like this www.example.com/cities.php?city =usa... -
-
How to use a LIKE statement to perform a search?
Hi,
I am having trouble with getting rows from a MySQL table using the like statement.
I have a table which contains information relating to 5 cities.
eg.
table_name
City COLUMN_2 COLUMN_3
Bali ... ...
Vegas ... ...
my sql query is currently:
"SELECT column_2, column_3 from table_name WHERE CITY LIKE '%".$CITY."%' ";
where $city... -
storing database fileson server and protecting the directory
Hi,
I need some information on where to store db connection details in php on my server. Currently all the files are in the httpdocs folder. Is it safe to have the db conn file in there? I was thinking of putting the files into another directory with a htaccess file that denies from all users except my scripts. However i have tried
[code]
#Deny access for all users (all IPs), except the same domain IP
Order allow,deny... -
Hi dormilich,
Sorry i didnt look at the size att when i typed it. The problem is occuring becuase alot of the data has similiar names. eg id 4242 & id 4342. So i need to SHOW a NAME and an ID in the drop down but ONLY submit the ID to the database. Its all very messy at this stage. They were previously using ms access, absolute nightmare. Thanks for the reply tho. I have taken a different route now and instead i have supplied a drop down...Leave a comment:
-
How to insert one item from PHP drop down?
Hey,
I need to insert a an item from my drop down into MySQL. However at the moment i am getting all the values and i need to know if theres a way to submit the values individually.
...Code:<?php $sql="SELECT name, no FROM test"; echo "<select name=\"name\">"; echo "<option size=75>name | no</option>"; if ($result=mysql_query($sql)) {
No activity results to display
Show More
Leave a comment: