Everything posted by Mihai Georgescu
-
hide your code
I can see the source from IE7 also
-
OMG
Who cares when you have a PR8 and the customers keep coming, right ?
-
AJAX thingy
You could try: - not putting a height on the middle section; - having an iframe that loads the content (so it can be scrolled); - use overflow:hidden (hides the text) or overflow:auto (creates a scrollbar);
-
Which is best for creatring expandable menu?
Well, the idea is that Javascript should be like a bonus on top of an already working CSS menu. If the user doesn't have javascript enabled than the menu would still be usable.
-
Which is best for creatring expandable menu?
The safest method would be CSS only (everyone has CSS ) The most flexible would be javascript (+css of course) (there is a small percentage of people that might not have js enabled). A graceful degradation to CSS would be nice. The most ugly would be Flash (non SEO friendly ... well G indexes Flash but still) and of course some people might not have Flash installed. Hope that answers your question ... I'd go for JavaScript with the CSS degrade.
-
<h9> is not recognized by W3C validation?
Even thought the "legal" ( ) limit is H6 some browsers did implement H7 (can't find the link, I blogged about this about a year ago but can't find the post).
-
Help
What page are you accesing an what parameters are you passing in the URL ? If you just access view_profile.php you'll probably get that error. If you access view_profile.php?get_username=username something should happen.
-
How to fetch data
use IS NOT NULL
-
Your Perfect Website
Oh, I can picture that ... and it would pair people based on search history. What do girls search for ?
-
javascript syntax question
Here's a thread (from another forum).
-
javascript syntax question
It's a function with no name.
-
XML Site Map
You should submit your site map in Google's Webmaster Tools.
-
Forum for Software Development
Some years ago I was on devshed.
-
How to fetch data
You should always use LIMIT to limit the number of rows fetched. Example: SELECT ..... FROM ... WHERE ... ORDER BY ... LIMIT 10 LIMIT 10 will fetch only 10 rows. To get the next 10 you would have the same query but need to change that to LIMIT 10,10 (start after 10, get 10).
-
Messing with AJAX
Use the escape function.
-
creating a spider to crawl a web site
If the pages are the same (and I'm thinking in terms of HTML structure) than you could automate the process with cURL (if your pages are online) or if you have them locally you can use fopen. After that it's a matter of parsing the page, finding the information and saving it inside a database.
-
creating a spider to crawl a web site
Well, in that case ... things are (almost) easy ... let's suppose that your site has some articles (maybe texts sounds better ?) in a table articles that looks like: ID | TITLE | TEXT You can use SQL's: LIKE or MATCH. Example for LIKE: $sql = "SELECT * FROM articles WHERE title LIKE '%".$search_here."%' OR text LIKE '%".$search_here."%' "; Example for MATCH: $sql = "SELECT * FROM articles WHERE MATCH(title,text) AGAINST(' ".$search_here." ')"; For MATCH you need a FULLTEXT index. Have a look at this page ... you'll find all the info you need.
-
Interactive map
Hey Matthew ... in order to trigger the z-index (100) on the ".bubble" you have to set it absolute or relative, at the moment you have: .bubble {display: none; z-index: 100;} So what you see now it's only an illusion of the z-index, because ".bubble" actually gets the z-index 50 (from the containing div(s) ). Hope that solves your problem. .bubble {position:relative; display: none; z-index: 100;}
-
creating a spider to crawl a web site
Could you explain what exactly "keyword search for a site" means ? Is it like a Google search but only for your site ?
-
Website Ideas
I always experiment on little functions ... hmm ... here's an example: <?php // GET all links from URL that contain www;) -- First parser experiment by me function remove_html(&$item, $key) { $item=trim(strip_tags($item)); $item=strtolower($item); } function get_links($url) { $preg = "/a[\s]+[^>]*?href[\s]?=[\s\"\']+(.*?)[\"\']+.*?>" ."([^<]+|.*?)?<\/a>/"; preg_match_all(trim($preg), file_get_contents($url), $out, PREG_PATTERN_ORDER); $keys = $out[1]; $values = $out[2]; array_walk($values, 'remove_html'); return (array_unique(array_merge($keys, $values))); } function has_www(&$item) { return (stristr($item, 'www')); } $links = get_links("http://www.example.com"); $linky = array_filter($links,"has_www"); foreach ($linky as $link) { echo "$link <br>"; } ?> It gets some URLs from an address.
-
PHP While loops and MySQL arrays
I like that too ... sometimes though you shouldn't care about the engine
-
AJAX / PHP Structure
In practice I don't actually do that (the code example) although it's an interesting option. I usually have a normal link: <a id="ajax" href="http://www.example.com"> After everything is ok without AJAX, you can add AJAX ... here's the jQuery way: //clicking the link makes an ajax call that loads in this example //a simple HTML file into a div with the ajax_content id $('#ajax').click(function(){ $("#ajax_content").load("simple_html_file.html"); //this makes the link not follow the normal href return false; });
-
PHP While loops and MySQL arrays
Interesting question ... I played with it for a while (pun intended) and my conclusion is that php is using a shortcut to create something like this: $ar = array("a" => 1,"b" => 2, "c" => 3); while (list($key, $value) = each($ar)) { echo "Key: $key; Value: $value<br />\n"; }
-
Help with PHP
It could be something wrong in your css. If you look at the source in the browser it should show the real order.
-
AJAX / PHP Structure
Hi Barry and welcome to WDF. When you make an AJAX call (99% of the time) you don't need ANOTHER page, but just some piece of HTML. You can even distinguish between calls to the same php script if you add a "&call=ajax" for your ajax call. So in your php file that gets called you can have a switch on that: if ($_GET['call'] == 'ajax') { //send only a small piece of html } else { //send the whole page with the content changed } Hope that makes sense.