floridaflatlander
Members-
Posts
671 -
Joined
-
Last visited
-
Days Won
1
Everything posted by floridaflatlander
-
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
Looks like you need dounle qoutes in there, you'll have to escape them. href=\"{$row['url']}\" and scr=\"xxxx\" and alt=\"xxxx\" -
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
If I had only one pic per category I'd use something like id | cat_name | image_path | url | summary or what ever | echo '<a href="'.$row['url'].'"><img class="image1" src="'.$row['image_path'].'" alt="'.$row['cat_name/summary or any column you want'].'></a><br />'; or echo '<a href="'.$row['url'].'"><img class="image1" src="'.$row['image_path'].'" alt="'.$row['cat_name'].' - '.$row['summary or any column you want'].'></a><br />'; -
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
It lookes like you have two unique ids. You probably only need one. Is id an auto_increment? Anyway as long as they're unique you can use them. Okay we have id | property_id | image_path id | cat_name so you could do echo '<a href="xxxx.com/category.php?cat='.$row['id or property_id'].'"><img class="image1" src="'.$row['image_path'].'" alt='.$row['cat_name or any column you want'].'></a><br />'; -
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
I see you have your full path in the table so I'd used echo '<a href="xxxx.com/category.php?cat='.$row['cat_id'].'"><img class="image1" src="'.$row['image_path'].'" alt='.$row['summary'].'></a><br />'; -
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
I was assuming you have a table like cat_id | cat_name | summary | image_name | 1 | dogs | dogs are great |dogpic.jpg 2 | cat | cats are better | catpic.jpg so xxxx.com/category.php?cat='.$row['cat_id']. would become xxxx.com/category.php?cat=1 and it would be a picture of a dog and a link to the dog category. It would look more like this if I did it echo '<a href="xxxx.com/category.php?cat='.$row['cat_id'].'"><img class="image1" src="/image-folder-path/'.$row['image_name'].'" alt='.$row['summary'].'></a><br />'; and your source would end up like this <a href="xxxx.com/category.php?cat=1"><img class="image1" src="/image-folder-path/'docpic.jpg"' alt="dogs are great"></a><br /> -
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
Say you have a category table that has all your cats info including a column for the image location, we'll call it image_path. run a sql statement to display the categories image_path and cat_id while (this stuff) { echo '<a href="xxxx.com/category.php?cat='.$row['cat_id'].'"><img class="image1" src="'.$row['image_path'].' alt='.$row['summary'].'></a><br />'; } -
How to make a image a link when it is outputted using PHP?
floridaflatlander replied to usman07's topic in PHP Coding Help
You have echo "<a href="xxxx.com"><img class='image1' src='{$row['image_path']}' alt='{$row['summary']}'></a><br />"; What do you mean their own unique link -
Yet another question about salt+hashing
floridaflatlander replied to Zephni's topic in PHP Coding Help
Whats the difference? -
How can I fix this undefined variable in my code?
floridaflatlander replied to ebz451's topic in PHP Coding Help
You can try the poor mans way, $display_block = FALSE; somewhere about the var in question. I'd put it above $db_name -
Here is a very useful link http://onlinebusiness.about.com/od/searchengineoptimization/a/search-ranking.htm but when all is said and done it all boils down to content. To me all 10 of these factors hinges on content one way or another. You don't need different names web site names, just the content that people are looking for, also as a note people say key words but many times they're talking about key phrases. Have them on your page, the higher up the better, Like tab title and an h1 title on the page that says Dallas Air Conditioning Service. When someone searches for Dallas Air Conditioning Service, they'll see your page title like the one on the tab at the top here and they'll click it and it will go to your site. Also get people that you do business with to link to your site using "Dallas Air Conditioning Service" not your company name.
-
Yet another question about salt+hashing
floridaflatlander replied to Zephni's topic in PHP Coding Help
I think wordpress allows you to add a general salt (the same one for everybody) on their config page. if you did this you could hash it and the password anyway you want, md5 then sha1 etc. And yes if they get your config file, the order you hash the pw & salt and your db tables you have a sh*t pot full of problems. -
This is a good link that someone on here pointed me to last year. http://pbeblog.wordpress.com/2008/02/12/secure-hashes-in-php-using-salt/ Also I read last week that sha1 in the sql statement gives a greater range of hashes than in the php.
-
want to resize font-size with php !
floridaflatlander replied to jac.kock's topic in PHP Coding Help
Put your url in here at http://validator.w3.org/ . It says you have 8 errors, 1 is no doc type and another says doc type does not allow style here. This link and firefoxes firebug are handy tools. -
can't get td height to work in firefox
floridaflatlander replied to karimali831's topic in HTML Help
I went here http://validator.w3.org/ and w3.org said you had 466 errors on that page. Of course I didn't look at them but most are probably stuff that's repeated. This is a good tool to use. -
I'd go to the phpbb forums, this should be a standard problem for people moving a forum and you should have people there that could point you in the right direction. For example, smf has a file repair_settings that walks you through many of the things you're talking about.
-
Wow, talk about a jury rig. Anyway, I borrowed/took this preg_match from stack flow. As I walk through this I get, table_column LIKE '%"Grizzly Bear"%' and I can't remove the double quotes in '%"Grizzly Bear"%' // Extract the search keywords into an array $clean_search = str_replace(',', ' ', $user_search); preg_match('"([^\\"]+)"', $clean_search, $multi_words); // added $clean_search = str_replace("$multi_words[0]", ' ', $clean_search); // I'll make this a loop later $search_words = explode(' ', $clean_search); $final_search_words = array(); if (count($search_words) > 0) { foreach ($search_words as $word) { if (!empty($word)) { $final_search_words[] = $word; } } } $final_search_words[] = $multi_words[0]; // Generate a WHERE clause using all of the search keywords $where_list = array(); if (count($final_search_words) > 0) { foreach($final_search_words as $word) { $word = trim($word); $word = str_replace('"', '', $word); // I can get this to work for an underscore but not for double quotes for some reason $where_list[] = "table_column LIKE '%$word%'"; } }
-
I am now using an underscore for a two word search (Grizzly_Bear) it seems to do a good job but I noticed the standard is double quotes “Grizzly Bear” So how to build a search for two word searches using double quotes? This is what I have so far ... $user_search = mysqli_real_escape_string($dbc, $_GET['usersearch']); $search_query = "SELECT * FROM db_table"; // Extract the search keywords into an array $clean_search = str_replace(',', ' ', $user_search); $search_words = explode(' ', $clean_search); $final_search_words = array(); if (count($search_words) > 0) { foreach ($search_words as $word) { if (!empty($word)) { $trimmed_word = trim($word); $trimmed_word = str_replace('_', ' ', $trimmed_word); $final_search_words[] = $trimmed_word; } } } // Generate a WHERE clause using all of the search keywords $where_list = array(); if (count($final_search_words) > 0) { foreach($final_search_words as $word) { $where_list[] = "table_column LIKE '%$word%'"; } } $where_clause = implode(' OR ', $where_list); // Add the keyword WHERE clause to the search query if (!empty($where_clause)) { $search_query .= " WHERE $where_clause"; // This is the final query } Thanks SJ
-
Restricting an ip adress to not vote twice
floridaflatlander replied to razorsese's topic in Application Design
You can figuratively create as many tables as you want per db. If I had to guess right of the top of my head you could probably put all the votes for all the articles in one table. To create a table for each article would be a pain. If the votes are important make user join your site before they can vote and you can then make sure(more or less) that there is only only vote per person. What I like about cookies and/or sessions is that it would be easier and almost as accurate. Average Joe's like me would have to go into the Firefox menu or IE's menu and delete their cookies to vote twice. I'm sure there are smarty pants out there somewhere that could make an automated system to delete their cookies and vote again but why would they do that for your site? -
Many are defined in places like wp-includes/general-template.php. To find out more about the locations various functions google the function name or as close to it as you can get and you'll find someone somewhere as probably ask the same same question.
-
Restricting an ip adress to not vote twice
floridaflatlander replied to razorsese's topic in Application Design
If not very, use cookies/sessions and set them to expire in the distant future. Why would someone try to skew your voting? How many times would they do it? Most people would give it a one time try and if it didn't count again forget about it. They wouldn't go through the trouble of deleting cookies to vote again. Cookies would be alot easier and I'd use that unless it is for an important pole or info. As a note and for comparison I pretty sure my coppermine photo album uses cookies. -
Restricting an ip adress to not vote twice
floridaflatlander replied to razorsese's topic in Application Design
How anal are you about the voting, if you want to make sure someone only votes once then you may need to register members but even this has flaws. As far as ip address some people's change often, my ip address(I have comcast) only changes very yr or so. You could also use cookies, it would be easier and if someone wanted to vote twice they'd have to delete their cookies and vote again. -
Someone posted this info before http://phpsec.org/projects/guide/4.html
-
What are you getting the indefined index on, user_firstname or user_priority? Both? anyway try, if (isset($_SESSION['user_priority']) && ($_SESSION['user_priority'] == '1')) { header("Location: AdminSection.php"); } else ...
-
yes and run your css through http://jigsaw.w3.org/css-validator/ also
-
I didn't look at you source but I did plug it into http://validator.w3.org/#validate_by_input and got 4 errors one being you don't have doc type