Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 21st, 2012, 02:50 AM
Authorized User
Points: 64, Level: 1
Points: 64, Level: 1 Points: 64, Level: 1 Points: 64, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default call to undefined function

call to undefined function cmpfx().. what does that mean?

if (isset($_SESSION["admin"])) redirect("home.php");

if (!empty($_POST)) {
//$rs = getconfigvar("admin_username,admin_password");
$sql="select * from user_master where 'user_name'='admin'";
// $sql="select * from user_master where active=1 and user_type in (1,2) and user_name='".pdbfx("username")."'";
$cmd = mysql_query($sql);
$rs = mysql_fetch_array($cmd);
/*echo $rs["password"]."-".pdbfx("password");
echo cmpfx($rs["password"], pdbfx("password"));
echo $sql;
die;*/
if (cmpfx($rs["user_name"], $_POST["username"]) && cmpfx($rs["password"], md5($_POST["password"]))) {
$_SESSION["admin"] = $_POST["username"];
$_SESSION["user_type"] =$rs["user_type"];
$_SESSION["user_id"] =$rs["user_id"];

redirect("home.php");
}
else {
setErr("<div class='response-msg error ui-corner-all'> <span>Invalid Username or Password </span></div>");
redirect("index.php");
}
}

Last edited by internetpirate11; November 21st, 2012 at 03:12 AM.
Reply With Quote
  #2 (permalink)  
Old November 21st, 2012, 11:46 AM
Friend of Wrox
Points: 651, Level: 9
Points: 651, Level: 9 Points: 651, Level: 9 Points: 651, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Location: North East UK
Posts: 125
Thanks: 0
Thanked 24 Times in 24 Posts
Default

Greetings,

It means that on this line;
Code:
if (cmpfx($rs["user_name"], $_POST["username"]) && cmpfx($rs["password"], md5($_POST["password"]))) {
you're calling the function 'cmpfx' which has not been defined. So you would need to define the function like so;
Code:
function cmpfx($var, $var)
{
// function code in here
}
You'd replace the '// function code in here' with code to work on the 2 passed values and then return a result.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal error: Call to undefined function mysql_real_ascape_string() aery BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 March 9th, 2012 09:20 AM
Fatal error: Call to undefined function mysql_real_ascape_string() aery BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 0 March 8th, 2012 09:07 AM
Fatal error: Call to undefined function mysql_pcon surendran Beginning PHP 2 May 23rd, 2006 10:41 PM
Call to undefined function mysql_connect() tks_muthu PHP Databases 2 June 14th, 2005 01:23 AM
error Call to undefined function: query() gmanon Wrox Book Feedback 1 November 20th, 2003 05:34 PM



All times are GMT -4. The time now is 02:16 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.