Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Getting a server internal error when submiting a form
Old 12-29-2010, 07:13 AM Getting a server internal error when submiting a form
Junior Talker

Posts: 3
Name: Saleh Zamzam
Trades: 0
Hi

I am getting a server error when submit a forum, you can see the error in the attachments.

some times, there is no error and every thing is ok ans some times I got this error.

What is the proplem?

Thanks in advance.

EDIT: error image
http://www.mediafire.com/imageview.p...ckw8srcg8u4xc6

Last edited by salhzmzm; 12-29-2010 at 07:16 AM..
salhzmzm is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-29-2010, 07:21 AM Re: Getting a server internal error when submiting a form
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Post your code and check your error log.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 12-29-2010, 07:30 AM Re: Getting a server internal error when submiting a form
Junior Talker

Posts: 3
Name: Saleh Zamzam
Trades: 0
My code:

PHP Code:
 
 
function mysql_prep$value ) {
  
$new_enough_php function_exists"mysql_real_escape_string" );
  if( 
$new_enough_php ) { 
 
   
$value mysql_real_escape_string$value );
  } else { 
    
$value addslashes$value );
  }
  return 
$value;
 }
 
 if (isset(
$_POST['sub']) && isset($_POST['hid']) == 1) {
 
   
$news_tittle trim(mysql_prep($_POST['news_title']));
 
$news_tittle_en trim(mysql_prep($_POST['news_tittle_en']));
 
$writer trim(mysql_prep($_POST['writer']));
 
$writer_en trim(mysql_prep($_POST['writer_en']));
 
$news_date mysql_prep($_POST['news_date']);
 
$news_content mysql_prep($_POST['news_content']);
 
$news_content_en mysql_prep($_POST['news_content_en']);
 
$news_part trim(mysql_prep($_POST['news_part']));
 
$news_part_en trim(mysql_prep($_POST['news_part_en']));
 
$position mysql_prep($_POST['position'] +1);
 
$news_active $_POST['news_a'];
 
$bar $_POST['bar'];
 
$p1 $_POST['position'];
 
$ni "";
 
$nf "";
 if (
basename($_FILES['news_image']['name']) == "") {
 
  
$ni "";
  } else {
 
   
$ni basename($_FILES['news_image']['name']);
   }
 
 
 if (
basename($_FILES['news_file']['name']) == "") {
 
  
$nf "";
  } else {
 
   
$nf basename($_FILES['news_file']['name']);
 }
 
$query "INSERT INTO news (
    news_tittle, news_tittle_en, news_writer, news_writer_en, news_date, news_part, news_part_en, news_image, news_file, news_content, news_content_en, news_clicks, news_clicks_en, news_active, news_type, news_bar, position
   ) VALUES (
    '
{$news_tittle}', '{$news_tittle_en}', '{$writer}', '{$writer_en}', '{$news_date}', '{$news_part}', '{$news_part_en}', '{$ni}', '{$nf}', '{$news_content}', '{$news_content_en}', 0, 0, {$news_active}, 1, {$bar}{$position}
   )"
;
 
 
update_position($p1"news"1);
 
$result mysql_query($query$connection);
 
 if (
$ni != "") {
  
$path "../photos/$ni";
  if (
move_uploaded_file($_FILES['news_image']['tmp_name'], $path)) {
 
 
   } else {
    echo 
output_message(0"error");
 
    }
 
  }
 
  
///////////////
 
  
$path2 "../uploads/$nf";
  if (
$nf != "") {
  if (
move_uploaded_file($_FILES['news_file']['tmp_name'], $path2)) {
 
 
   } else {
    echo 
output_message(0"error in file");
 
    }
 
  }
 
 
 if (
$result) {
  
$i output_message(1"ok");
  echo (
"$i<br><font color=\"red\">[ </font><a href=\"edit_news.php\"><b>edit news</b></a><font color=\"red\"> ]</font>&nbsp;&nbsp;&nbsp;&nbsp;<font color=\"red\">[ </font><a href=\"add_news.php\"><b>add news</b></a><font color=\"red\"> ]</font>"); 
 } else {
  echo 
output_message(0"error");
  echo 
"<p>" mysql_error() . "</p>";
 }
 
 
 
  } 

I don't know where I can find my error log, can you help me?

Thanks in advance.
salhzmzm is offline
Reply With Quote
View Public Profile
 
Old 12-30-2010, 02:42 AM Re: Getting a server internal error when submiting a form
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Ask your system administrator for the error log info.Try to approach the problem systematically. If it's an intermittent problem then something about the data is causing it. Vary your form inputs and see where the problem lies.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 12-31-2010, 04:00 AM Re: Getting a server internal error when submiting a form
Novice Talker

Posts: 5
Trades: 0
Does it happen for all php files? Or is it only for the form submission..?
leo73 is offline
Reply With Quote
View Public Profile
 
Old 12-31-2010, 07:54 AM Re: Getting a server internal error when submiting a form
Junior Talker

Posts: 3
Name: Saleh Zamzam
Trades: 0
Quote:
Originally Posted by leo73 View Post
Does it happen for all php files? Or is it only for the form submission..?
only when I submit the form, and sometimes it submit successfully with no proplems
salhzmzm is offline
Reply With Quote
View Public Profile
 
Old 12-31-2010, 09:20 AM Re: Getting a server internal error when submiting a form
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
If your running linux, Your error log will be:

/var/log/httpd/error.log

On windows, search for error.log and it will be one of them
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 12-31-2010, 06:18 PM Re: Getting a server internal error when submiting a form
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
This is unrelated, but a quick effientcy practice:

Change line:
$new_enough_php = function_exists( "mysql_real_escape_string" );

and add static in front of it
static $new_enough_php = function_exists( "mysql_real_escape_string" );
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Getting a server internal error when submiting a form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.71444 seconds with 12 queries