Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by floridaflatlander

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

     

     

     

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

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

     

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

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

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

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

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

  9. I set a session with the captcha value sha1 'pass_phrase' then

     

     

    // $_POST user_phrase from captcha

    if (isset($_POST['image'])) {

    $user_pass_phrase = sha1($_POST['image']);

    }

     

    then

     

    if ($_SESSION['pass_phrase']  == $user_pass_phrase)

  10. So you didn't get an error message?

     

    I thought mysqli_query() expects 2 parameters, you have one

     

    Try

     

    $result=mysql_query($dbc, $sql) or die("Error: ".mysqli_error($dbc));

     

    where $dbc =  mysql_connect("$host", "$username", "$password")or die("cannot connect");

×
×
  • 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.