Follow us on Twitter!
Few are those who can see with their own eyes and hear with their own hearts. - Albert Einstein
Thursday, April 17, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 16
Guests Online: 16
Members Online: 0

Registered Members: 82815
Newest Member: medjiking
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

three pieces of php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-06-07 11:42
okay ...
I have been fine inserting data to an sql db from php
and fine with displaying it ...
But ... Delete and update have gotten me blank ....

someone point me in the right direction...
i need something along the lines of ....

$id = $_post['entry id'];
$pos = $_post['position'];

update position .... set pos to $pos where id = $id

I know thats no php code but thats what i basicly want it to do ....



Also ... what is wrong with this script
Code
<?php
$id = $_POST['id'];
include ("config.php");
database_connect();   

mysql_query("DELETE FROM perfect_nav WHERE id='$id'")
or die(mysql_error()); 
?>






Then i need a script that will ...
If config.php has already been included do nothing ...
if config.php has not been included include it ...



Thanks
Dotti.


Author

RE: three pieces of php

SySTeM
Member

Your avatar

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
HBH Guru
Posted on 24-06-07 11:49
Code

<?php
$id = mysql_real_escape_string( $_POST['id'] );
settype( $id, "int" );
include ( "config.php" );
database_connect();
mysql_query( "DELETE FROM `perfect_nav` WHERE `id` = '" . $id . "'" ) or die( mysql_error() );
?>






img138.imageshack.us/img138/6527/sig2ak1.jpg
www.hellboundhackers.org/sig/r/2783.png



Edited by SySTeM on 24-06-07 11:49
http://www.elites0ft.com/
Author

RE: three pieces of php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-06-07 12:02

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\delnav.php on line 2

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\delnav.php on line 2





I have definately declared the user details in config.php though :S


Author

RE: three pieces of php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-06-07 12:13
System ... Can you reccommend me a script or a layout for config.php file ....
Becuase mine is a bit cluttered ...


Author

RE: three pieces of php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-06-07 12:16
[^&5^&5^756456464567]




Edited by on 24-06-07 13:47
Author

RE: three pieces of php


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 24-06-07 13:25
pm'd Wink