Jump to content

mainewoods

Members
  • Posts

    685
  • Joined

  • Last visited

    Never

Everything posted by mainewoods

  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
  16. use the php logical or (||) operator: if ($userlevel == "2" || $userlevel == "3"){ echo "|| <a href=\"add_news.php\">Add News </a>"; echo "|| <a href=\"edit_news.php?newsid=$myrow[newsid]\">Edit </a>"; echo "|| <a href=\"delete_news.php?newsid=$myrow[newsid]\">Delete </a><br><br>"; }
  17. just echo it out inside of the javascript. the jsvariable could then be used in file.js if you want. <script type="text/javascript"> var jsvariable = "<?php echo $phpvariable; ?>"; </script> <script type='javascript' src ='file.js'></script>
  18. if the document is in a frame, then wouldn't the parent document be the top? (unless it is a nested frame) That doc would just be a frameset doc, so your innerHTML would not be valid I'm not sure document.parent is valid, it should be window.parent .It is best to leave it off because that is more cross browser compatable if you are calling one frame from another then it is best to just start from the top and go down: var ajaxDisplay = top.someframename.getElementById('divvy'); --the document in the frame targetted must be from the same domain as the calling document or it will not work - browsers stop it as a security violation
  19. just try alerting what keycode you are actually getting when you do alt q, it should be different than just a straight q: function keyBoardDown(e) { if (e['altKey']) alert("alt"); // works if (e.keyCode == 81) alert("q"); //works // debug alert('mycode= ' + e.keyCode ); if ( (e['altKey']) && (e.keyCode == 81) ) alert("alt q"); //doesnt work }
  20. use '@' in front of the function when you call it. All PHP expressions can also be called with the "@" prefix, which turns off error reporting for that particular expression. If an error occurred during such an expression and the track_errors feature is enabled, you can find the error message in the global variable $php_errormsg. Note: The @ error-control operator prefix will not disable messages that are the result of parse errors. Warning Currently the @ error-control operator prefix will even disable error reporting for critical errors that will terminate script execution. Among other things, this means that if you use @ to suppress errors from a certain function and either it isn't available or has been mistyped, the script will die right there with no indication as to why.
  21. an sql engine tries to 'compile' the entire sql statement before it executes any of it so if it finds a parse error it will fail right there. I suspect your problem is that one of the fields you are trying to export has a single quote character in it that did not get escaped somewhere's along the line and then therefore is 'breaking' the sql which uses single quotes as part of the syntax. open up the sql file and copy the part around the error to this board and we'll look at it.
  22. some shared web hosts turn off the RewriteEngine on their servers for security reasons.
  23. here's some clues: if (isset($_GET['game']) & ($_GET['page'] = 'roster')) -- to express the 'and' condition in php use 2 &'s not 1 -- to express the test for equality in a php condition, use 2 ='s not 1 below is correct if (isset($_GET['game']) && ($_GET['page'] == 'roster'))
  24. if the db field is defined as a numeric type field like integer, then putting single quotes around it in the sql statement will cause an sql error. You do not have a choice with numeric fields, the single quotes have to be left off.
  25. while($row = mysql_fetch_assoc($Query)){ <input type='text' name='Team_ID' value=<?php echo $row['Captain']; ?>> if the 'value=' clause has a value that has a space in it, it has to be surrounded by quotes. As well if the loop executes more than once, you will have multiple form fields with the same name, 'TEAM_ID' and you should not do that. <input type='text' name='Team_ID' value="<?php echo $row['Captain']; ?>">
×
×
  • 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.