Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
why is this code not working
Old 08-18-2010, 03:17 AM why is this code not working
Novice Talker

Posts: 14
Name: Ali Arif
Trades: 0
PHP Code:
// db properties
define('DBHOST','host');
define('DBUSER','user');
define('DBPASS','pass');
define('DBNAME','name');

// make a connection to mysql here
$conn mysql_connect (DBHOSTDBUSERDBPASS);
$conn mysql_select_db (DBNAME);
if(!
$conn){
    die( 
"Sorry! There seems to be a problem connecting to our database.");
}
$sql mysql_query("SELECT Username, Email FROM sitelok WHERE email='".$_SESSION['ses_slemail']."' AND Username='".$_SESSION["ses_slusername"]."' ")or die(mysql_error());
$n mysql_num_rows($sql);
if(
$n == 1){} else {
linklokShowMessage($ErrorTemplate,"The email address provided does not match the one we have on file.<BR><BR>Click your browsers BACK button and try again.");
exit;



what im trying to do is check if an entered email matches with the email of the logged in user...
luvrockz is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-18-2010, 05:32 AM Re: why is this code not working
Super Talker

Posts: 139
Name: John Davis
Trades: 0
Are you sure $_SESSION['ses_slemail'] variable is present?
I don't see you have started the session.
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Old 08-18-2010, 06:29 AM Re: why is this code not working
Novice Talker

Posts: 14
Name: Ali Arif
Trades: 0
my full code is a very long code... i have a session start at the beginning of the code... and also the ses_slemail is present... what shud i do..???


if u want to see the full code here it is http://pastie.org/1099637
luvrockz is offline
Reply With Quote
View Public Profile
 
Old 08-18-2010, 08:12 AM Re: why is this code not working
Super Talker

Posts: 139
Name: John Davis
Trades: 0
Let start from beginning.
Tell us please, what is your expectation, I mean how you expect your code should work? And what messages you've received at the end.
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Old 08-18-2010, 09:06 AM Re: why is this code not working
phpdasan's Avatar
Experienced Talker

Posts: 37
Name: Karthick B
Trades: 0
just make sure its executing the if like

PHP Code:
if($n == 1){
echo 
'Hello World';
// you code

if it does, then the problem would be in your mail sending code.

From where you are trying run the code, ie from your local or server,

if from local, then have you configured the SMTP host and port properly?

if from server, then check the mail sending functionality by a test page and see whether the mails are sent from your server..
__________________
There is no secret ingredient.
phpdasan is offline
Reply With Quote
View Public Profile
 
Old 08-20-2010, 10:43 PM Re: why is this code not working
Skilled Talker

Posts: 76
Name: Nick Cousins
Location: Northern Ireland
Trades: 0
Just to point out -check case sensitivity of fields in MySQL - in your query you refer to selecting the field "Email" - where the field "email" = something... is that intentional?
__________________
Join
Please login or register to view this content. Registration is FREE


Knowledge is power. Never underestimate the power of stupid people in large numbers.

HandCoder is offline
Reply With Quote
View Public Profile Visit HandCoder's homepage!
 
Old 08-22-2010, 02:19 PM Re: why is this code not working
Novice Talker

Posts: 14
Name: Ali Arif
Trades: 0
not it juxt emails the link to any email i enter.. instead i want it to check if the entered email matches with the logged in users email....

and case sensitivity of the SQL fields are ok... i check it.. and if also if its wrong it gives an error....

pls help
luvrockz is offline
Reply With Quote
View Public Profile
 
Old 08-22-2010, 03:33 PM Re: why is this code not working
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
What is the error your getting?

Check your http error.log.
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 08-23-2010, 06:03 AM Re: why is this code not working
Novice Talker

Posts: 14
Name: Ali Arif
Trades: 0
its not that im getting an error ... it jux dnt work the way i want it to...
i want it to check if the entered email matches with the email of the logged in user.... but it doesnt...
luvrockz is offline
Reply With Quote
View Public Profile
 
Old 08-23-2010, 06:48 AM Re: why is this code not working
Ultra Talker

Posts: 310
Trades: 0
Quote:
Originally Posted by luvrockz View Post
my full code is a very long code... i have a session start at the beginning of the code... and also the ses_slemail is present... what shud i do..???


if u want to see the full code here it is http://pastie.org/1099637
I can find the the session_start function call at the beginning, but I can't find the initialization of $_SESSION['ses_slemail'] anywhere in the code? To verify the user input email you must have initialized $_SESSION['ses_slemail'] with one of the elements of $_GET or $_POST or $_REQUEST, where is that line of code?
dman_2007 is offline
Reply With Quote
View Public Profile
 
Old 08-23-2010, 07:27 AM Re: why is this code not working
Novice Talker

Posts: 14
Name: Ali Arif
Trades: 0
i dnt understand what you mean... can u explain me a lil bit as i am new to php.... ses_slemail i think is the session email on the user management system....

for example if i want to display the email of the logged in user ...i use this code..

PHP Code:
<?php
require_once("sitelokpw.php");
 echo 
$slemail

?>


what do u think is the probem..
and how can i solve this?
luvrockz is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to why is this code not working
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.94369 seconds with 12 queries