PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 10th, 2006, 10:58 PM
PinWheel2001 PinWheel2001 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 3 PinWheel2001 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 35 m 30 sec
Reputation Power: 0
Red face <?php echo $loginFormAction; ?> ERROR

Problem/Error message
(name of broser) can't find the file at /Applications/MAMP/htdocs/(name of directory)/blg/admin/<?php echo $loginFormAction; ?>.

I am going to go absolutly mad if I can't figure this out. I am redoing an old blog I created like 3 yrs ago and redoing all the settings for my new mac, since I had previously created it on a PC. I just cannot figure why it is trying to open a page for an action....maybe I am a little tired since I havent let my comp in 13 hours, but I can't get it. If ANYONE could please give me some insight I would greatly appreciate it.

For reference, I am a graphic designer and I do understand Php, perl, actionscripting 2.0 etc, at least moderately and a little java. However I must be insain to not be able to figure this out. And I know it must be soooo simple. I have googled my eye balls out for this error and its correlation to my situation. As if I could make this entry anylonger I am going to include my code........
PHP Code:
<?php require_once('../Connections/connBlog.php'); ?>
<?php
//initialize the session
session_start();
// ** Logout the current user. **
$logoutAction $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset(
$_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  
$logoutAction .="&"htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  
//to fully log out a visitor we need to clear the session varialbles
  
session_unregister('MM_Username');
  
session_unregister('MM_UserGroup');
    
  
$logoutGoTo "/admin/logout.php";
  if (
$logoutGoTo) {
    
header("Location: $logoutGoTo");
    exit;
  }
}
?>
PHP Code:
<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction $_SERVER['PHP_SELF'];
if (isset(
$accesscheck)) {
  
$GLOBALS['PrevUrl'] = $accesscheck;
  
session_register('PrevUrl');
}

if (isset(
$_POST['username'])) {
  
$loginUsername=$_POST['username'];
  
$password=$_POST['password'];
  
$MM_fldUserAuthorization "level_usr";
  
$MM_redirectLoginSuccess "index.php";
  
$MM_redirectLoginFailed "login.php";
  
$MM_redirecttoReferrer true;
  
mysql_select_db($database_connBlog$connBlog);
      
  
$LoginRS__query=sprintf("SELECT username_usr, password_usr, level_usr FROM blg_user_usr WHERE username_usr='%s' AND password_usr='%s'",
  
get_magic_quotes_gpc() ? $loginUsername addslashes($loginUsername), get_magic_quotes_gpc() ? $password addslashes($password)); 
   
  
$LoginRS mysql_query($LoginRS__query$connBlog) or die(mysql_error());
  
$loginFoundUser mysql_num_rows($LoginRS);
  if (
$loginFoundUser) {
    
    
$loginStrGroup  mysql_result($LoginRS,0,'level_usr');
    
    
//declare two session variables and assign them
    
$GLOBALS['MM_Username'] = $loginUsername;
    
$GLOBALS['MM_UserGroup'] = $loginStrGroup;          

    
//register the session variables
    
session_register("MM_Username");
    
session_register("MM_UserGroup");

    if (isset(
$_SESSION['PrevUrl']) && true) {
      
$MM_redirectLoginSuccess $_SESSION['PrevUrl'];    
    }
    
header("Location: " $MM_redirectLoginSuccess );
  }
  else {
    
header("Location: "$MM_redirectLoginFailed );
  }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Blog: Login</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_valida  teForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
<link href="../Templates/blog.css" rel="stylesheet" type="text/css">
</head>

<body>
<form action="<?php echo $loginFormAction?>" method="POST" name="adminlogin" id="adminlogin">
  <table width="30%"  border="0" cellpadding="0" cellspacing="0" class="topic">
    <caption align="top" class="topheader">
  Administrator Only
    </caption>
    <tr>
      <td>Username</td>
      <td><input name="username" type="text" id="username"></td>
    </tr>
    <tr>
      <td>Password</td>
      <td><input name="password" type="password" id="password"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input name="login" type="submit" id="login" onClick="MM_validateForm('username','','R','password','','R  ');return document.MM_returnValue" value="Login"></td>
    </tr>
  </table>
</form>
</body>
</html>



Oh and I also updated the old code from dreamweaver mx 2004 to work with php5. :0) Thanks a ton...especially if you read this because it means you read practically a novel. LOL

Last edited by MadCowDzz : August 11th, 2006 at 07:34 AM. Reason: Wrapped code in [php] tags

Reply With Quote
  #2  
Old August 11th, 2006, 07:39 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
Which file gives that error?
The form one?

What does the rendered page look like for the form? Does the action render properly?
Not that it would make a difference, but you might want to use <?= $loginFormAction ?> instead of that echo... I think it looks better =)
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #3  
Old August 11th, 2006, 06:15 PM
PinWheel2001 PinWheel2001 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 3 PinWheel2001 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 35 m 30 sec
Reputation Power: 0
Red face post problem

The form doesn't work properly....I must just be loosing my mind, i dunno. LOL Do I have it written wrong? The form doesnt take the input and check to see if it is valid if I remove the <?= $loginFormAction ?> of course. But if I leave it, it tries to find a page called <?= $loginFormAction ?> and doesnt redirect to the index.php admin section(posting page). Am i crazy? I dunno. When I try to log out it also looks for the <?php echo $logoutAction ?> page . I switched from DW 2004mx to 8 and I think I messed up my code. The actual action <?= $loginFormAction ?> is not being registered as an action and is being read as a page. I know it is "supposed" to call the function/action to validate/check the information entered in the username and password fields. Please help if at all posible. Thanks so much. :0)

This is the portion of the code I am having the "issue" with. lol ;o)

<form action="<?= $loginFormAction ?>" method="post" name="adminlogin" id="adminlogin">
<table width="30%" border="0" cellpadding="0" cellspacing="0" class="topic">
<caption align="top" class="topheader">
Administrator Only
</caption>
<tr>
<td>Username</td>
<td><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" id="password"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><input name="login" type="submit" id="login" onClick="MM_validateForm('username','','R','password','','R ');return document.MM_returnValue" value="Login"></td>
</tr>
</table>
</form>
<a href="<?php echo $logoutAction ?>">Log out</a>
</body>
</html>

Reply With Quote
  #4  
Old August 12th, 2006, 06:19 PM
PinWheel2001 PinWheel2001 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 3 PinWheel2001 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 35 m 30 sec
Reputation Power: 0
Exclamation checked Globals

I checked my globals and they are on as well. I have no idea why this won't work. Can anyone help me? I am so frustrated. Thanks :0)

Reply With Quote
  #5  
Old August 13th, 2006, 02:38 AM
monkey56657 monkey56657 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 78 monkey56657 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 38 m 21 sec
Reputation Power: 13
I know nothing bout php functions. I perhaps wud know how to code a code but is longer....

Only use me as a last resort. Im over stresed as is lol

Anyway. email me @ techsupport@3doms.com if no one solves this.

Peace.

Reply With Quote
  #6  
Old August 14th, 2006, 08:10 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
PinWheel2001, what does the HTML code look like after it has been rendered on the server?

Are the variables being replaced properly?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > <?php echo $loginFormAction; ?> ERROR


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap