almostbob 866 Retired: passive income ROCKS

google has 70% market share
the others add up to less than 30%
google can confidently make the rules, do make the rules
intelligent webmasters follow the google101 at google webmaster tools

almostbob 866 Retired: passive income ROCKS

When I zoom out of the pages which I've created for my website, it seems that as you zoom out the pages move towards the left, although the content stays where it is supposed to be. But when I zoom out of website such as this the page stays in the center. How do I achieve this on my wepages?

body { width:100%; text-align:center;}
.content {width:90%; text-align:left;}

<!--dtd head etc--> <body> <div class='content'>bla bla bla</div> </body></html>[code=html]<!--dtd head etc-->
<body>
<div class='content'>bla bla bla</div>
</body></html>

almostbob 866 Retired: passive income ROCKS

they call it concatenation,,
ever tried to get a cat to do something it didnt already want to ?? same thing :P

almostbob 866 Retired: passive income ROCKS
echo '<select name="name"><option value="">Select your manager</option>';
while($row2=mysql_fetch_assoc($result1)) {
 echo '<option value="'.$row2['mid'].'"'; //line broken in the middle of the option declaration
 if($row2['mid']= $_POST['name']) echo 'selected="selected"'; //select the appropriate value only
 echo '>'.$row2['mngname'].'</option>'; }//option declaration completed
echo "</select>";

echo is infinitessimally faster than print :)

almostbob 866 Retired: passive income ROCKS

on fcreate the filesize is zero
reading zero bytes gives the error
as you are reading the entire file,

Note:

If you just want to get the contents of a file into a string, use file_get_contents() as it has much better performance

replace else {$newfile = fopen($filelocation,"r");$content = fread($newfile, filesize($filelocation));fclose($newfile);} with else { $content = filegetcontents($filelocation);} far less overhead

almostbob 866 Retired: passive income ROCKS

wrapping the code in [code=language] bla bla bla [/code] tags to enable highlighting,
and fixed a few html errors, red is not a 'good' color for code, values must be quoted

<form name="order_of_products_by_values" id="order_of_products_by_values" method="post" action="">
<select id="order_of_products_by_values" name="order_of_products_by_values" onChange="this.form.submit();"> 
<option value=1 >Pret crescator</option>
<option value=2 >Pret descrescator</option>
<option value=3 >Test</option>
<option value=4 >Test</option>
</select>
</form>

becomes

<form name="order_of_products_by_values" id="order_of_products_by_values" method="post" action="<?php echo $_server['php_self']; ?>">
<select id="order_of_products_by_values1" name="order_of_products_by_values1" onChange="this.form.submit();"> 
<option value='1' <?php if($_POST['order_of_products_by_values1']=='1') echo 'selected="selected"';?> >Pret crescator</option>
<option value='2' <?php if($_POST['order_of_products_by_values1']=='2') echo 'selected="selected"';?>>Pret descrescator</option>
<option value='3' <?php if($_POST['order_of_products_by_values1']=='3') echo 'selected="selected"';?>>Test</option>
<option value='4' <?php if($_POST['order_of_products_by_values1']=='4') echo 'selected="selected"';?>>Test</option>
</select>
</form>

not clean code but effective,
and didnt bother to code out possible errors at the initial form state where no value has been submitted
eg: <option value='3' <?php if($_post) {if($_POST['order_of_products_by_values1']=='3') echo 'selected="selected"';} ?> >Test</option> leaving you something to do :)

almostbob 866 Retired: passive income ROCKS

tables are not a layout tool

some reading to be done

almostbob 866 Retired: passive income ROCKS

if each page is namned appropriately, eg BP.html BHP.html and may be resident in subfolders b c d, this script will recurse,
try something like

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<style type="text/css">
ul.dirlist, ul.dirlist li { list-style-type:none; padding-left:1em; }
</style>
<title>Try this -recursively Almostbob</title>
</head><body><H3>Links</h3>
<?php
function get_Extension($ff){
$path_parts = pathinfo($ff);
if ($path_parts["extension"]) { $m_Extension = strtoupper($path_parts["extension"]); 
	return($m_Extension); }
else {return("unknown");}  }
function Check_type($ff){ $temp=get_Extension($ff);
 if(($temp=="HTML"))  return (true);
 else return (false);  }
 function recursedir($c = '.', $wcwd = false) {
if($wcwd === false){ $wcwd = substr($wcwd = $_SERVER['REQUEST_URI'], 0, strrpos($wcwd, '/') + 1);}
 echo('<ul class="dirlist">');
 $d = opendir($c);
 while($f = readdir($d)) {
 if(strpos($f, '.') === 0) continue;
 $ff = $c . '/' . $f;
 if(Check_type($ff)){ echo '<li><a href="'.$ff.'">'.substr($f,0,strlen($f)-4).'</a>';}
 if(is_dir($ff)) {echo '<li>'.$f;
 recursedir($ff, $wcwd); }
 echo '</li>'; }
 echo('</ul>'); } 
 recursedir(); ?>
 </body>
</html>

you could always add a sort to give absolute alpha order
line 15 can be given or clauses to add multiple file types to return true, eg if ($temp =='HTML'||$temp == "HTM" || $temp == "php")

almostbob 866 Retired: passive income ROCKS

<elem style='width:%;'>
current practice for fluid layouts that adjust to window size and user preference is ems and % as scalar dimensions
a layout laid out in scalars will adjust to the container

almostbob 866 Retired: passive income ROCKS

<?php phpinfo(); ?> where id you set the session data to write?

almostbob 866 Retired: passive income ROCKS

there can be no whitespace before a header, there is a tab in the code above, CDF

almostbob 866 Retired: passive income ROCKS

loading the googlemaps url, means the page is NEVER cached, that url executes every time the page loads, the whole page will never be pulled from the cache, but the elements of the page each image chunk that creates the map, will be

you can give an apparent speed increase by using onload
1;to fire the googlemap api in javascript if you code the mapwrap the entire thing in a function, and call the function onload,OR
2;you can use onload to change the source of the map element

either way the page works, before the map is fully rendered

you can set expiry times in .htaccess

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html "access plus 1800 seconds" 
ExpiresByType image/gif "access plus 360 days"
ExpiresByType image/jpg "access plus 360 days"
ExpiresByType image/png "access plus 360 days" 
ExpiresByType application/x-javascript "access plus 360 days"
ExpiresByType text/css "access plus 360 days"
ExpiresByType text/javascript "access plus 360 days"
ExpiresByType image/x-icon "access plus 360 days"
</IfModule>
almostbob 866 Retired: passive income ROCKS

Check if the session folder/directory is writeable,
sometimes its headslap moments

almostbob 866 Retired: passive income ROCKS

& a chikkin

almostbob 866 Retired: passive income ROCKS

look at the code of the page, as view source, when you load the page in a browser
the bomb is not not in the source you uploaded, but was added to the site by some insecure practice
it is easy for malicious persons to add stuff to form inputs that dont sanitize when the form is processed
it is easy for bots to find entry points to pages and add stuff
it should be as easy to undo stuff, it often isnt
HATEhateHATE stuff, am old enough to rememeber:- before every packet had to have tamper seals, because nobody just wanted to kill or maim a stranger -:OH NO I am my grandfather

possible fix is to hose the site and reload it from the development pc to the server
sqldump the database if used, clean the data, and reload it

almostbob 866 Retired: passive income ROCKS

A timely piece of advice from which I am sure we could all benefit.

Finishing Things:

I am passing this on because it definitely worked for me today, and we all could probably use more calm in our lives.
Some doctor on TV this morning said the way to achieve inner peace is to finish all the things you have started.

So I looked around my house to see things I'd started and hadn't finished.

I have managed to finish off a bottle of Merlot, a bottle of Chardonnay, a bodle of Baileys, a butle of wum, a pockage of Prungles, tha mainder of bot Prozic and Valiuminun scriptins, the res of the chesescke, haf a pizzza, an a box a chocletz.

Yu haf no idr how fablus I feel rite now. Plaese sned dhis orn to dem yu fee ar in ned ov iennr pisss. An telum,u luvum!!

BitBlt commented: lol +0
wenbnet commented: lol +0
almostbob 866 Retired: passive income ROCKS

yes but fancybox lightshow etc do it much nicer more fluidly using css and javascript, css hover focus are rigid

almostbob 866 Retired: passive income ROCKS

be relevant
be unique
be original
by syntactically correct
be code compliant
be structured

judge the effect of your SEO by checking the returns on your webstats, & the SE tools pages on the relevant sites, Google Yahoo Bing Ask

(Bing: formerly MSNsearch, renamed
But
Its
Not
Google)

almostbob 866 Retired: passive income ROCKS

sharing violation is OS related, liely causes include the file is still open for editing in an editor that locks the file when you try to view it in the browser

tables are not used for layout tools; tables are for displaying tabular data

suggest you google any of the thousands of css menu tutorials and get up to, or close to, current practice

almostbob 866 Retired: passive income ROCKS

TRY

2 input fields, concatenated on the server onsubmit is far simpler than attempting the impossible

<input type='text' value='this text value is in hardcode or generated by the script when creating the page the user cant change it' name='oneway2doit1'>
<textarea name='oneway2doit2'>type your *** here</textarea>
$textarea=$_post['oneway2doit1'].$_post['oneway2doit2'];
almostbob 866 Retired: passive income ROCKS

Solution to all the above

READ THE Finelyconstructed MANUAL

almostbob 866 Retired: passive income ROCKS

Solution
read the API for simple dom,
read the manual for php and the sql version on your server.
write a script

almostbob 866 Retired: passive income ROCKS

Keyword: Noun: archaic: def; something ignored by search engines

In English, keywords are irrelevant.

almostbob 866 Retired: passive income ROCKS

;)

almostbob 866 Retired: passive income ROCKS

$data = processStockSite('http://finance.yahoo.com/q?s=echo $epic.l');
try

$data = processStockSite('http://finance.yahoo.com/q?s='.$epic.'.l');
gilgil2 commented: Very helpful and fast replies! +0
almostbob 866 Retired: passive income ROCKS

try

<?php
$code = "xta";
?>
data = processStockSite('http://finance.yahoo.com/q?s=<?php echo $code ?>.l');
<?php
$code = "xta";
$data = "processStockSite('http://finance.yahoo.com/q?s='$code.l')";
echo 'data ="'.$data.'"'; ?>

or

<?php
$code = "xta";
echo "data = processStockSite('http://finance.yahoo.com/q?s='$code.l')"; ?>

it
short tags sometimes cause problems

almostbob 866 Retired: passive income ROCKS

goto the google webmaster101 page and very importantly, read what NOT to do

almostbob 866 Retired: passive income ROCKS

From memory
you cant embed _post values in a url
url variables are _get, when processed by the server, so will be igonred by the form processor

google the difference between method=post and method=get
I dont have a solution
when you post any kind of code
wrap it in [code]

[/code] tags, stops the code being turned into a url and makes it easier to get results

almostbob 866 Retired: passive income ROCKS

try

document.getElementById('subm1').style.display='hidden' <!-- instead of line disabled-->
document.getElementById('subm1').style.display='block'

but .. disabled='disabled' is cross-browser friendly uses one line of code for all browsers
IE uses one dom, FF moz safari use a different dom so the show hide values are different, often requires complex scripts

<script type='text/javascript'><!--
function hideIt(elem) {
if(document.getElementById) { document.getElementById(elem).style.visibility='hidden';}
if(document.layers) {document.layers[elem].visibility='hide';} }
function showIt(elem) {
if(document.getElementById) {document.getElementById(elem).style.visibility='visible';}
if(document.layers) {document.layers[elem].visibility='show';} }
--></script>

more complicated <input value='' id='textin' onchange="showIt('subm1');showit('subm2');"> still no guarantees untested code

almostbob 866 Retired: passive income ROCKS

It is possible in javscript so here is a small sample, probably not the best sample but a sample nonetheless

<script type="text/javascript">
function theChecker() { if(document.getElementById('textin').value=="") 
{ document.getElementById('subm1').disabled=true;document.getElementById('subm2').disabled=true; } 
else 
{ document.getElementById('subm1').disabled=false;document.getElementById('subm2').disabled=false; } }
</script>
<input id='textin' type='text' onkeyup='theChecker();'><br>
<input id='subm1' type='submit' disabled='disabled' value='submit1'> &nbsp; <input id='subm2' type='submit' disabled='disabled' value='submit2'>

see also string.length to ensure the correct number of digits for a postcode

almostbob 866 Retired: passive income ROCKS

I have a 2600px monitor, 980px central column looks ridiculous
I have also a 200px phone, 980px pushes content offscreen and makes it difficult to access the page
at least consider making the page to current standards, a page in em and % self adjusts to window size and does not need nearly so much 'tweaking' to make it look acceptable

almostbob 866 Retired: passive income ROCKS

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0

the codescrap entered in the address bar makes any web page locally editable, you can play with any element or content

almostbob 866 Retired: passive income ROCKS

jquery
or oldschool, back from the 90s when everybody rode dinosaurs,
perhaps something like <body onload='document.getelementbyid('advert')display='block'> where advert is <div id='advert' style='display:none;'>ad</div> untested code, thought exercise

almostbob 866 Retired: passive income ROCKS

sample

<script type="text/javascript">
<!--
function hideIt() {
if(document.getElementById) { document.getElementById('layer1').style.visibility='hidden';}
if(document.layers) {document.layers['layer1'].visibility='hide';} }
function showIt() {
if(document.getElementById) {document.getElementById('layer1').style.visibility='visible';}
if(document.layers) {document.layers['layer1'].visibility='show';} }
--></script>
<button style='top:0;' id='openform' onClick="showIt();">fill form</button>
<div id="layer1" style="position:absolute; left:0; top:0; width:100%; visibility:hidden; padding:30%; margin:0; background:#ececec; border: 1px solid;">
Form
<form onsubmit="hideIt();top.location.reload();" action='somefile' method='post'>
something? <input name='somename' type='text'><br>
<input type='submit'><br>
<button id="form" onClick="hideIt();">Close without completing</button>
</form>
</div>
almostbob 866 Retired: passive income ROCKS

You dont work a spider
'spider' in this instance, is another name for a search engine robot, because they crawl the web following links
Your task is to optimize your site to make access better for the spider when it gets therefix broken links
use a consistent file structure
use valid code
sitemapgo to the google webmaster tools page and read webmaster101
also signup your site verify ownership of it, and find out exactly what spiders see when they crawl your site
makes the 'optimize' bit above, a lot easier
these standard test beds may assist you

http://analyze.websiteoptimization.com/authenticate.php?url=http://www.yoursite.com&/ Speed

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.yoursite.com&charset=%28detect+automatically%29&doctype=Inline&group=0 html

http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.yoursite.com&profile=css21&usermedium=all&warning=1&lang=en CSS2 http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.yoursite.com&profile=css3&usermedium=all&warning=1&lang=en CSS3

http://demo.opera-mini.net/demo.html?www.yoursite.com handheld

http://www.browsershots.org other browsers
many problems (if present) will show
serious code errors in the w3c validator sites produce blankscreens in browsershots

Valid code does not ensure the site will work ..... in all browser OS combinations
Invalid code ensures the site will not work ..... in all browser OS combinations


not all layouts work in handheld devices
strictly code based

almostbob 866 Retired: passive income ROCKS

CSS

@media print { .dontprint { display:none;}
@media screen { .dontshow { display:none; }
<div class='menu dontprint'> this represents the onscreen menu, which you dont want to print</div>
<div class='dontprint'>This is onscreen instructions for the form</div>
<div class='dontshow'>this is different on-paper instructions for the form</div>
<form>bla bla bla this is the form
What is your choice <select class='dontprint' onchange='self.className="";'>
<option>1</option>
<option>2</option>
<option>3</option>
</select><input type='text' class='dontshow'>
<!-- this creates a select box onscreen, but a fill in textbox on paper unless the user has set the value of the select box -->
</form>
<div class='dontprint'> this is anything else you dont want to print</div>
<div class='dontshow'> this is anything else you want to print but dont want to show onscreen</div>
<div class='dontshow dontprint'> this is spambot killer 
<a rel='nofollow'  href='http://www.auditmypc.com/freescan/antispam.html'>I hate spambots</a>
well behaved bots don't follow the link</div>
almostbob 866 Retired: passive income ROCKS

more and more users do not allow popup windows, the code will fail
better than a popup is a layer in the original page, that can be hidden or displayed at will, with a z-index higher than the rest of the page.
layers in the current page cannot be blocked by popup blockers

layer in this instance refers to an element sized and positioned to overshadow all other items in the page onclick='formname.display:block' for this element shows the contents of the div(example) and hids all other content onsubmit='formname.display:none;' returns to the prior page, no-popups

not code sample, a thought exercise

almostbob 866 Retired: passive income ROCKS

$_server[]

almostbob 866 Retired: passive income ROCKS

You do understand that javascript is clientside, so anyone who wants to find your password can 'view source' and read the password stored in clear text
at the very least hash the password and send only the hash value

almostbob 866 Retired: passive income ROCKS

Why not use Print button on the browser or keyboard?

the number of helpdesk req there are for 'how do I print this'
If you program a print button right in the middle of the page there is less chance of somebody assuming you CAN'T print because there is no print button
unfortunately not 'no chance' just less chance

without a button you almost have to put detailed instructions on the page how to access 'print'

almostbob 866 Retired: passive income ROCKS

restricted private pilots check
Bike check
Car check
Truck check
Bus check
marine Oocean going check

18 was a good year for licenses

almostbob 866 Retired: passive income ROCKS

something in the user string in the remote api is always enough to uniquely identify the remote api, remote address remote_host http_user_agent etc ( http://php.net/manual/en/reserved.variables.server.php ) , available to php when the file containing the data is requested perhaps an intelligently written version of this example

<?php if $_server['something_testable']='value confirming remote api'; { $subTotal = getSubTotal(); echo money($subTotal);
// repeated ad-nauseum to give all machine readable data fields
exit; } ?>
regular html & generated info for human readable data fields
</body></html>
almostbob 866 Retired: passive income ROCKS

the output contains no php, only the generated html
how does the external api get its data

almostbob 866 Retired: passive income ROCKS

means the program has not found the javascript to replace the innertext of the div
likely causes

wrong filename the script is unlikely to be called jsapi, more often jsapi.js

the path is wrong ../../Documents is not the path to the script from the file that is including, try absolute references <script src='http://yoursite/documents/jsapi.js'> or <script src='<?php echo $_SERVER['DOCUMENT_ROOT'].'/documents/jsapi.js'; ?>' type='text/javascript'>

almostbob 866 Retired: passive income ROCKS

<input type='checkbox' style='background-color:background; color:background; border:0;" /> 'background'= the color of the underlying element background = invisible

view source renders this concept of hidden form fields 'not a good solution'

almostbob 866 Retired: passive income ROCKS

put the css in the css file, class for a multi-member group, id for a singleton group
in php, however the class/id is determined
very similar to madCoder's above

<!-- boring html -->
<div id='<?php isset($special_condition) ? "special_id" : "boring_id"; ?>'> blah </div>
<div class='<?php isset($special_condition2) ? "special_class" : "boring_class"; ?>'> RULE 34 </div>
<!-- boring html -->

isset($special_condition) is of course any date, variable, size, _get _post value, file_exist(), mysql(anything), any combination of anything, that can be examined to compare data with any choice of comparables, not just isset()

almostbob 866 Retired: passive income ROCKS
<?php 
if(!isset($_POST['fname']) || !isset($_POST['age'])) { 
echo '<form action="welcome.php" method="post">
Name: <input type="text" name="fname"';
if(isset($_POST['fname']) echo " value='$_POST['fname']"; // adds the value of any part-completed form
echo ' /><br />
Age: <input type="text" name="age" ';
if(isset($_POST'age']) echo " value='$_POST['age']";  // adds the value of any part-completed form
echo ' />
<input type="submit" />
</form>';}
else { echo "Welcome $_POST['fname'] !<br />
You are $_POST['age'] years old. ";} ?>

presents the form until all required fields are properly filled, including updating completed values, then presents the welcome screen.
line 2 can be expanded to check the presence of any number of requred fields, separated by || , it is not validating the content, just the existence.

There is no requirement for submission to another file

almostbob 866 Retired: passive income ROCKS

check to see if thsomeone hasntcoded the menu in the page instead of including the nebu

almostbob 866 Retired: passive income ROCKS

examine the lines in each file and ensure they are both including the same file

almostbob 866 Retired: passive income ROCKS

demo

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<script type="text/javascript">
<!--
function sizer() {
var viewportheight;
if (typeof window.innerWidth != 'undefined') { viewportheight = window.innerHeight }
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportheight = document.documentElement.clientHeight }
else { viewportheight = document.getElementsByTagName('body')[0].clientHeight }
document.getElementById('extern').style.height=viewportheight-26 + 'px'; }
document.onresize = sizer(); 
//--></script>
<!--[if IE]>
<script type='text/javascript'>window.onresize=sizer;</script>
<![endif]-->
<title>page</title>
</head>
<body onload='sizer();' style='margin:0;padding:0;height:100%;text-align:center;'>
<div style='height:23px;width:100%;text-align:center;'>
<a href='home.html'>&nbsp;Return to referring&nbsp;page&nbsp;</a></div>
<iframe name='extern' id='extern' frameborder='0' width='100%' height='200px' src='whatever.htm'>loading frame</iframe></body></html>