Jump to content

mainewoods

Members
  • Posts

    685
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling
  • Location
    Maine

mainewoods's Achievements

Newbie

Newbie (1/5)

4

Reputation

  1. google does not index any content delivered with javascript and that includes ajax. the googlebot does not execute any javascript so it doen't see it. to see what the googlebot sees, turn off all javascript in your browser and then visit your site. If any of your links are now dead links because they are javascript ativated then that is what the googlebot sees. I have seen sites with all links on the home page dead when javascript is turned off. googlebot will see that site as only a one page site! Using a lot of ajax in your web pages is seo difficult. One trick you can do is always provide an actual real href= for links that normally load from ajax: <a href="sitename.com/directory/filename.php" onclick="doajaxload();return false;">load content</a> googlebot will only see the href, it will not see the onclick. that filename.php would have to be a real page with the real content for the spiders to munch on.
  2. --for the position of an element on a web page, i use it and it works great http://www.quirksmode.org/js/findpos.html
  3. use some function like file_get_contents() to retrieve the file into a string variable then just get the length of that. The length of course will be the length of the returned html, not the original size of the php executable file, you would not be able to get that info from a remote server.
  4. here's th specs for that event: http://www.w3schools.com/jsref/jsref_onload.asp
  5. because that's the specs: http://www.w3schools.com/jsref/jsref_onload.asp
  6. try: <select name="fontSize" onchange="fs(this.options[this.selectedIndex].text)"> you should be able to lose the 'value' clauses with the code above and just use the text between the option /option tags.
  7. yup , you're just using php to echo values into js just like you do with html. if the js doesn't work as you expected, try entering the url of the script src attribute into your browsers address field directly and then you will be able to view source in your browser and see what code it's actually returning and if it looks like valid js.
  8. queries operate on the server side not the client side. you can output the results of the query into the document.write statements: <?php // jscript.php // set my mime header header('Content-type: text/javascript'); // stepping out of php into javascript now // i'm gonna wrap everything in a div ?> document.write('<div>'); <?php // some open db code here $result = mysql_query($sql); // loop through result while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { // stepping out of php into javascript now ?> document.write("rowvalue=<?php echo $row['columnname'] . '<br>'; ?>"); <?php } // end while loop //close the div ?> document.write('</div>'); --the thing to understand is that the php executes on the server side and can do anything php normally does including accessing dbs. However, just like when php is mixed with html, the php is used to variably output html and then that is sent to the browser and interpreted. In this case you use php to variably output javascript which is then interpreted by the browser. Because you are calling a php page on another server, ajax would not work for you and the only other option to doing what you want besides the above is to make an iframe in your calling page.
  9. what you can do is call the php file on the other server through the src attribute of a script tag: <script src="http://otherdomain.com/jscript.php"></script> what that jscript.php file consists of is a bunch of javascript document.writes with php code mixed in with it: <?php // jscript.php // set my mime header header('Content-type: text/javascript'); // stepping out of php now ?> document.write("myname=<?php echo 'test'; ?>"); --the general idea is that you mix in php with javascript to insert values recieved from php into the js. Only js will actually be sent to the browser where it will then be executed and the document.writes will write out some html like a div in the page at that point. This method is actually the method used by google for it's google gadgets and is the method used by many other web widgets.
  10. -thanks to the ridiculously cryptic error messages of which ms is the master with over 25 years of nearly useless error messages.
  11. it doesn't like your sql statement. make sure all the field/table names are valid with exact capitalization. $sql="SELECT * FROM Books WHERE id = '".$var."' ORDER BY Product_id ";
  12. maybe it's just choking because you have line feeds in your sql statement below. Some db's will not accept that and will generate an error. $res = odbc_exec($cs, "SELECT Product_id, Catergory, Title, Author, Price, Description FROM [books] WHERE id= ".$addy." ORDER BY Product_id ");
  13. use the sql logical 'AND' operator $getfriend = "SELECT id, friendid FROM friends WHERE id = '$sesid' AND friendid = '$friendid'"; --one note: if id and friendid are defined as numeric type fields in your db, like integers, leave off the single quotes around the use of them in your sql statement.
  14. I think your problem is actually in the connect, not the query. I notice you are using a dsn name for your first parameter below. If that is not defined by the system you are on, then an error will occur and the connection will not be created. To see if the connect worked, use an echo right after it. If it echoes out '0', or 'false', or nothing, then an error occurred in creating your connection. $cs = odbc_connect("Rainwater", "", ""); echo 'my odbc connection: ' . $cs;
  15. you have to have something like this: odbc_connect("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . str_replace("/", "\\", $_SERVER["DOCUMENT_ROOT"]) . "\_database\dbname.mdb", "", ""); read the user posted comments at the bottom of this page: http://us.php.net/manual/en/function.odbc-connect.php
×
×
  • 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.