Web Hosting Vodahost    

Home Take The Royal Tour! Order Now Features Prices
Go Back   Web Hosting > VodaHost Web Hosting Support > mySQL & PHP

Notices

mySQL & PHP Discussions, information and help with mySQL and PHP.

Reply
 
Thread Tools
  #1  
Old 08-20-2009, 02:17 AM
Adrian29630's Avatar
Second Lieutenant
 
Join Date: Apr 2009
Location: Santo Domingo Dominican Republic
Posts: 110
Default Installing a php script to a BV page

I am trying to install a php script into a BV page which only has the template already in place but for some reason no matter which way I try it is ending up on the underlying page and therefore the form is not visible. It is there because if I strip out the template the form is visible but I am trying to place it into a page identical to the rest of the site. I have tried both putting the script onto the page in BV and opening the script in Cp
anel and installing the HTML but either method has the same result. This is the script:-



<FONT size=1><?php
/*************** PHP LOGIN SCRIPT V2.0*********************
(c) Balakrishnan 2009. All Rights Reserved
Usage: This script can be used FREE of charge for any commercial or personal projects. Enjoy!
Limitations:
- This script cannot be sold.
- This script should have copyright notice intact. Dont remove it please...
- This script may not be provided for download except from its original site.
For further usage, please contact me.
************************************************** *********/
include 'dbc.php';
 
if ($_POST['doLogin']=='Login')
{
$user_email = mysql_real_escape_string($_POST['usr_email']);
$md5pass = md5(mysql_real_escape_string($_POST['pwd']));
 
if (strpos($user_email,'@') === false) {
$user_cond = "user_name='$user_email'";
} else {
$user_cond = "user_email='$user_email'";

}
 
$sql = "SELECT `id`,`full_name`,`approved` FROM users WHERE
$user_cond
AND `pwd` = '$md5pass' AND `banned` = '0'
";

$result = mysql_query($sql) or die (mysql_error());
$num = mysql_num_rows($result);
// Match row found with more than 1 results - the user is authenticated.
if ( $num > 0 ) {

list($id,$full_name,$approved) = mysql_fetch_row($result);

if(!$approved) {
$msg = "Account not activated. Please check your email for activation code";
header("Location: login.php?msg=$msg");
exit();
}

// this sets session and logs user in

session_start();
// this sets variables in the session
$_SESSION['user_id']= $id;
$_SESSION['user_name'] = $full_name;

//set a cookie witout expiry until 60 days

if(isset($_POST['remember'])){
setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/");
setcookie("user_name", $_SESSION['user_name'], time()+60*60*24*60, "/");
}


header("Location: myaccount.php");
}
else
{
$msg = urlencode("Invalid Login. Please try again with correct user email and password. ");
header("Location: login.php?msg=$msg");
}

}


?>
<html>
<head>
<title>Members Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/jquery.validate.js"></script>
<script>
$(document).ready(function(){
$("#logForm").validate();
});
</script>
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td width="160" valign="top"><p>&nbsp;</p>
<p>&nbsp; </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></td>
<td width="732" valign="top"><p>&nbsp;</p>
<h3 class="titlehdr">Login Users
</h3>
<p>
<?
/******************** ERROR MESSAGES****************************************** *******
This code is to show error messages
************************************************** ************************/
if (isset($_GET['msg'])) {
$msg = mysql_real_escape_string($_GET['msg']);
echo "<div class=\"msg\">$msg</div>";
}
/******************************* END ********************************/
?></p>
<form action="login.php" method="post" name="logForm" id="logForm" >
<table width="65%" border="0" cellpadding="4" cellspacing="4" class="loginform">
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td width="28%">Username / Email</td>
<td width="72%"><input name="usr_email" type="text" class="required" id="txtbox" size="25"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="pwd" type="password" class="required password" id="txtbox" size="25"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input name="remember" type="checkbox" id="remember" value="1">
Remember me</div></td>
</tr>
<tr>
<td colspan="2"> <div align="center">
<p>
<input name="doLogin" type="submit" id="doLogin3" value="Login">
</p>
<p><a href="register.php">Register Free</a><font color="#FF6600">
|</font> <a href="forgot.php">Forgot Password</a> <font color="#FF6600">
|</font> <a href="activate.php">Activate Account</a></p>
<p><span style="font: normal 9px verdana">Powered by <a href="http://php-login-script.com">PHP
Login Script v2.0</a></span></p>
</div></td>
</tr>
</table>
<div align="center"></div>
<p align="center">&nbsp; </p>
</form>
<p>&nbsp;</p>

</td>
<td width="196" valign="top">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
</table>
<?php
/*

I have also tried putting it in an HTML box which partially works as the form is visible but so is a part of the coding but not all of it just:-


0 ) { list($id,$full_name,$approved) = mysql_fetch_row($result); if(!$approved) { $msg = "Account not activated. Please check your email for activation code"; header("Location: login.php?msg=$msg"); exit(); } // this sets session and logs user in session_start(); // this sets variables in the session $_SESSION['user_id']= $id; $_SESSION['user_name'] = $full_name; //set a cookie witout expiry until 60 days if(isset($_POST['remember'])){ setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/"); setcookie("user_name", $_SESSION['user_name'], time()+60*60*24*60, "/"); } header("Location: myaccount.php"); } else { $msg = urlencode("Invalid Login. Please try again with correct user email and password. "); header("Location: login.php?msg=$msg"); } } ?>





Login Users
__________________
Regards

Adrian
www.repdomproperties.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old 08-20-2009, 05:21 AM
Karen Mac's Avatar
General & Forum Moderator
 
Join Date: Apr 2006
Location: X marks the spot
Posts: 8,474
Send a message via MSN to Karen Mac
Default Re: Installing a php script to a BV page

Did you right click on the page, page properties and change it to be a php instead of html?

Karen
__________________
KMAC Enterprise
Missouri Free Classified Ads
Charming Noveltees~Sports Logos Charms

I've learned that artificial intelligence is no match for natural stupidity!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old 08-20-2009, 06:16 AM
Adrian29630's Avatar
Second Lieutenant
 
Join Date: Apr 2009
Location: Santo Domingo Dominican Republic
Posts: 110
Default Re: Installing a php script to a BV page

Hi Karen I did that right at the begining but it still shows that piece of script which as you can see is only a small part of the whole. That is what is so strange about it
__________________
Regards

Adrian
www.repdomproperties.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old 08-20-2009, 07:56 AM
Karen Mac's Avatar
General & Forum Moderator
 
Join Date: Apr 2006
Location: X marks the spot
Posts: 8,474
Send a message via MSN to Karen Mac
Default Re: Installing a php script to a BV page

link to the page please


Karen
__________________
KMAC Enterprise
Missouri Free Classified Ads
Charming Noveltees~Sports Logos Charms

I've learned that artificial intelligence is no match for natural stupidity!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old 08-20-2009, 04:47 PM
Adrian29630's Avatar
Second Lieutenant
 
Join Date: Apr 2009
Location: Santo Domingo Dominican Republic
Posts: 110
Default Re: Installing a php script to a BV page

Hi Karen
I hadn't published the page because of what appeared in the preview pane so in order to send you the link I had to publish it and when I checked the link I was going to give you lo and behold when published it is perfect!!! So it seems the script only displays itself in "preview" Weird! Anyway all seems now to be ok.

By the way this is a very good login script if you want to check it out, very clear installation instructions, easy to install, simple to amend if needed etc and it is free! The link is http://www.hotscripts.com/listing/ph...-script-80993/ As I know there have been many requests for forms of this nature it may well be worth adding it somewhere easy to find in BV's list of useful add-on's

Thanks for your very quick responses by the way as without them I would still have been struggling with this. Now I can move on with it.
__________________
Regards

Adrian
www.repdomproperties.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT +1. The time now is 11:29 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC7
2005-2009 VodaHost Web Hosting Your Perfect Web Host - All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203