SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Problem with including php files
-
Oct 1, 2003, 00:27 #1
- Join Date
- Sep 2003
- Location
- Bucharest
- Posts
- 56
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Problem with including php files
I have this problem:
I used the following include code:
PHP Code:include 'data.includes/update_distribuitori.php';
include 'data.includes/delete_distribuitori.php';
However, if I just copy-paste them in the php file...it works.
PHP Code://_____________________block 1
if (isset($_POST['update'])){
$table2= "distribuitori";
$produs =$_REQUEST['produs_cerut'];
$nume =$_REQUEST['nume_prenume'];
$firma =$_REQUEST['firma'];
$telefon=$_REQUEST['telefon'];
$adresa =$_REQUEST['adresa'];
$email =$_REQUEST['email'];
$coment =$_REQUEST['comentariu'];
$id = $_POST['id'];
$update = @mysql_query("UPDATE $table2 SET produs_cerut='$produs'
, nume_prenume='$nume'
, firma='$firma'
, telefon='$telefon'
, adresa='$adresa'
, email='$email'
, comentariu='$coment'
, date=now()
WHERE id=$id");
if (!$update){
echo '<p class="static9">Exista o problema in update-ul intrarii:'.mysql_error().'</p>';
exit;
}
echo '<p class="static9">Randul cu id-ul <b>'.$id.'</b> a fost updatat</p>';
}
//____________________________block 2
if (isset($_POST['sterge'])){
$id = $_POST['id'];
$delete = @mysql_query("delete FROM distribuitori where id = '$id'");
if (!$delete){
echo '<p class="static9">Exista o problema in stergerea intrarii:'.mysql_error().'</p>';
exit;
}
echo '<p class="static9">Randul cu id-ul <b>'.$id.'</b> a fost sters din baza de date</p>';
}
-
Oct 1, 2003, 01:41 #2
- Join Date
- Feb 2001
- Location
- Melbourne Australia
- Posts
- 6,282
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Did you make sure that the included files began with <?php and ended with ?>?
If this is not the problem, what do you mean about "did not parse"? What happened? An error message?[mmj] My magic jigsaw
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Bit Depth Blog · Twitter · Contact me
Neon Javascript Framework · Jokes · Android stuff
-
Oct 1, 2003, 01:58 #3
- Join Date
- Sep 2003
- Location
- Bucharest
- Posts
- 56
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
[QUOTE='mmj']Did you make sure that the included files began with <?php and ended with ?>?
[QUOTE]
This was it.I didn't now this.
Thanks a lot
Bookmarks