![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
floridaflatlander
Members-
Posts
671 -
Joined
-
Last visited
-
Days Won
1
Everything posted by floridaflatlander
-
Can I pass PHP variables content to Javascript?
floridaflatlander replied to YigalB's topic in Javascript Help
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)?
-
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??
-
How exactly is Phpmyadmin used?
floridaflatlander replied to yshua's topic in PHP Installation and Configuration
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. -
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.
-
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
-
no it isn't
-
Controlling margins in Page Setup in Firefox
floridaflatlander replied to Eiolon's topic in CSS Help
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. -
Controlling margins in Page Setup in Firefox
floridaflatlander replied to Eiolon's topic in CSS Help
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? -
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)
-
password reset not updating users table
floridaflatlander replied to 123frank's topic in PHP Coding Help
-
<!DOCTYPE html> <html lang="en"> <?php include('include/header.php'); ?> I'm assuming you have doctype info in header.php
-
sorry try $url = $_SERVER['HTTP_HOST'];
-
I think this is it $url = dirname($_SERVER['PHP_SELF']); be sure to clean it with htmlentities or strip_tags and if you're inserting into a db mysqli_real_escape_string
-
They are a blast. We were also lucky, all three of ours, they were two years apart, would sleep through the night from the start. , thank God
-
Which of these two beginner PHP books is best?
floridaflatlander replied to byron2k12's topic in Miscellaneous
Same here, I started with books that were a step above this had problems then backed up and ordered Ullman's PHP Visual QuickStart Guide. -
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");
-
Plug this in and see what it tells you, $result=mysql_query($sql) or die("Error: ".mysqli_error($dbc)); where $dbc = mysql_connect("$host", "$username", "$password")or die("cannot connect");
-
A variable starts with a dollar sign and uses letters numbers and underscores, After the $ sign it must be a letter or an underscore.