It is currently Thu Jun 27, 2019 12:47 pm


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: my own forum script problem
PostPosted: Sat Dec 10, 2005 11:01 am 
Noobie
Noobie

Joined: Sat Dec 10, 2005 10:39 am
Posts: 3
H!i I made my own forum script that works well on my home server. When I try to run it on freeownhost.com server, it doesen't write anything in databse. The wierdest thing is that it doesen't report any error. Here's the code:

Quote:
include_once('variables.inc');
$datum = time();
if ( ! empty($_POST['naslov'])&& ! empty($_POST['avtor']) && ! empty($_POST['besedilo'])) {

$link=mysql_connect("$server", "$user", "$pass") or die("Napaka. ".mysql_error());
$naslov = mysql_real_escape_string($_POST['naslov']);
$avtor = mysql_real_escape_string($_POST['avtor']);
$besedilo = mysql_real_escape_string($_POST['besedilo']);
mysql_select_db ("$db", $link) or die("Napaka. ".mysql_error());
$query = "INSERT INTO naslovi ( naslov ) VALUES ( '$naslov' )";
mysql_query( $query, $link );
$vrednost=mysql_insert_id();
$query = "INSERT INTO vpisi ( avtor, datum, besedilo, vrednost ) VALUES ( '$avtor', '$datum', '$besedilo', '$vrednost' )";
mysql_query( $query, $link );
$query2 = "INSERT INTO razpored (zadnji, vrednost) VALUES ('$datum', '$vrednost')";
mysql_query( $query2, $link );
mysql_close( $link );

header("Location:forum.php");
exit;

}


Can you please tell me what's wrong? Can it be the different versions of MySQL? Thanks for help.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 10, 2005 4:54 pm 
Noobie
Noobie

Joined: Mon Oct 31, 2005 9:14 pm
Posts: 44
I'm going to guess that you aren't getting any errors because your problem is with your IF statement...

try adding...


}else{
print('this is why I am getting no errors');
}

to the end of your script and see what happens


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 10, 2005 6:35 pm 
Noobie
Noobie

Joined: Sat Dec 10, 2005 10:39 am
Posts: 3
and what's wrong with it? how do i correct it? but it works well on my home server...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 11, 2005 1:01 am 
Noobie
Noobie

Joined: Mon Oct 31, 2005 9:14 pm
Posts: 44
I can't see enough of your code to see exactly whats wrong but I'm going to have to say that if indeed it is a problem with the IF statement then your not sending any POST variables to the script or your POST variables are empty...

My guess would be that you have a URL mixed up with a URI... most likely it something else but I can't figure it out with what you've provided.

try adding this line to the top of your script just to test it out...

$_POST['naslov']='testing';
$_POST['avtor']='testing';
$_POST['besedilo']='testing';

are you sure your not getting any error messages?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 3:54 pm 
Noobie
Noobie

Joined: Sat Dec 10, 2005 10:39 am
Posts: 3
thanks a lot, this was the problem!
Thanks a lot again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ]  Moderators: fhmagic, KJ, Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
100WebSpace © 2011