floridaflatlander
Members-
Posts
671 -
Joined
-
Last visited
-
Days Won
1
Everything posted by floridaflatlander
-
Are all your sessions in the $_SESSION array so this works $_SESSION = array(); ? What session is left?
-
$home can change and alllows for an absolute path change
-
Yeah, I don't do I like that so you're going to have to play with it. Try echo "<p>".htmlspecialchars($radio_info['now_playing']['artist'] . ' - ' . $radio_info['now_playing']['track'])."</p>"; echo "<p>".htmlspecialchars($radio_info['listeners'])."</p>";
-
Well the above should work, about a year ago I had my redirect as header("Location: ../member/index.php"); // or what ever exit(); and was told by the powers here to have a absolute paths in my redirects so I changed it to "$home/member/index.php" And $home depending on if I was on my computer or online.
-
Hey I just saw your echo, why the echo if you want to redirect?
-
Try echo "<p>htmlspecialchars($radio_info['now_playing']['artist'] . ' - ' . $radio_info['now_playing']['track'])</p>"; echo "<p>htmlspecialchars($radio_info['listeners'])</p>";
-
what does the echo print/return?
-
Just like you'd create for any other html output.
-
Just for a heads up I was suggesting to register on sreach engines to let them know you're there quicker not for SEO.
-
I wouldn't think so in the long run, use googles web master tools to register your web site. Then register on other search engines. http://www.wordsinarow.com/search-engines.html Do you want english or spanish speaking people at your site?
-
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
Yeah if signed in display the thank you, if not display the form. -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
use an if() condition -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
php processes from top to bottom. I'd do something like this but it probably has some errors <?php require_once('_coreFunctions.php'); // this is where DB functions are e.g. connection etc require_once('_signInFunctions.php'); $displayForm = true; $error = ""; $username = ""; if(isset($_POST['signInSubmit'])) { $username = mysqli_real_escape_string(cf_dbConnect(), $_POST['username']); $password = mysqli_real_escape_string(cf_dbConnect(), $_POST['password']); $query = mysqli_query(cf_dbConnect(), "call sp_checkLoginDetails('{$username}', '{$password}')"); if(mysqli_num_rows($query) == 1) { $_SESSION['isLoggedIn'] = true; while($row = mysqli_fetch_object($query)) { $_SESSION['firstName'] = $row->firstName; } mysqli_query(cf_dbConnect(), "call sp_updateLoginDateTime('{$_SESSION['firstName']}')"); header("Location: ."); // this is my redirect part } else { $error = "<div id=\"formMessages\">Username or Password is incorrect. Please try again.</div>"; if($username == "username...") { $username = ""; } } } require_once('header.php'); // this has HTML inside of it e.g. head tag etc ?> <div id="contentBoxWrapper"> <div id="contentBoxTop"> <div id="contentBoxTopInner"><a href="/" class="firstLink">Home</a> <span class="breadcrumbDivider">></span> Sign In<hr /></div> </div> <div id="contentBoxContent"> <div id="signInFormWrapper"> <h1>Sign In</h1> <?php if (isset($error)) {echo $error;} ?> <form name=\"signInForm\" id=\"signInForm\" method=\"post\" action=\"\"> <label for=\"username\">Username:</label><br /> <input type=\"text\" name=\"username\" id=\"signInFormUsername\" class=\"formField\" value=\"{$username}\" /><br /><br /> <label for=\"password\">Password:</label><br /> <input type=\"password\" name=\"password\" id=\"signInFormPassword\" class=\"formField\" /><br /><br /> <input type=\"submit\" id=\"signInSubmit\" name=\"signInSubmit\" value=\"Login\" /> </form> <br /> <a href="resetpassword">Forgotten password?</a> </div> </div> <div id="contentBoxBottom"></div> </div> <?php require_once('footer.php'); ?> -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
What do you have now? PS. You haven't played with it much, I made my last post 55+- minutes ago. -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
and Keep playing if you have, if you haven't just play with it, it's really simple if you put the register & login on two pages. Once you see whats happening you can combine them. -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
yes does because you're calling the header on the register form. I don't think you know enough to make that statement. Like I said ... -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
You have your register and login on the same page. I'd take everything out of the function until you get more experience. Also I'd put the register on one page and login in on another page. -
And always have a backup.
-
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
To me it looks like you're still trying to redirect after you've called your header at require_once('header.php'); & You're calling require_once('_coreFunctions.php'); outside the sif_loginForm function? -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
Is this someone else's code? Play with it some, $displayForm = true; $error = ""; $username = ""; if(isset($_POST['signInSubmit'])) { $username = mysqli_real_escape_string(cf_dbConnect(), $_POST['username']); $password = mysqli_real_escape_string(cf_dbConnect(), $_POST['password']); $query = mysqli_query(cf_dbConnect(), "call sp_checkLoginDetails('{$username}', '{$password}')"); if(mysqli_num_rows($query) == 1) { $_SESSION['isLoggedIn'] = true; while($row = mysqli_fetch_object($query)) { $_SESSION['firstName'] = $row->firstName; } mysqli_query(cf_dbConnect(), "call sp_updateLoginDateTime('{$_SESSION['firstName']}')"); header("Location: ."); // this is the point where the headers are already sent I know why this happens, need an alternative way } else { $error = "<div id=\"formMessages\">Username or Password is incorrect. Please try again.</div>"; } } if($displayForm) { require_once('header.php'); echo " <form name=\"signInForm\" id=\"signInForm\" method=\"post\" action=\"\"> <label for=\"username\">Username:</label><br /> <input type=\"text\" name=\"username\" id=\"signInFormUsername\" class=\"formField\" value=\"{$username}\" /><br /><br /> <label for=\"password\">Password:</label><br /> <input type=\"password\" name=\"password\" id=\"signInFormPassword\" class=\"formField\" /><br /><br /> <input type=\"submit\" id=\"signInSubmit\" name=\"signInSubmit\" value=\"Login\" /> </form> <br /> {$error} "; } -
Redirect to different page after successful login
floridaflatlander replied to mds1256's topic in PHP Coding Help
Do you have any white space in the html before you call the function? Have you already sent the header like ... include('header.php'); before the function loginForm. -
Thanks for the reply My project is deployed on a linex server Once again I want my string to look like this <p>String is here</p>. And this is how I get it ... echo '<p>'.str_replace("\r\n", "</p>\n<p>", $descrip).'</p>'; So can I use "\r\n" just as will as "\n" and it not come back and bite me (put everything in one big paragraph)?