almostbob 866 Retired: passive income ROCKS
echo "<meta name=\"description\" content=\"".$row{'Name'}." - ". substr($row['Description'],0,strpos($row['Description'],' ',150)) ."\">\n";

I think that this will break the string at the first whitespace after 150 characters

anyone seen the fingers crossed icon :)

almostbob 866 Retired: passive income ROCKS

everybody knows strtotime is buggy in and around february
first day +1month at the 29 30 31 January typically puts you in march 1 not Feb 1
last day of the month is not always 28 feb, may be march
I have a script for my own use, residential leases typically first day of next month till lastday of this month next year

function leaseyear() {
$mth = date('m');
$year = date('Y');
$result = strtotime("{$year}-{$mth}-01");
$start = strtotime('-1 second', strtotime('+1 month +1 day', $result));
$end = strtotime ('-1 second', strtotime('+1 month + 1 year', $result));
return date('jS M Y', $start).' to '.date('jS M Y', $end);
}
echo leaseyear();

what other patchworks have had to be made ?

supposed to be fixed in 5.3 already, but ...

almostbob 866 Retired: passive income ROCKS

In php the easier way to get the last element is to use end($arr)

Thank you, going to edit some scripts

almostbob 866 Retired: passive income ROCKS
print $thearray[0]; //first
print $thearray[count($thearray)-1]; //last
// because the index starts with zero
almostbob 866 Retired: passive income ROCKS

grab a prewritten shopping cart script from hotscripts or somewhere, and \"borrow\" their method

almostbob 866 Retired: passive income ROCKS

never tried it (I don't think I have anyway)

Cold leftover pizza

like it

vegemite (Australian toast spread)

almostbob 866 Retired: passive income ROCKS

Good idea. Though my password encryption is a bit more advanced I like the idea and I'll probably use it. There's just one problem. I would like users to connect via mysql connection. Is there any way to redirect the mysql connection to a php file that reads the data?

I have to admit ignorance,
Dunno,
on my development i didnt want to waste database on the webstats
the filesize is small enough that the flat file is faster than reading another table in sql cms, the cms tables are huge
I did not investigate integration with sql
users dont see sql
they just see output, which could come from anywhere, so there is probably a method to do so,
Guru Call ? any SQL gurus out there ?

almostbob 866 Retired: passive income ROCKS

Thanks :)

EDIT: Almostbob....

What you posted didn't work but someone else gave me this code which did.

$count = count($links);
for($i=0;$i<$count;$i++)
{
 echo '<p>[PART="'.($i+1).'"]'.$links[$i].'[/PART] <br /></p>';
 }

bummer
appeared to work in my sandbox,
just threw values into an array and went from there
sorry
have clipped the code that works and put it in the library though
thanks

almostbob 866 Retired: passive income ROCKS

Your site has to have something interesting in it, those 'seo' additions you have made are bland, and have no reference to YOUR page they refer to BMW, bmw already have their own web site,, seo score -negative
the search engines say. we do not index every site submitted

best would be to post the url,
both to let some of the gurus look it over and offer constructive advice as well as this more negative advice(sorry am a negative person)
and
because then your site starts to have links pointing to it from other sites,
which is the major part of real search engine performance.
the more pages link to your page, the more the page will be indexed, as the links are discovered when the referring page is spidered

My site is an embarrassingly[1] simple bland mostly text, support page for our small apartments rental business, by good luck and some small good management we rank on page 1 in search engine returns for 'apartments for rent nova scotia'

urls have been mod_rewrite -ed to look like a tree structure
keywords reflect page content
keywords actually appear in page content
we have links from other web sites from responding to posts on accommodation boards and holiday boards with our site url in the signature, because the links are appropriate in SearchEngine terms, and we get sales from those links

only one file now shows any …

almostbob 866 Retired: passive income ROCKS

Like uncle_smith but
people tend to believe indexes should start at one

foreach ($links as $key => $links)
{
echo '[PART="'.$key+1.'"]'.$links.'[/PART] <br />';
}
almostbob 866 Retired: passive income ROCKS

Is the re-write in .htaccess means even I type page.php?id=3&t=456 it all redirects to a certain url like "page/3/456"?

ya some thing like that...
it depends on our rewriting rule...

in this particular case noob,
the rule loads the file in the ?id=3&t=456 but makes the url display as page/3/456 so that the user and searchbots see a nice tree structure of files in folders that may not exist, but work like they do.
the site may be stored in database table 'alpha' and not have more than index.php in a root folder, at extreme.

almostbob 866 Retired: passive income ROCKS

thought processes:::

md5 # data on table insert
compare md5 of login to table data

table in a folder chmodd invisible to the outside world

crypt

table location information only in php blocks in the running script not sent to the outside world

I'm sure there are ways, that may be strong enough secure for end user
mine is just a use log dont have diret access to server logs so made my own

a shared host package without sql is as secure as my house,
I dont have door locks,
end user need seriously whether it is reasonable to require security at all
Secure needs a minimum standard on the host as well as in the code you're writing $silk_purse >< 'sows ear'; and it might make a convenient low end demo version for high end customers

almostbob 866 Retired: passive income ROCKS

if the number in the database is $number
php can handle it as a string anyway
the number will be stored in the database as *.???,
by the predefined data format decimal(10,3)
exactly 3 digits after the point,
and trailing digits=0 are insignificant, rtrim ( $number, '0.');

$number=12345678.090;
echo rtrim ( $number, '0.'); //12345678.09
$number=12345678.900;
echo rtrim ( $number, '0.'); //12345678.9
$number=12345678.901;
echo rtrim ( $number, '0.'); //12345678.901
$number=12345678.000;
echo rtrim ( $number, '0.'); //12345678

the characters included in rtrim character list are zero and the decimal point incase the font is hard to read
one of those cases where you can change a built in function
rtrim is typically used just for whitespace as rtrim($number);

Apologies MaxMumford,
I assume that everybody uses functions I use as often as I use em

almostbob 866 Retired: passive income ROCKS

I have tried decimal, but it always adds 0's onto the end of my number.

I want it to only add the exact number I enter in, so for example at the moment if i enter in 10, it changes it to 10.000 whereas I want it just to save 10...

Max

data dump an sql database
nothing is stored as entered,
text fields are padded,
numbers are stored to noted precision,
numerically there is no difference between 10 and 10.000
If you want to be able to enter 3.331 then 10 becomes 10.000
if you are trying to establish data precision use a different database structure,
something like, an field populated by your insert statement value= number of entered digits right of the decimal point will set precision for each entered item,
can be used to notify user that their 4 decimal number will be rounded to 3 in the database, etc, etc
its only a design issue

almostbob 866 Retired: passive income ROCKS

not knowing what form structure used this is not necessarily going to work for you, might provide a clue to proceed
in the original form

<form>
text for field 1 <input name='field1' value='<?php if isset($field1){echo $field1;} ?>' type=text size=45>
text for field 2 <input name='field2' value='<?php if isset($field2){echo $field2;} ?>' type=text size=45>
text for field 3 <input name='field3' value='<?php if isset($field3){echo $field3;} ?>' type=text size=45>
text for field 4 <input name='field4' value='<?php if isset($field4){echo $field4;} ?>' type=text size=45>

and in the file that parses the submit and sends it back if not correct, send back with the data in some dynamic url

almostbob 866 Retired: passive income ROCKS
echo ("
<html>
<head>
<title>Untitled Document</title>
<style type="text/css">

the first dquote in the style declaration ends the text in the echo statement, then there is no semicolon, variable, dot, or other structure php understands so there is an error
replace the dquotes in <style type="text/css"> with single quotes or escape them.
and check the rest of the script <p class="style1" .
These would show up (like above) if you had an editor with syntax highlighting, as do unclosed braces <div>without</div> etc
i use a notepad replacement(google) for that reason

almostbob 866 Retired: passive income ROCKS

rotate is likely to be a angle value, somewhere in range 0f either
-180 to +180
or
-pi to +pi
depending on world geometry polar or cartesian

almostbob 866 Retired: passive income ROCKS

erms post contains the answer echo $array['element']; is the correct format
had it been another array $_server everyone would notice the error
everyone has typed echo $_SERVER['php_self'];

almostbob 866 Retired: passive income ROCKS

that file index.php is the gallery,
it reads the foldernames and likely contains a part that reads folder names and displays them as linkand another part to handle the links when they are clicked and display the thumbnails
suggested by the format of the links

<a href='index.php?dir=/9th Annual Golf Tournament'>9th Annual Golf Tournament</a><br><font face='arial' size='2'> -

at the moment the folders are sorted in date order
likely the sort order can be changed
if you post the index php file some code guru can likely do something with it

almostbob 866 Retired: passive income ROCKS

funny i have IE6 and IE7 and worked as hoped in both and firefox and safari and avant and opera
byut yeah usually IE is a ...

almostbob 866 Retired: passive income ROCKS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- @(#) $Id$ -->
<head>
 <style>
 .left {width:15%; left:0; top:0; position:fixed;}
 .right {width:7%; right:0; bottom:0; position:fixed;}
 .middle {width:74%; margin-left:17%; margin-right:9%;}
 </style>
 <title>HTML demo Template</title>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 <meta name="Generator" content="almostbob" /> <!--Humor-->
 <meta name="Keywords" content="your,keywords,here" />
 <meta name="Description" content="." />
 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
</head>
<body>
<div class='left'> left<br>left<br>left<br>left<br>left<br>left<br>
left<br>left<br>left<br>left<br>left<br>left<br>left<br>left<br>
left<br>left<br>left<br>left<br></div>
<div class='right'>right<br>right<br>right<br>right<br>right<br>right
<br>right<br>right<br>right<br>right<br>
right<br>right<br>right<br>right<br>right<br>right<br></div>
<div class='middle'> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> 
middle middle<br> middle middle<br> middle middle<br> middle middle<br> middle middle<br>
</body>
</html>

css positioning of the divs or in your case images styled similarly makes it quite easy
the two divs left and right are set at top and bottom of window, because ya can, positioning is easy to modify

almostbob 866 Retired: passive income ROCKS

may be present but not enabled for this folder
if the commerce package is 'theirs' the host may not want any rewrite of the urls to 'break' the shopping cart (thought process only not suggesting any impropriety)
can only ask the provider
too many possibilities to examine via thread posts

almostbob 866 Retired: passive income ROCKS

can you give any example on this ????

google webmaster help long dynamic url are not indexed

look it up in your google webmaster account or yahoo webmaster account or msn webmaster account, helpscreens
long dynamic url are not indexed by search engines, the page may not be there tomorrow

if you dont have a webmaster account with some search engine, why **expletive deleted** not

almostbob 866 Retired: passive income ROCKS

have you determined that mod_rewrite is enabled in your server
500 Internal server error often means the module is not compiled in

Shanti C commented: Thank You .... +3
almostbob 866 Retired: passive income ROCKS

prefer an integrated approach through a modified front end menu
admins are often upgraded from users,
they have experience and familiarity with the user control panel
keeping everything with similar systems also means that when malicious joe looks over admin fred's shoulder at the screen, joe sees the same page he expects to see, and does not know that fred has booted him off the system, protecting your admins a little through obscurity in a cubicle farm

almostbob 866 Retired: passive income ROCKS

something along the lines of

if isset($page) {header("Location: /amherst/");
exit; }

however most sites are tending to go the other way
to use mode_rewrite to display the generated url in a person friendly, search engine friendly system.
if you are on an apache server mod_rewrite will do what you intend

almostbob 866 Retired: passive income ROCKS

If its really only small & simple
why not a flat file version for those without sql
fixed length fields teminated by line feed
or
php arrays
is quite fast to read and write, especially since the server can cache the write.
look at the structure used by some of the simpler apps
here is a sample of a data set for a non-sql tracker

"traffic" => array(
 array(  "time" => 1211356529, "prx_ip" => "unknown", "ip" => "76.11.56.122", "dns" => "blk-11-56-122.eastlink.ca", "agent" => "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)", "referer" => "unknown", "page" => 236, "browser" => "explorer", "browser_note" => "7.0", "os" => "windowsxp", "visits" => 8, "ext" => "ca", "id" => 16049,    "views" =>    array(  "1211356244|0|1", "1211356260|45|1", "1211356279|22|1", "1211356288|30|1", "1211356305|131|1", "1211356350|32|1", "1211356408|132|1", "1211356529|236|1"    ),  "off" => 0    ),
 array(   "time" => 1211356603, "prx_ip" => "unknown", "ip" => "74.6.21.105", "dns" => "lj512805.crawl.yahoo.net", "agent"  => "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)", "referer" => "unknown", "page" => 94, "robot" => "yahoo", "visits" => 1, "ext" => "us", "id" => 16050,   "views" =>  array( "1211356603|94|1"  )  ),
 array( "time" => 1211359223, "prx_ip" => "unknown", "ip" => "74.6.22.238", "dns" => "lj511936.crawl.yahoo.net", "agent"  => "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)", "referer" => "unknown", "page" => 22, "robot" => "yahoo", "visits" => 1, "ext" => "us", "id" => 16051,  "views" => array( "1211359223|22|1"  )  )
 ),
almostbob 866 Retired: passive income ROCKS

this looks like the same question again,
so why not try any of the secure upload and photo scripts already made and sitting in script repositories all over the wwweb.
If you must build your own they make a great templateEASYPHP Upload
EASYPHP Photoare fun, no chmod
remember google is your friend

softpedia easyphp download site

almostbob 866 Retired: passive income ROCKS

Ahem uncle, did you read my post?

I dunno, but on my view at the moment his is first, yours second
the order is messed up
yours is 3 hours ago
his is 1 hour ago,
database will (damn lost the fingers cross icon) sort it out eventually

almostbob 866 Retired: passive income ROCKS

How can I upload image in 0755 mode... ??? Please Help me ...

because the script should be running on the server as owner of the file, it is the 7 in 755, it has all rights

if the hosting is set up, nonstandard-ly, then your script should work with chmod 775, running as server group
there should be no need to expose your site to, persons-of-evil-intent, chmod 777
Picture a number of images being uploaded through your script, ~2.5 seconds is all I need
while the transfer is proceeding
person-of-evil-intent drag-n-drops a bunch of php scripts on the folder.
the upload script finishes
the files are chmodded to 755,
but now evil-intent has access to your server through the scripts they added
I can write a bot to do it, (and host it from your web page to infect others, if you leave me a hole) so person-of-evil-intent can,

first digit owner 7 read write execute, // this is where your script should run
second digit group 7 read write execute // this may be where your script is running
third digit other 5 read execute // this is all us schleps in the outer world, we are 1% dangerous & malicious, 99% ok.
but it only takes 1

almostbob 866 Retired: passive income ROCKS

no you dont,
the script doing the upload runs from your server, not the user

almostbob 866 Retired: passive income ROCKS

thats a nightmare,
read write execute to everyone,
Malicious persons can add files to your folder, and shut down or takeover your site
not a good idea
permissions to the script that writes to the folder, according to the use to which you are going to put your images.
check what your scripts need, and allocate those rights to the user that the script is running as, not to everyone, and not from a script,

almostbob 866 Retired: passive income ROCKS

Its a javascript, that just writes either of 2 width values depending on whether the DOM is true(IE) or false(Mozilla) browsers
it goes wherever you want to differentiate the measurement for either browser type
example

<body>
<h1>this is a header</h1>
<div> this is somet to do with your body text</div>
<script language="javascript" type="text/javascript">
(document.getElementById) ? dom = true : dom = false; 
if (dom) {document.write('<div class='menu' style="width:50;">'}
else {document.write('<div class='menu' style="width:56;">') }
</script>
<ul>
<li>menu item 1</li>
<li>menu item 2</li>
<li>menu item 3</li>
<li>menu item 4</li>
<li>menu item 5</li>
<li>menu item 6</li>
<li>menu item 7</li>
</ul>
</div>
<p> more body stuff</p>
<form>
<!-- blah blah blah -->
</form>
</body>
<script language="javascript" type="text/javascript">
image1 = new Image();
image1.src = "oemlogo1.jpg";
image2 = new Image();
image2.src = "oemlogo2.jpg";
image3 = new Image();
image3.src = "oemlogo3.jpg";
</script>
</html>

javascripts do not always belong in the <head>.
Most do
image preloaders end up between </body> and </html> so the page displays before the rollover images download
appearance of faster pages
code has not been tested for your purposes it is presented as an aide to problem solving.

almostbob 866 Retired: passive income ROCKS

get_browser returns an array if the second paramenter is true, of the remote user if the first parameter is null
print part of the array

<?php
$browser = get_browser(null, true);
print_r($browser['platform']);
print_r($browser['version']);
// its been a while echo $browser['platform']; may work
?>

array elements I know about, havent looked up if this is the full list
browser_name_regex
browser_name_pattern
parent
platform
browser
version
majorver
minorver
css
frames
tables
cookies
backgroundsounds
vbscript
javascript
javaapplets
activexcontrols
win16
wap

almostbob 866 Retired: passive income ROCKS

proof read looking for what
what errors is it kicking
what is the table structure its supposed to be accessing

what are you intending to do if $num_rows > 1

almostbob 866 Retired: passive income ROCKS

IE puts the border inside the measured space
width:50; border:2; in IE means the width is actually 46 plus a border
Mozilla puts the border outside the measured space
width:50 border:2; means the div is 54 wide, and the right margin is pushed 4px out of visible space,
the border is likely there, but invisible
much of development is fudging the difference between IE and mozilla,
I use a javascript to check for browsertype where there are obvious problems, its not perfect, but.. neither are the browsers and doesnt work at all where javascript is disabled.
There is a tutorial on Mozilla's document model on the mozilla help pages

<script language="javascript" type="text/javascript">
<!--
(document.getElementById) ? dom = true : dom = false; //test for IE
 if (dom) {document.write('style="width:50;"'}
else {document.write('style="width:56;"') }
//--></script>

code has not been tested for your purposes it is presented as an aide to problem solving

almostbob 866 Retired: passive income ROCKS

http://www.go4expert.com/forums/showthread.php?t=1472
tutorial & script, based on windows versions
other OS exist, and can be validated by checking $_SERVER['HTTP_USER_AGENT'] string for substrings.

almostbob 866 Retired: passive income ROCKS

if the script is on your server, its the new version as soon as you upload it.

for a script used by somebody else
code the version number into the script as a variable $version=2.01; make a folder on your site accessible to outside scripts example version put a file in itexample current_version.txt contents only the current version number example 3.01 in your script
do something like

$version=2.01;
$today = getdate();
if($today['mday']== 1){
echo 'checking for updates..';
$current_version=file_get_contents( 'http://www.mysite.com/version/current_version.txt');
If($current_version > $version) {
echo 'There is a newer version of this script available, please update at'; /* whatever */
}
elseif($current_version < $version) {
echo ' You are running a beta script, are you sure? Restore the latest stable version at'; /* whatever */
}
else {
echo 'You are running the current version';
}
}

/* all sorts of script code,
this code scrap can be in your admin page,
attached to a button,
you can have your install script code the mday of the installation into the script so it checks on the montly anniversary,
stagger out your server loads so as not to tie up the first of the month so much, whatever */

almostbob 866 Retired: passive income ROCKS

Sitelinks are additional links Google sometimes generates from site contents in order to help users navigate your site. Google generates these sitelinks periodically from your site's contents.

Because we generate sitelinks dynamically, this list can change from time to time


Example Search ResultThis is an example of what a search result with sitelinks looks like. The sitelinks are displayed below.
www.example.com/ - 10k - Cached - Similar pages
Sitelinks
News
Games
People and Places
About Us Latest Additions
Music
Photography
Movies
More results from example.com

Google has not generated any sitelinks for your site. Sitelinks are completely automated, and we show them only if we think they'll be useful to the user. If your site's structure doesn't allow our algorithms to find good sitelinks, or we don't think that the sitelinks are relevant to the user's query, we won't show them. However, we are always working to improve how we find and display sitelinks.

good webmaster tools helpscreens
If you havent already, get a google webmaster account and see how google is indexing your site, and correct any faults for SEO

almostbob 866 Retired: passive income ROCKS

Is this the type of effect you want to achieve (screenshot attached below)
There are very good tutorials in the Google api
http://code.google.com/apis/maps/documentation/

If I can follow, anybody can.
the api code you get is site specific it will not work on your development desktop
the script and basic sql for the IP-geocode is available at http://frikk.tk/comments-274-03.18.06.htm, and phpclasses.org, but frikk has better instruction

almostbob 866 Retired: passive income ROCKS

I only have one image, twice the size of the button, with two states/pictures in the image, and css position it up for the up and down for the down.
Never learned to erase either {:(

almostbob 866 Retired: passive income ROCKS

Iagree with midimagic, and at the other end of the scale
a blackberry
footer 100px high, and a
header 100px high,
20px of useful data and ya cant get that **expletive deleted** off the screen,

almostbob 866 Retired: passive income ROCKS

I have some important PHP scripts on my server.
My problem is that with the help of a download manager, the user can download those scripts and thus can view the entire source code.

For e.g:- If my php script's URL is
www.mydomain.com/index.php

Then the user is able to download the "index.php" script by entering the above URL in a download manager and thus seeing how the coding is done.

I do not want the users to be able to download the scripts.

Please suggest me a solution for it.

That magic download manager,
every site downloader I have only gets the output html,
I scraped my own site,
the php is not seen.

almostbob 866 Retired: passive income ROCKS

a dirty kludge to make files appear to load faster than the connection speed allows
javascript in the end of the page to load known required files before the link were clicked, but after the page is displayed
ignore image, its just you have to load the file for "something"
puts enough of swf or mpeg into the buffer before the button is clicked that play begins immediately
viewers forgive a lot if they dont see the waiting sign

</body>
<script language="javascript" type="text/javascript">
//<![CDATA[
<!-- 
file1 = new Image();
file1.src = "anyfileyouwant.anyfiletype";
//-->
//]]>
</script></html>

as long as you dont try to display the swf as an image, you can callit what you like, it will still end up in the tif

almostbob 866 Retired: passive income ROCKS

<link rel="SHORTCUT ICON" href="images/myicon.ico" />

Try <link rel="shortcut icon" [B]Type="image/x-icon"[/B] href="[B][url]http://www.mysite.com/[/url][/B]images/myicon.ico"> IE can be picky

almostbob 866 Retired: passive income ROCKS

as one page it will be a time consuming download, users click away
small pages load fast,
preloading the next page to give speed can be accomplished by a script in the foot of the page
reuse of icons and scripts between pages shortens load times again.

almostbob 866 Retired: passive income ROCKS

show the code that you want examined, the site only shows output

almostbob 866 Retired: passive income ROCKS

And
validate the form on submit,
and if any field fails validation
you send the form back for correction/resubmit

almostbob 866 Retired: passive income ROCKS

Why not echo $username and see what is being posted

<?php
if isset($username) {echo $username; }
If (isset($_POST['username']))
 { echo $username."was posted";
 echo "Username Entered"."<br />"; }
Else  { echo $username."was posted";
 echo "Username Not entered"."<br />"; }
?>
almostbob 866 Retired: passive income ROCKS

Every post, almost, has explained what to do

  • Establish a convention for naming the files from your cms
  • establish a rewrite rule that matches the naming system used

done
Nobody can do it for you, and have tried to explain the process
dont know the names used already
but the thing to do is Stop
until you read the manual and understand it on rewrite, everything you do will make it harder to undo.