heaversm
03-15-2007, 11:46 PM
Hi, I am trying to help a friend whose PHP programmer went AWOL. Only I know very little about PHP myself. He has, on the backend of his site, a piece of functionality that allows a user to upload a file which will be linked to from the home page of the website. The code I want to implement is as follows:
<a href="news.php?acc=8&id=<?echo $data->id;?>">Delete File</a>, which goes into the MySQL database and clears out the information in the "file" column of the database table.
This link passes information on to a file called modules/class_news.php, which has several scenarios set up. I have no idea what any of them do, but I set up an eighth scenario, as follows:
case 8:
# Erase news
// el archivo viejo lo borramos
mysql_connect($dbhost,$usuario,$clave);
// erase the registry
mysql_db_query($dbname,"update db_news set `file` = '' where id = $id ");
mysql_db_query($dbname,$sql);
$url = "../news.php?acc=8";
Header("Location: $url");
break;
The error I am getting is as follows:
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site48/fst/var/www/html/controlpanel/modules/class_news.php:130) in /home/virtual/site48/fst/var/www/html/controlpanel/modules/class_news.php on line 150
Anybody know an easy way to do this? Thanks! E-mail me if you can help at mike@kaptivate.com
<a href="news.php?acc=8&id=<?echo $data->id;?>">Delete File</a>, which goes into the MySQL database and clears out the information in the "file" column of the database table.
This link passes information on to a file called modules/class_news.php, which has several scenarios set up. I have no idea what any of them do, but I set up an eighth scenario, as follows:
case 8:
# Erase news
// el archivo viejo lo borramos
mysql_connect($dbhost,$usuario,$clave);
// erase the registry
mysql_db_query($dbname,"update db_news set `file` = '' where id = $id ");
mysql_db_query($dbname,$sql);
$url = "../news.php?acc=8";
Header("Location: $url");
break;
The error I am getting is as follows:
Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site48/fst/var/www/html/controlpanel/modules/class_news.php:130) in /home/virtual/site48/fst/var/www/html/controlpanel/modules/class_news.php on line 150
Anybody know an easy way to do this? Thanks! E-mail me if you can help at mike@kaptivate.com