floridaflatlander
-
Posts
671 -
Joined
-
Last visited
-
Days Won
1
Posts posted by floridaflatlander
-
-
forget about the register form at the moment, it has no bearing on what I am trying to achieve.
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 ...
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.
-
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.
-
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?
-
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} "; }
-
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.
-
.... Replacing "\n" with "</p>\n<p>", which potentially could mean you maybe end up with "\r</p\n<p>", or at least so I think.
Something like that may be whats happening because I'm getting this
<p>String is here
</p>
instead of this <p>String is here</p>
perhaps I'm just being anal
-
I think, you must use windex server is better than linex
lol, I'll leave it the way it is now "str_replace("\n", "</p>\n<p>", $descrip)" before I do that.
-
Thanks for the reply
If your project is deployed on linux server, you can use only "\n".
My project is deployed on a linex server
So I changed it to
echo '<p>'.str_replace("\r\n", "</p>\n<p>", $descrip).'</p>';
and the strings look like I want it to look, like this
<p>String is here</p>
.......... can I use "\r\n" just as will as "\n" and it not come back and bite me (put everything in one big paragraph)?
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)?
-
I haven't done anything like that but I have added picture info to js. I did it just like it was html
<div id="loadarea">
</div>
while {
echo '<a href=".$variable." rel="enlargeimage" rev="targetdiv:loadarea, trigger:click" title="'.$row['pic_info'].'" >';
}
It uses a loop and loads the last eight pics and displays in loadarea.
-
I've been using
echo'<p>'.str_replace("\n", "</p>\n<p>", $descrip).'</p>';
To echo strings and I noticed the string looks likes this
<p>String is here
</p>
So I changed it to
echo '<p>'.str_replace("\r\n", "</p>\n<p>", $descrip).'</p>';
and the strings look like I want it to look, like this
<p>String is here</p>
I googled what is the difference between \r and \n and usually people start saying one is for windows one is for linex, one is old the other newer ...
My questions are, when using php what do you enter at the end of a string when you press enter?
And can I use "\r\n" just as will as "\n" and it not come back and bite me (put everything in one big paragraph)?
-
thanks, it does save time
-
I've been wrting this are the bottom of a script
header("Location: $home/index.php"); mysqli_free_result($r); mysqli_close($dbc); exit();
I was wondering can exit() remove a querys overhead and close a database connection also, meaning this is the same thing.
header("Location: $home/index.php"); exit();
php.net says exit() "Terminates execution of the script". So maybe it closes the db connection(a script) but leaves a query's overhead??
-
I sure there are others others that can give you more details but it's used to manage your mysql databases and tables.
With phpmyadmin you can add delete or edit databases and tables.
-
Okay uploaded the new csv file to my db table and the equal sign is gone.
Thanks
-
No I just down loaded a new csv file and it wasn't in it, so something must of messed up the first time I did it.
Thanks
-
Thanks for the reply
The data came from here http://federalgovernmentzipcodes.us/ the smaller file, it's a csv file and I checked they're in the csv file.
So this is an error and isn't suppose to be like this? Anyway I don't see why there would be an equal sign in the city field.
I think I can fix this easy enough, I'll be back and mark solved when done.
Thanks
-
Odd
when I use $q = "SELECT * FROM zip_codes WHERE city LIKE 'WHITEHOUSE =\r\nSTATION'"; on a php file page I made it works and returns WHITEHOUSE = STATION
when I use WHITEHOUSE =\r\nSTATION using my phpmyadmin search it returns "returned an empty result set" and ...
SELECT * FROM `zip_codes` WHERE `city` LIKE 'WHITEHOUSE =\\r\\nSTATION'
with the extra back slashes in the query.
-
I have a zip code table and the field for city names has an equal sign in them when there are two or more names like this
WHITEHOUSE =
STATION
I've used phpmyadmin to test/play with seach using LIKE ... WHITEHOUSE STATION, WHITEHOUSE =STATION, WHITEHOUSE =\nSTATION, WHITEHOUSE = STATION, and get no result.
This seems like it would mess up searches, why would they have equal signs in the city names and how would I search for something like WHITEHOUSE STATION when it's WHITEHOUSE =
STATION?
There are 8,637 records with an equal sign in the city names.
How can I search for a city with an equal sign in the name or can I REPLACE(remove) the equal sign and it's new line charactor(if that's what it is) like this?
UPDATE zip_codes set city = replace (city, ' =\n', ' ');
Any thoughts, thanks.
-
I found out my issue. I didnt know that i had to put a margin-bottom on both of my divs (comments, and todo list), i just thought that you had to put it on the div stuff...
thanks.
Then something is wrong.
If comments and the todo divs are inside the stuff div all you need to do is put a margin on the stuff div.
I strongly suggest you do as ChristianF and I suggested and use firebug, chrome or opera so you can see what is happening. Your stuff div is not floated and it contains floated divs, this means it collapses and has no height.
/*your code now*/ .stuff { no float } #todo_list { float: left; } #comments { float: right; }
all you have to do is float the stuff div too and put a margin on it.
-
If your going to do stuff like this get and use firefoxes firebug, firebug color codes the divs, margins and padding on the web page so you can see the styles, it will tell you what the css file name is, the name of the style, what line the style is coming from and the inheritance if any. I think chrome does the same thing.
But try adding a bottom margin to stuff
-
it's fixed now
no it isn't
-
Open firebug click the html the tab(you'll have html, css, script tabs etc.) then the div tags until you get to the tags in question.
Firebug well tell you where the style is coming from, what the css file name is, what line the style is coming from, the inheritance if any and the name of the style. It also color codes the style on the web page so you can see the styles.
Also plug your css in here http://jigsaw.w3.org/css-validator/ and your html in here http://validator.w3.org/ and see what they say (you should always do this). Sometimes and extra semicolon, bracket or missing closing html tag can throw things off in one browser but not another.
-
I would think that would work, do you/did you use Firefox's fire bug to see if there is something interfering with your styles?
Redirect to different page after successful login
in PHP Coding Help
Posted
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.