Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Sat Feb 12, 2005 8:18 pm Reply with quote

What is wrong with my code here. Trying to creat a login page but am constantly getting Parse error: parse error, unexpected blah..blah
time after time on this line.

echo "<form name=\"login\" method=\"post\" action=\"<?php echo $_SERVER['PHP_SELF']?>";
 
View user's profile Send private message Visit poster's website ICQ Number
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Sat Feb 12, 2005 9:20 pm Reply with quote

Try
echo "<form name=\"login\" method=\"post\" action=\"<?php echo $_SERVER[PHP_SELF];?>";

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
Donovan







PostPosted: Sat Feb 12, 2005 9:27 pm Reply with quote

Why would I also get this error on my login page. I have seen this same one on another as well.

Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/thirdadm/public_html/modules/MILPACS/login.php on line 46

Here is that part of my code



Code:
$sql="SELECT name, uniqueid FROM milpacs_members"; 

$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {

$user=$row["name"];
$id=$row["uniqueid"];
$options.="<OPTION VALUE=\"$user\">".$id;
}
 
Donovan







PostPosted: Sat Feb 12, 2005 9:33 pm Reply with quote

I put an @ in front of mysql_fetch_array so it looks like

@mysql_fetch_array

and it got rid of the error.

My login dropdown box still isn't pulling usernames from my table.
[ Only registered users can see links on this board! Get registered or login! ]
 
sixonetonoffun







PostPosted: Sun Feb 13, 2005 9:34 am Reply with quote

The @ just shuts off error reporting the error is still valid.
I haven't looked at the mod your using but it doesn't look like it uses nukes sql layer (either of them) so it must have its own. So I assume somewhere it is establishing a connection to the DataBase? None of the code you posted show that it is. Nuke would use $db or $dbi to do this.
 
Donovan







PostPosted: Sun Feb 13, 2005 11:13 am Reply with quote

It is my own mod I'm developing with a db.inc.php file I made for database connection. It is kinda like a config.php and a dbconnect.php combined.

In each of my pages I have a include statement.

include("modules/MILPACS/db.inc.php");

...or should have.

Let me double check.
 
Donovan







PostPosted: Sun Feb 13, 2005 11:24 am Reply with quote

I think I fixed that.

The dropdown box still doesn't populate with usernames.

Code:
echo "<SELECT NAME=\"Username\" size=\"1\">"; 

echo "<OPTION SELECTED VALUE=\"\">--- Select User ---</OPTION>"; 

// create the SQL statement
 $user = "SELECT name, uniqeid FROM milpacs_members";
 if (!$user) {
    exit("<p>Unable to obtain usernames from database.</p>");
 }
while ($user = mysql_fetch_array($user))
{
$uid = $user["uniqueid"];
$name = $user["name"]; 
echo "<OPTION VALUE='$uid'>$name</OPTION>";
}   
echo "</SELECT>";
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©