Parse error: parse error in.....

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Ross1987
New php-forum User
New php-forum User
Posts: 3
Joined: Sat May 24, 2003 11:30 am
Contact:

Parse error: parse error in.....

Postby Ross1987 » Sat May 24, 2003 6:32 pm

Parse error: parse error in /users/coolfreepage.com/rossewing87/admin.php on line 18

It keeps saying that, so i go to line 18

function create_first($name, $url, $email, $pwd, $user_new) {

wot do i need to change?

Ross

jnuneznyc
New php-forum User
New php-forum User
Posts: 3
Joined: Sat May 24, 2003 9:38 pm

Postby jnuneznyc » Sat May 24, 2003 10:01 pm

Just a hunch but check the line above this one. It's usually and missing ; or }

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Sun May 25, 2003 1:55 am

if you post the first 20 lines or so It might let us know a lil more info

Ross1987
New php-forum User
New php-forum User
Posts: 3
Joined: Sat May 24, 2003 11:30 am
Contact:

Postby Ross1987 » Sun May 25, 2003 5:05 am

require_once("mainfile.php");
get_lang(admin);

function create_first($name, $url, $email, $pwd, $user_new) {
global $prefix, $db, $user_prefix;
$first = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_authors"));
if ($first == 0) {
$pwd = md5($pwd);
$the_adm = "God";
$sql = "INSERT INTO ".$prefix."_authors VALUES ('$name', '$the_adm', '$url', '$email', '$pwd', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '')";
$db->sql_query($sql);
if ($user_new == 1) {
$user_regdate = date("M d, Y");
$user_avatar = "blank.gif";
$commentlimit = 4096;
if ($url == "http://") { $url = ""; }
$sql = "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_website, user_avatar, user_regdate, user_password, theme, commentmax, user_lang, user_dateformat) VALUES (NULL,'$name','$email','$url','$user_avatar','$user_regdate','$pwd','$Default_Theme','$commentlimit','english','D M d, Y g:i a')";
$db->sql_query($sql);
}
login();
}
}

$the_first = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_authors"));
if ($the_first == 0) {
if (!$name) {
include("header.php");
title("$sitename: "._ADMINISTRATION."");
OpenTable();
echo "<center><b>"._NOADMINYET."</b></center><br><br>"
."<form action=\"admin.php\" method=\"post\">"
."<table border=\"0\">"
."<tr><td><b>"._NICKNAME.":</b></td><td><input type=\"text\" name=\"name\" size=\"30\" maxlength=\"25\"></td></tr>"
."<tr><td><b>"._HOMEPAGE.":</b></td><td><input type=\"text\" name=\"url\" size=\"30\" maxlength=\"255\" value=\"http://\"></td></tr>"
."<tr><td><b>"._EMAIL.":</b></td><td><input type=\"text\" name=\"email\" size=\"30\" maxlength=\"255\"></td></tr>"
."<tr><td><b>"._PASSWORD.":</b></td><td><input type=\"password\" name=\"pwd\" size=\"11\" maxlength=\"10\"></td></tr>"
."<tr><td colspan=\"2\">"._CREATEUSERDATA." <input type=\"radio\" name=\"user_new\" value=\"1\" checked>"._YES."&&<input type=\"radio\" name=\"user_new\" value=\"0\">"._NO."</td></tr>"
."<tr><td><input type=\"hidden\" name=\"fop\" value=\"create_first\">"
."<input type=\"submit\" value=\""._SUBMIT."\">"
."</td></tr></table></form>";
CloseTable();
include("footer.php");
}
switch($fop) {
case "create_first":
create_first($name, $url, $email, $pwd, $user_new);
break;
}
die();
}

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Sun May 25, 2003 6:57 am

get_lang(admin);

change to

get_lang($admin); or get_lang("admin");

whatever admin is supposed to be

Ross1987
New php-forum User
New php-forum User
Posts: 3
Joined: Sat May 24, 2003 11:30 am
Contact:

Postby Ross1987 » Sun May 25, 2003 11:13 am

Can someone who knows php nuke well get in touch with me

ross_ewing@hotmail.com

if so can u possibly give me a step by step way, because i am new to this and i cant under stand the install file provided
i would be so gratfull

Ross Ewing


Return to “PHP coding => General”

Who is online

Users browsing this forum: Strider64 and 3 guests