Script School Student Workshop Logs
Home $ News @ LIVE Tech Radio $ PHP Course @ Perl CGI Course $ Enroll @ Support/FAQ $ Store

Script School is made possible
by these fine sponsors

Enroll Today here!


The following (edited) log is for the "How to build a Clicks Out" Course Week #2 

Session Start: Tue Mar 05 13:27:28 2002
Session Ident: #scriptschool
*** Now talking in #scriptschool
*** Topic is 'Week #2 Clicks Out Course Live audio review: $$ Script School - Learn More so you can Earn More $$$ Next Show: Friday Mar 1, 2002 2pm PT / 5pm ET'
*** Set by Kenny on Fri Mar 01 21:25:41
-Kenny- Welcome to TDavids Script School. Brought to you by Webmaster Live, Albumside and Your Host, TDavid!

*** Kenny sets mode: +o TDavid
*** TDavid sets mode: +v hwyman
*** ssjanitor has joined #scriptschool
*** TDavid sets mode: +o ssjanitor
*** TDavid sets mode: +v TDavid
*** TDavid sets mode: -o TDavid
*** Retrieving #scriptschool info...
<hwyman> hello peoples
*** ssjanitor changes topic to 'Week #3 Clicks Out Course Workshop review: $$ Script School - Learn More so you can Earn More $$$ Next Radio Show: Friday Mar 8, 2002 2pm PT / 5pm ET'
<TDavid> hi hwyman :)
<TDavid> did you do your amazon shopping?
<hwyman> I stashed it in an account I created there
<TDavid> all kinds of goodies to find there ;)
<TDavid> i'll be back in about 20 minutes, i have to finish troubleshooting something with a client
<hwyman> I thought I would sit down with the wife...when she wasn't working...and tug back and forth with her over tupperware and php books
<hwyman> lol
*** Frank has joined #scriptschool
*** ssjanitor sets mode: +v Frank
<TDavid> hey frank :)
<Frank> hi TDavid!
<TDavid> you can always tell when the material starts getting more difficult, lol, i'm proud of you guys for being here ;))
<hwyman> this place rocks in my book
<Frank> yea, I finally had a chance to browse over week 3 last night,LOL, getting alittle hairy. But I've never done a script in my life so I know nothing, hehe
<Frank> Hiya hwyman
<hwyman> hey Frank
<TDavid> well hopefully the workshop today will help clear things up for ya frank
*** jvastine has joined #scriptschool
*** ssjanitor sets mode: +v jvastine
<Frank> Been having alot of personal issues to distract me lately. But I'm trying to keep up the best I can TD.
<Frank> Hi jvastine
<Frank> There's no audio on Tuesdays?
<hwyman> Frank me neither. but I get by on html but cgi access races my mind
<jvastine> Hi Frank - I can relate to that!
<TDavid> hello jvastine! :)
*** venturi has joined #scriptschool
*** ssjanitor sets mode: +v venturi
<Frank> Hiya venturi!
<TDavid> hello venturi :)
<venturi> Hiya folks.
<jvastine> hi TD, it's been one hell of a week.
<jvastine> hey venturi
<hwyman> hi Venturi
<venturi> yes it certainly has jvastine
<Frank> Anyone wanna trade problems, lol
<venturi> and I'm STILL recovering from it. *grr*
<TDavid> yeah what's the story jvastine, we missed ya on Friday :)
<TDavid> hope all is well with you?
<jvastine> yes, I had to tear my system down...3 #@&%#@! times!
* TDavid will remove this part from log
<Frank> lol
<hwyman> hiya jvastine
<venturi> hehehe, I got one better... lol
<jvastine> got a worm thursday...memory chips failed...etc...etc..
<venturi> ouch. :(
<jvastine> hey hwyman
<Frank> yup, that sucks for sure.
<TDavid> ok i noticed nobody has done the assignment yet, so let's hear the excuses hehe :)
*** hwyman has quit IRC (QUIT: User exited)
<jvastine> and if you take windows over128megs of ram it starts choking!
<venturi> Umm... well, my host crashed on Friday morning, and I am still putting the pieces back together. Didn't even have ftp access back there until sometime yesterday evening.
<jvastine> well TD, I had no system...shit, I still have to post week 2.
<venturi> Homework is written, but not tested.
<TDavid> those are both excellent excuses! lol
<TDavid> frank, what's your story?
<jvastine> yes, my host is turning out to unreliable...
<venturi> My cgi is still completely FUBAR, and as a result my banner rotation database is completely corrupted.
<Frank> no excuse, just got a late start. I'm still trying to figure out what exactly it is to do,lol
<jvastine> sounds like fun venturi
<venturi> hehehe, only if you enjoy the sensation of poking your eyes with sharp sticks. LOL
<TDavid> well i suspect that you aren't the only one, because the material this week begins to have more meat on it
<TDavid> shall we get started?
<venturi> sure! :)
*** hwyman has joined #scriptschool
*** ssjanitor sets mode: +v hwyman
<Frank> oh yea
<hwyman> re all
<jvastine> might as well!
<TDavid> reference for material is here: http://www.pornresource.com/scriptschool/week3.php
<TDavid> the purpose this week is to decide upon a file system to use for this project
<TDavid> and to discuss the pros and cons of each scenario
<TDavid> i don't discuss every type of database or file scenario, i just concentrate on two general types
<TDavid> because if you understand the two general types you can make a fairly educated decision on which to use
<TDavid> for a specific project
<jvastine> well stated.
<TDavid> and also the purpose of this week's project is once the filesystem is chosen, to begin to code the for the click.php
<TDavid> it will be finished in week 4 and possibly revisited once more in week 6 for some final enhancements (advanced)
<TDavid> so let's start with analyzing the differences between a flatfile and a database
<TDavid> the pros of a flatfile
<TDavid> - Does not require additional database software installed on server
<TDavid> - less overhead connecting to smaller sized files
<TDavid> - faster and more efficient for accessing smaller data sets
<TDavid> - easy to backup, copy files
<venturi> simplicity.
<TDavid> that's another good one
<TDavid> although i resisted using that because the code to communicate (read/write/append) is not as simplistic
<TDavid> in my opinion anyway as connected to a database
<venturi> :) I thought about that point right after I hit the send key.
<TDavid> there are additional issues that a database covers up that you have to deal with on the coding end
<TDavid> the issues are all there, but they are covered inside the way a database engine works
<TDavid> and in a database you would simply QUERY INSERT or DELETE to do the majority of what you need to do
<TDavid> it's like one line of code and very easy once you get the hang of it
<TDavid> now queries themselves can become very complex, so I'm not trying to say that using databases is necessarily easier
<TDavid> but if you look at the code we'll be doing in week 4 versus the same code to say update a mySQL database, you might wonder why we'd not do it in mySQL
<Frank> hehe, man don't go there I don't even know what mySQL is,lol
<venturi> :) you can code MySQL all day, but it don't do any good if ya ain't got a dB. LOL
<TDavid> so i guess we've sort of been talking about what are the cons of a flatfile system. and here they are:
<TDavid> - semiphores (filelocking) can be a major concern
<TDavid> - corruption of data can occur if too much access on large files
<TDavid> - slower to process relational queries
<TDavid> - read/write required to process, instead of write-only capability of database, thus increasing the size of the code to process data changes
<venturi> btw, Tev can't make it today. Tied up with stuff.
<TDavid> okies
<TDavid> thanks for the heads up :)
<venturi> I won't quote what he actually said. lol
<Frank> lol
<TDavid> when you hear someone say semiphore, you can say "filelocking"
<hwyman> semiphores (filelock) looked in dict but still don't understand what u mean there
<TDavid> it's the fancy techno geek way of describing locking down access to a file so that another process cannot do anything with it
<hwyman> oh that makes sense
<hwyman> thanks
<TDavid> you'll see it referred to in many technical articles, books and otherwise
<venturi> think of it as the key to the bathroom at the gas station. There's only one.
<TDavid> the purpose of a filelock is quite important because if while you are writing someone else is reading you can lose data
<TDavid> which can be especially important in a counter
<hwyman> therefore courption maybe
<TDavid> usually lost counts, but sometimes corruption
<TDavid> if the file size is large ... then almost certainly corruption
<hwyman> um
<TDavid> yes?
<TDavid> corruption of data can occur if too much access on large files <--- that's the next issue
<TDavid> this is huge if you are dealing with a daily log file
<TDavid> (which we will be)
<TDavid> fortunately we are going to structure our logfile so it is append only by the frequent option
<TDavid> er frequent access that was
<TDavid> therefore no need to lock/read/write/unlock
<hwyman> sort of like a diary
<TDavid> however the penalty is we'll need two separate file operations for each incoming click
<TDavid> one to track in a file and increment a global counter, the other to append the general logfile
<Frank> not to get ahead but I keep reading this weeks code over and over and trying to figure out what all it is doing.
<TDavid> we'll get there, frank, i promise ;)
<TDavid> the trick here is as long as we aren't hitting the *same* file repeatedly and that same file is not very large in size, the repetitive nature of doing this
<TDavid> will not matter
<hwyman> thinks un scramble the eggs
<TDavid> slower to process relational queries <--- the other CON
<TDavid> we aren't going to be making many relational queries -- but when we do they will be done in the admin area
<TDavid> they will be slow to build based on this model we are building because the data will not be contained in one file, but many files
<TDavid> ie. if we are wanting to know how many click outs for a specifiic link during a specific amount of time
<TDavid> we'll need to run through the log file archives seeking for the logs of the links
<TDavid> if it is 10 days, that
<TDavid> is 10 files
<TDavid> 100 days, 100 files
<TDavid> so you see what i mean by "relational" query in week #5 and 6
<TDavid> so the solution arrived at here is to go with the flatfile model
<hwyman> yes
<TDavid> knowing that there are drawbacks
<TDavid> knowing that there are certain downsides
<TDavid> now it as a matter to build something that deals with those issues
<Frank> <<<< knowing that many of us have never done one ounce of code and it's all greek (go with the simplest) hehe
<TDavid> i'm not going to get into the database stuff too much because we aren't going to build a database filesystem
<TDavid> frank, the important stuff really up to this point is the planning
<TDavid> kind of like you might do when deciding to build your next website
<TDavid> it's not all that different
<TDavid> might seem that way, but it isn't really :)
<TDavid> we've really done very little amount of coding and the course is roughly half over
<venturi> how you structure your data in the beginning will determine how severe your headaches in coding are later. ;)
<jvastine> queries can get rather complex
*** venturi has quit IRC (Connection reset by peer)
<TDavid> so you all understand that we are going to have 2 different files. Only one of them was discussed in the course text this week. the other will be discussed next week
<Frank> yea, I've heard that alot and I can understand why. You gotta have the plan of what you wanna do and kinda work backwards in a way I guess to plan how to get there.
<TDavid> I left the other out to cut down on confusion
<TDavid> so here is what happens to the surfer
<TDavid> they come to your page
<TDavid> they click a link in a special format
<TDavid> they goto the script
<TDavid> the script checks the link format
<TDavid> checks WHERE the link is coming from
<TDavid> determines what file to count the click in by page
<TDavid> logs the click in a general daily click file (append only)
<TDavid> redirects the surfer to the page
<TDavid> seems like a lot, but will all happen in less than a second
<TDavid> as long as we keep the file size down, and the server is unburdened of course
*** Ludo has joined #scriptschool
*** ssjanitor sets mode: +v Ludo
<TDavid> hello ludo
<hwyman> I like that last part...server un
<Ludo> Hello Tdavid
<Frank> Hi Ludo
<jvastine> hey ludo
*** venturi has joined #scriptschool
*** ssjanitor sets mode: +v venturi
<hwyman> hi Ludo
<TDavid> that's an important point, no matter how good your script is, if the server you are on blows, the script will blow too
<Ludo> Hey Allll ;-)
<TDavid> it's like trying to run in water
<jvastine> wb venturi
<venturi> thanks. did I miss anything?
*** Ludo has quit IRC (QUIT: User exited)
<TDavid> not too much :)
<hwyman> I can relate to running in water I used to be on a swimming team
<TDavid> so does anybody have questions with how this will work for the surfer and what the click.php will do? (we'll discuss the actual code in a minute)
<TDavid> or why it is going to do it?
<jvastine> it's clear.
<Frank> no, think I got that so far,lol
<hwyman> I understand I think..we send the surfer he sends not himself
<TDavid> good, frank that's important :)
<TDavid> how many of you would like to track pages that are deep buried in subdirectories?
<TDavid> perhaps you buy one domain and use it for building many websites
<TDavid> and you might want to track pages from galleries in several different subdirectories
<jvastine> eventually I will.
<Frank> yep
<TDavid> for security reasons we are going to limit all file writing/reading to one directory
<venturi> some TD
<hwyman> k
<TDavid> you don't have to do this, but you don't want to let the enduser have much input ever in determining where files will end up on your server
<TDavid> one of the characteristics we're going to examine is the environment variable, HTTP_REFERER
<TDavid> this is not a variable that can be trusted with 100% accuracy
<TDavid> with anonomizers and spoofers I've seen claims that it is 85-90% accurate at best
<TDavid> however, if someone is going to hijack your click counting code, spoof the referring url, just to fake your click stats, well, I don't know that this is the end of the world
<TDavid> unless you are paying people based on these clicks
<TDavid> so keep this in mind as a potential security threat
<Frank> ok
<TDavid> and don't use this script to compensate people for what they send you, unless you employ additional security to make sure the click is coming from where you expect it is coming from :)
<TDavid> although most people don't really care where the click comes from, though do they? a click is a click if they get to your site and actually do something lol
<Frank> hehe, if i was using a code that had to do with money exchanges I surely would "hire" you to do me one,lol
<TDavid> again, i realize the purpose here is track clicks LEAVING your website
<venturi> Knowing where the traffic came from can be a good thing though, if you're evaluating the quality coming from various TGP's, etc.
<TDavid> ok, enough of the weaknesses of the environement variable HTTP_REFERER
<TDavid> you understand it's limitations yes?
<venturi> yep
<jvastine> correct
<Frank> yup
<hwyman> yep
<TDavid> ok, well with that said, we're still using it, lol
<Frank> I think for a simple "get your feet wet" type script this is gonna be cool.
<TDavid> but what we're using it for is a means of helping to categorizing where to store a "page" clickthru rate
<TDavid> so if your page is located at:
<TDavid> domain.com/amateurs/index.html
<TDavid> that would be a long filename if we appended with .txt at the end
<TDavid> domain.com/amateurs/index.html.txt
<TDavid> you can imagine how we'd end up with some seriously long filenames
<TDavid> and if there was a hack or anonymizer, it could even overflow the file character limit
<hwyman> yes
<TDavid> which could/would cause problems
<TDavid> so we can't just take the value of the WHERE THE SURFER CAME FROM (HTTP_REFERER)
<TDavid> we instead must develop some kind of code for it
<TDavid> i came up with one possible scenario. There are plenty more
<TDavid> my scenario in the course text is not infallible
<TDavid> it is not intended to be
<TDavid> it is an example of a concession
<TDavid> of a breakdown
<TDavid> in that it's not perfect, but it is going to be good enough for our purpose
<TDavid> in general
<TDavid> let's go back to this example:
<TDavid> domain.com/amateurs/index.html
<TDavid> can we have another file like this:
<TDavid> domain.com/amateurs/index.html
<TDavid> ?
<hwyman> yes
<venturi> not unless you have some issues with your drives/OS. lol
<TDavid> you are right venturi - the same filename in the same filepath cannot exist
<Frank> hummm, seems any duplicate files may cause problems
<hwyman> oh yea I see
<TDavid> so what I propose is instead of including the actual subdirectory names, is to count the number of all subdirectories and the number of characters for each subdirectory name and use *that* as the unique filename
<TDavid> domain.com/amateurs/index.html
<TDavid> domain.com/skankys7/index.html
<TDavid> in the model i propose
<TDavid> both of the clicks from links from those two same pages would be stored in the same file
<TDavid> why?
<venturi> directories have the same length
<jvastine> same # of characters & directories
<TDavid> while this might seem like a bummer, how often do you think this will actually happen with your websites and directories?
<venturi> depends. for TGP gallery makers it could be significant, due to cloned pages.
<Frank> hehe, I have alot of site url that would be the same # of characters etc... but I can live with it.
<venturi> does php have a crc function?
<TDavid> so same domain, and same subdirectory, AND same page name, frank?
<venturi> if so, you could calculate the crc value of the dir/file.html
<TDavid> keep in mind
<Frank> no, I was speaking of number of characters like your examle above
<TDavid> domain.com/amateurs/index.html
<TDavid> domain.com/skankys7/gallery.html
<TDavid> are 2 different pages
<TDavid> domain2.com/amateurs/index.html
<TDavid> domain.com/amateurs/index.html
<TDavid> 2 different pages
<TDavid> domain.com/amateurs/index.html
<TDavid> domain.com/amateur/index.html
<TDavid> 2 different pages
<TDavid> very subtle differences there, but all would generate different file writes
<TDavid> domain.com_3_8_index.html.txt
<TDavid> domain.com_3_7_index.html.txt
<TDavid> almost the same size when you anaylyze only one subdirectory
<TDavid> but it gets more pronounced with 3 and 4 and 5 subdirectories
<TDavid> domain.com_3_7_4_7_8_3_index.html.txt
<TDavid> you might note that we are using the underscore character as a delimiter
<TDavid> so that we can reassemble this "code" later if neccessary
<TDavid> er, when necessary
<TDavid> note, the only reason this is being done is to eliminate the possiblity of too long filenames being created
<TDavid> ALSO, and the more important reason for you the webmaster
<TDavid> "how do I implement this script into my existing websites?"
<TDavid> the easiest, most hassle free way to do so, is a simple search and replace with any text editor
<TDavid> where we just append the code for click.php at the beginning of your actual a HREF link
<TDavid> so href="http://www.yourlink.com/yourpage.html" becomes
<TDavid> href="http://www.yourdomain.com/click.php?http://www.yourlink.com/yourpage.html"
<Frank> this may get exciting, I've never done a search and replace,lol
<TDavid> this make since?
<TDavid> er sense?
<TDavid> lol
<venturi> lol Frank.
<venturi> yes, makes sense.
<hwyman> I can see us doing this
<TDavid> if we used an ID scheme then the upside is we wouldn't have to worry about having to figure out what page the person was on
<TDavid> but the DOWNSIDE is that we'd have to enter in each link into the admin area first to make an ID
<TDavid> we all are much too busy to spend a lot of time doing that lol
<TDavid> but i think we can upload 3 scripts, run a search and replace on the pages we want to track and have it work, yes :)
<Frank> what do you use for your search and replace?
<TDavid> you can use any text editor ... wordpad has replace function
<venturi> UltraEdit32 <-- the bomb for multiple file search & replace. :)
<TDavid> a great suggestion :)
<Frank> ok
<venturi> it even let's you do regex comparisons
<TDavid> ok i'm running over, should I hold over discussion on the code, or you guys want me to continue?
<venturi> I'm okay to stay. All I have to look forward tonight is to uncorrupt a database. LOL
<Frank> I'm game, lol
<jvastine> what ever you prefer.
<TDavid> okies, line 1 in the code i offered up:
<TDavid> // define filename
<TDavid> $filename = '';
<TDavid> well not technically line 1 but the new line anyway
<hwyman> thanks yes
<TDavid> all we are doing here is making sure that filename is defined as having an empty value
<TDavid> to start out with
<TDavid> we don't want filename to start out with any garbage and since php transfers query string values into filenames someone could do this:
<TDavid> click.php?filename=myfilename.php
<TDavid> if we didn't have that filename='' in there then
<TDavid> our filename would start out with the value of "myfilename.php"
<TDavid> we don't want this, of course
<TDavid> so we define the value to begin as empty
<TDavid> make sense?
<Frank> yup
<venturi> yuppers
<hwyman> yep
<TDavid> // break apart query string
<TDavid> $sendto = explode('?', $HTTP_SERVER_VARS['REQUEST_URI']);
<TDavid> this line separates out the query string from click.php
<TDavid> and puts into an array with the name of $sendto
<venturi> so, REQUEST_URI is a predefined element?
<TDavid> yes, it is server requested and cannot be as easily manipulated by spoofing techniques
<hwyman> cool
<TDavid> this info is vital for the next line where we decide if we are looking at a url or not
<TDavid> // is there a url to send click to? (very basic regexp example, you can do better)
<TDavid> if(ereg("^http://(.+)", $sendto[1])) {
<TDavid> -
<TDavid> -
<TDavid> this is not an example of a very good regular expression
<TDavid> i'm kind of hoping you guys will try to improve upon it :)
<TDavid> all it checks for is that the string starts with http://
<venturi> hehehe. be afraid everyone. LOL
<TDavid> which *might* represent a good url
<TDavid> but then
<TDavid> http://123
<TDavid> would match
<TDavid> http://1
<TDavid> would match
<TDavid> http://
<TDavid> would match
<TDavid> you see the point ;)
<TDavid> I could have provided you with a better one, but that is part of the program here, to try and hunt down or create some better code :)
<TDavid> you can use mine and it won't be the end of the world, but you should realize that having it as is doesn't mean you won't be screening for a good url to redirect to
<TDavid> and if you try to redirect to a "bad" url then you will end up with a dead clickthru of course
<TDavid> ok any questions with this line?
<TDavid> if you need help with regular expressions, you can visit the first php course, there is much more discussion on them there
<hwyman> I was thinking of going there...soon
<venturi> none that won't require re-reading up on regex
<TDavid> ok the next line then
<TDavid> // if referer has value then process\
<TDavid> $refer = $HTTP_SERVER_VARS['HTTP_REFERER'];
<TDavid> this is where we get WHERE the click is coming from
<TDavid> which is the HTTP_REFERER environment variable
<TDavid> and we assign it's value to the variable $refer
<TDavid> any questions on this line?
<Frank> not so far
<venturi> with ya. :)
<TDavid> if($refer != "") {
<TDavid> this line is our trap for an empty referer
<TDavid> meaning if someone just types in your click.php code guess what happens?
<TDavid> or tries to bookmark it somehow?
<Frank> hummm, gues it would get logged?
<TDavid> you can redirect them to another location of your choosing because that click is not from a "page"
<Frank> auuu ok
<TDavid> each of these traps presents an optional place you can send these surfers
<hwyman> I get it
<venturi> our just log it separately, but still send them off to make me money. :)
<hwyman> thinks send em to jail
<TDavid> this is a seldom heralded built-in php function but quite useful:
<TDavid> $url = parse_url($refer);
<TDavid> what this does now is parse the sections of the url. details on this function are provided at php.net here:
<TDavid> http://www.php.net/manual/en/function.parse-url.php
<TDavid> the referring url, that is
<TDavid> // will contain the contents of the referring url
<TDavid> $paths = explode("/", $url[path]);
<TDavid> $url[host] $url[path] <-- are both created by the parse_url($refer) function
<Frank> do we suppose to replace that php.net url with something?
<TDavid> replace with something? no, that is for more information on the parse_url() function itself
<TDavid> in case you don't quite understand what it does or why it does it
<Frank> ok
<TDavid> $url[host] $url[path] <-- are both created by the parse_url($refer) function
<Frank> thoug hti may be a place for a "redirect" url or something.
<Frank> thought it, damn, can't spell
<TDavid> $paths = explode("/", $url[path]);
<TDavid> that line is what explodes the path into components for assembling the filename
<TDavid> in the "code" that I discussed earlier
<TDavid> // the number of subdirectories + 1
<TDavid> $sizepath = count($paths);
<TDavid> this is for how many subdirectories there are -- the count() function counts the number of items in the array $paths which was created in the line ablve
<TDavid> er above
<TDavid> the delimiter was the / -- because that is what separates directory names
<TDavid> still with me, everyone?
<Frank> yup
<jvastine> yeah
<TDavid> $filename = $url[host] . '_' . ($sizepath-1) . '_';
<hwyman> yea
<venturi> yep. so if the path was amateurs/tgp/clones/index.html ... count() would return 4
<TDavid> this illustrates concatenating (or joining) a string and assigning the value to $filename
<TDavid> this sets our filename to the DOMAIN_#_
<TDavid> (replace # with the number of subdirectories + 1)
<hwyman> '_'
<TDavid> kind of looks like an alien expression doesn't it? lol
<hwyman> yep
<TDavid> hehe, ok the next line is where we cycle through each subdirectory and count the characters of each directory name
<TDavid> // get character count for each
<TDavid> for($i=1; $i<$sizepath-1; $i++) {
<TDavid> $filename .= strlen($paths[$i]);
<TDavid> $filename .= '_';
<TDavid> }
<TDavid> strlen() is the function which gets the strings length
<TDavid> and then appends another '_' at the end
<hwyman> I c
<TDavid> the .= means to add to and reassign
<TDavid> it is the same as saying $filename = $filename . '_';
<TDavid> just a shorter way of doing so
<TDavid> it's a good shortcut assignment to learn
<TDavid> you cannot do this though, so be careful
<TDavid> $filename .= strlen($paths[$i]) . '_';
<venturi> does strlen() clean off leading/trailing blanks? didn't see that in the documentation
<TDavid> no, it doesn't
<TDavid> it counts characters, including whitespace
<TDavid> in a string
<TDavid> but we are not expecting to find empty space inside a url
<hwyman> thanks for the help u a all
<Frank> you leaving hwyman?
<venturi> true, i was just being anal TD. :)
<TDavid> the last lines:
<TDavid> $filename .= $paths[$sizepath-1];
<TDavid> $filename .= '.txt';
<TDavid> that just appends the .txt to the end
<TDavid> and the pagename first, that is
<TDavid> then there are closing braces for the traps we talked about above
<hwyman> no still here just can't know all the questions. and happy when Vent asks one lol
<venturi> hehehe
<TDavid> hehe
<Frank> yup, I'm just tryong to follow along,lol
<TDavid> well that's all i really have unless you guys have any general questions
<TDavid> i'm 45 min over
<hwyman> I like how this stuff fits together
<TDavid> sorry bout that hehe
<venturi> no problem TD. good chat! :)
<jvastine> whatever works TD, it's all good!
<TDavid> next week we finish the click.php code and actually do the file writing to the two files we discussed
<Frank> looks goos TD. Seems we just take what you have there and type it into our existing click.php file
<hwyman> thanks TDavid everyone I got a lot out of this session
<TDavid> well, that's one way to do it, Frank
<Frank> yup, been a learning experience for sure, always good.
<jvastine> cya hwyman
<TDavid> like i said at the beginning, the worst you'll be for the wear is coming out with a script you can use on your websites for free :)
<Frank> lol, I'm just trying to learn the basics. Don;t know enough to try to change much right now,lol
<TDavid> that's cool :)
<TDavid> I'm showing one way to walk through the forest
<Frank> yup, lol
<venturi> yep. :)
<Frank> ok, I'm heading out then, been great, see ya folks later!
<TDavid> cya all this friday! :)
<venturi> me too. I'm off to un-corrupt stuf. LOL
*** Frank has quit IRC (QUIT: User exited)
<TDavid> thanks for coming!
*** venturi has left #scriptschool
<jvastine> I'll be there...if this damn machine holds together!
<TDavid> good luck with it :)
<TDavid> i'm back to work now
*** TDavid is now known as TD-workn
<jvastine> thanks TD!
*** jvastine has left #scriptschool
*** hwyman has quit IRC (QUIT: User exited)
*** Disconnected
Session Close: Tue Mar 05 16:00:02 2002



 

Amazon Honor System




Copyright 2000-2008 KMR Enterprises
Privacy Statement