>>  Site Map >>  Forums >>  Installation 6x

Forum module - topics in forum:



Installation 6x - Discussions regarding PHP-Nuke Installation and Configuration.



[URGENT-unresolved] Registration Modification

How do i enter the newsletter fields so that when someone registers they have to chose whether to receive a newsletter or not?

I thought the code was:
."<tr><td>"._RECEIVENEWSLETTER.":</td><td>"._YES."<input type=\"radio\" name=\"newsletter\" value=\"1\">"._NO."<input type=\"radio\" name=\"newsletter\" value=\"0\"></td></tr>\n."

But this does not work, it comes up with:
Parse error: parse error in /home/colin/public_html/england/modules/Your_Account/index.php on line 522

Please help ASAP, i need this up by tonight, i go on holiday tmoro Very Happy

Cheers,
Black Hawk






It's not that simple, you need to make more changes than that.

You need to modify at least 3 functions in your account/index.php

function new_user, function confirmNewUser and function finishNewUser and you'll also need to add a field to the user_temp table to hold the additional function.






i know that, but is that above coding correct?






The above code
Code: :
."<tr><td>"._RECEIVENEWSLETTER.":</td><td>"._YES."<input type=\"radio\" name=\"newsletter\" value=\"1\">"._NO."<input type=\"radio\" name=\"newsletter\" value=\"0\"></td></tr>\n."

is not correct, the last ." should just be " (no full stop before it) so it would be
Code: :
."<tr><td>"._RECEIVENEWSLETTER.":</td><td>"._YES."<input type=\"radio\" name=\"newsletter\" value=\"1\">"._NO."<input type=\"radio\" name=\"newsletter\" value=\"0\"></td></tr>\n"







I have done exactly as you say, here is the code:

function new_user() {
global $my_headlines, $module_name, $db;
if (!is_user($user)) {
mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);
include("header.php");
OpenTable();
echo "<center><font class=\"title\"><b>"._USERREGLOGIN."</b></font></center>\n";
CloseTable();
echo "<br>\n";
OpenTable();
echo "<form action=\"modules.php?name=$module_name\" method=\"post\">\n"
."<b>"._REGNEWUSER."</b> ("._ALLREQUIRED.")<br><br>\n"
."<table cellpadding=\"0\" cellspacing=\"10\" border=\"0\">\n";
."<tr><td>"._RECEIVENEWSLETTER.":</td><td>"._YES."<input type=\"radio\" name=\"newsletter\" value=\"1\">"._NO."<input type=\"radio\" name=\"newsletter\" value=\"0\"></td></tr>\n"
."<tr><td>"._ONLINENAME.":</td><td><input type=\"text\" name=\"online_name\" size=\"30\" maxlength=\"25\"></td></tr>\n"
."<tr><td>"._USERNAME.":</td><td><input type=\"text\" name=\"username\" size=\"30\" maxlength=\"25\"></td></tr>\n"
."<tr><td>"._EMAIL.":</td><td><input type=\"text\" name=\"user_email\" size=\"30\" maxlength=\"255\"></td></tr>\n"
."<tr><td>"._PASSWORD.":</td><td><input type=\"password\" name=\"user_password\" size=\"11\" maxlength=\"40\"></td></tr>\n"
."<tr><td>"._RETYPEPASSWORD.":</td><td><input type=\"password\" name=\"user_password2\" size=\"11\" maxlength=\"40\"><br><font class=\"tiny\">("._BLANKFORAUTO.")</font></td></tr>\n";
if (extension_loaded("gd")) {
echo "<tr><td>"._SECURITYCODE.":</td><td><img src='modules.php?name=$module_name&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'></td></tr>\n"
."<tr><td>"._TYPESECCODE.":</td><td><input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\"></td></tr>\n"
."<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">\n";
}
echo "<tr><td colspan='2'>\n"
."<input type=\"hidden\" name=\"op\" value=\"new user\">\n"
."<input type=\"submit\" value=\""._NEWUSER."\">\n"
."</td></tr></table>\n"
."</form>\n"
."<br>\n"
.""._YOUWILLRECEIVE."<br><br>\n"
.""._COOKIEWARNING."<br>\n"
.""._ASREGUSER."<br>\n"
."<ul>\n";
$handle=opendir('themes');
while ($file = readdir($handle)) {
if ((!ereg("[.]",$file) AND file_exists("themes/$file/theme.php"))) {
$thmcount++;
}
}
closedir($handle);
if ($thmcount > 1) {
echo "<li>"._ASREG6."\n";
}
$sql = "SELECT custom_title FROM ".$prefix."_modules WHERE active='1' AND view='1' AND inmenu='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$custom_title = $row[custom_title];
if ($custom_title != "") {
echo "<li>"._ACCESSTO." $custom_title\n";
}
}
$sql = "SELECT title FROM ".$prefix."_blocks WHERE active='1' AND view='1'";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$b_title = $row[title];
if ($b_title != "") {
echo "<li>"._ACCESSTO." $b_title\n";
}
}
if (is_active("Journal")) {
echo "<li>"._CREATEJOURNAL."\n";
}
if ($my_headlines == 1) {
echo "<li>"._READHEADLINES."\n";
}
echo "<li>"._ASREG7."\n"
."</ul>\n"
.""._REGISTERNOW."<br>\n"
.""._WEDONTGIVE."<br><br>\n"
."<center><font class=\"content\">[ <a href=\"modules.php?name=$module_name\">"._USERLOGIN."</a> | <a href=\"modules.php?name=$module_name&amp;op=pass_lost\">"._PASSWORDLOST."</a> ]</font></center>\n";
CloseTable();
include("footer.php");
} elseif (is_user($user)) {
global $cookie;
cookiedecode($user);
userinfo($cookie[1]);
}
}


There are also other new fields, but these do work.
But i still get the following error message:

Parse error: parse error in /home/colin/public_html/england/modules/Your_Account/index.php on line 523

The line underlined is line 523






The reason you are getting this error now is because of another error.

Generally when you get a Parse error, its either on the line that they message quotes or the line above that one. It can be in other places but they are the two general places you would look, the line of the error number and the one above it.

In this case you have a ; at the end of the line above the one you have underlined. This is not required as the line below it is a continuation of the above line.

I hope I am not confusing you, what I mean is. At the end of a line of code you require a ; to tell PHP that that’s the end of the line. There are a few exceptions to this rule, one of them is when the next line starts with a . (full stop). This means it is a continuation of the pervious line and so a ; is not needed.

Here are two examples
Code: :
echo “Show this”;
echo “and this”;

This can also be wrote like this
Code: :
echo “Show this”
.”then this”;

Note that in the first example when the second line starts with a command (echo) you need the ; on the pervious line, but in the second example when there is no command only . (full stop [which is continue]) you only have the ; at the end of the second line as that is when the command (echo) stops.

So anyway to stop waffling just remove the ; from the pervious line that you have underlined in the above code and that should do it

Hope I was clear enough Very Happy
Let me know if there is any more problems






I cant beleive it was starring at me in the face!

Thankyou for the help, i will remmeber this in future...

Now do you want to know what the next problem is?
When i signup it all works fine, i open activation email and then it says:
'There is no user in the database with this information.

You can register a new user from here.'


Oh joy, another problem!

You can find the coding for the index.php page via http://www.colinstillwell.com/coding.txt

Thanks for the help everyone, but im still stuck!




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS