Member Avatar for Puster

Hello,

I am starting to freak out with my php codes because it is just a mess and i get an error when i close my php tag.

This php file is going to upload an image and set a name,description, and signature from the player, but i get this error code i am talking about, and can some one help me?
I have 3page of codes, and i wonder how i can make this mess to one file with one code,
I am very greatful for the answears I get.

Codes:
http://pastebin.no/324b
http://pastebin.no/324c
http://pastebin.no/324d

In the last link from row 50-79 is the upload image script, how can I merge that to one code with the other links?

Best Regards
Puster

Recommended Answers

All 7 Replies

The file in the second link is broken, you're missing a closing bracket.

Member Avatar for Puster

Fatal error: Call to undefined method physic_gaming_profile::add_content() in /home/sjohaugb/public_html/www.physicgaming.com/site/admin/add_user_ok.php on line 26 after adding the braccket, if you want, you can try the file on the link

Member Avatar for Puster

Someone? Pleas

Hi there,

On http://pastebin.no/324c there was a } closing bracket missing at the end of the script, see code below.

Please remember to mark thread as solved if it works.

Regards,

Max

<?php class physic_gaming_profile { 
              var $host;        
			  var $username;        
			  var $password;        
			  var $db;       
			  
			  function add_content($p) {
				                  $title = mysql_real_escape_string($p['title']);
								  $body = mysql_real_escape_string($p['body']);                
								  $signature = mysql_real_escape_string($p['signature']);                               
								  if(!$title || !$body ):                                               
								  if(!$title):                                
								  echo "<p>The user needs a name!</p>";
								  endif;  
								                        
								  if(!$body):                                
								  echo "<p>It needs content in the body!</p>";                                
								  endif;                                                               
								  echo '<p><a href="add-user.php">Prøv Igjen!:)</a></p>';                        
								  else:                                 
								  $sql = "INSERT INTO cms_profile VALUES ('$title', '$body', '$signature')";                                 
								  $res = mysql_query($sql) or die(mysql_error());                                 
								  echo "User is saved";                        
								  endif;                
			   }
}
?>
Member Avatar for Puster

Hi, got new error... Column count doesn't match value count at row 1

Your insert inserts three columns, and you probably have more in your table. You need to specify the three you want to fill before VALUES.

Member Avatar for Puster

hi when i am adding its now i am getting error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''User 1', 'hahahaha ', '2Hard2Kill')' at line 1"
But, it is possible that i make a owv title for the pictures and one table for the users? And get the id's to be synced?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.