Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by floridaflatlander

  1. Play with it some,

     

    and

     

    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.

     

    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.

  2. 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.

  3. 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}
    	";
    }
    

  4. 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)?

     

  5. 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.

     

     

     

  6. 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)?

  7. 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??

     

  8. 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.

  9. 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.

  10. 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.

  11. 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

  12. 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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.