Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check my syntax please!

Status
Not open for further replies.

MrKovacic

IS-IT--Management
Nov 5, 2002
213
US
Hello!

I am trying to bind 2 systems, Mambo and XMB Forums.

Below, I am trying to make a chunk of code to put after the registration to mambo (content management website (website-in-a-box)) thats sole dudy is to place new registration data into the XMB (message-forum-in-a-box) tables to create a new user. When I run it, I get a blank screen.

Here is the code...


Code:
If ($option = 'com_egistration' ){
	echo 'Creating Forum Membership..<br>';
	include_once ('header.php');
	echo 'Setting variables..<br>';
	$vUsername = $username ; 
	$vPassword = $password ;
	$myDate = $db->time(time());   
	$vEmail = $email ;
	echo 'connection to database..<br>';
	$db->connect($dbhost, $dbuser, $dbpw, $dbname, $pconnect, true);
	echo 'Writing membership data..<br>';
	$db->query("INSERT INTO ".$tablepre."members (username, password, regdate, email, status, showemail, theme, langfile, timeformat, dateformat, mood, pwdate, tpp, ppp, saveogu2u, emailonu2u, useoldu2u) VALUES ('$vUsername', '$vPassword', $myDate, '$vEmail', 'Member', 'no', '0', 'English', 24, 'dd-mm-yyyy', '', $myDate, 30, 30, 'yes', 'no', 'no');");
	echo 'DONE!';
	exit();
	}

Here is the website I am testing at...

Muzaicsound.com/server

anyone that has ideas.. any help is WAY appreciated!!!

Thanks in advance!!!

Thank you!!!

Mike Kovacic

&quot;&quot;&quot; &quot;&quot;&quot;
(o) (O)
\____/
 
Nothing is technically wrong with your syntax. Just one thing to note is that your 'if' statement will always evaluate to true because you have only one equal sign. Also do you have error_reporting set to E_ALL, and display_errors set to 1, these can be found in the php.ini file and set there if you are working on a development machine. If you are working on a machine that has live code running on it, then you can set these values just for the scripts your developing, by using the function ini_set(), in you scripts.
 
I suspect, also, that the comparison test for $option might need to be "com_registration" rather than "com_egistration"

the comparison, as Itshim points out, should be
Code:
if ($option === "com_registration"):
//do stuff
endif;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top