Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. cookies could remain on teh client... but then they have control. the most you would be able to do is a) set a cookie or b) ask them to login to be able to access your site.. which is imparactical in many cases. If you set a cookie, then set it with a very long random sequence of numbers - ensure its unique to a database, and ten store the value in a database of flat file. each time a page is viewed - check to see if that unique value is in the cookie or stored on your server.. and if it isnt then set it. Thats the only way. gdlk
  2. although books can be outdated - PHP5 for dummies i bought ( ages) ago, and although its going to be partially out of date when php6 is released, its fantastic for easily being able to flick back to the argument list for all the string formatting functions - or timestamp issues... or even things like OOP syntax etc. sure books get out dated, but their fantastic for learning a langauge - even if you never use it later, invest in teh $40 or $50 and get a good php books. gdlk.
  3. well if you are running this like nightly or weekely etc - set the script up as a cron. If its a download page where you download the file, and then the client downloads from you... hten just do the header() to force the download dialog - and then display a page, even with simple content like: "Your douwnload should start in 30 seconds... etc etc ".... gdlk
  4. oh yeah - of course sry ( very tired here lol)... try : echo "YOUR STRING"; ie - an dlaternative to print gdlk
  5. I know how to do conditions etc ive been workign with them non stop for 3 days my questions is what should my cindition ( or SQL function etc) be to ensure that it completely ignores locations, and simply lists teh areas etc? Thanks
  6. Hi, Ive got a table of only 4 fields - but within a month will contain hundreds or thousands of records etc. My Fields: `Location_ID`, `Item_ID`, `Area`, `Location` the reason that there will be so many fields in such a short period of time, is that for every item there can be 10 or so areas, and for every area, there can be 10 or so Locations ( think of it as listing cities, and locations in cities) I want to be able to simply gather a list of areas unique to that item. ie - ignore the Location and only use the Areas per ITem: "SELECT `Item_ID`, `Area_ID` FROM `item_loc` WHERE `Item_ID` = '".$ItemID."' WHERE... <condition>" ????? I dont know what to do with the condition. Thanks for your help in advace
  7. yes - semi colin:: ...... ....... ...... ....... ENROLL int( 10 ), ID int( 11 ), ID_MAJOR int( 4 ), ORDERCODE varchar( 25 ), ARO varchar( 20 ), ENTERED date, PRIMARY KEY(INDEXA))" ; <- You need the semi colin at the end of your string... otherwise any code after that will cause an unexpected <something> ; or . or , expected sort of error will ccur gdlk
  8. $handler = opendir($directory); // keep going until all files in directory have been read while ($file = readdir($handler)) { if(is_dir($file)) { ... do your stuff } } EDIT: YesI got that of google: "php, list directory files" - and of php.net documentation on files - ctrl + f "dir"........ check out the documentation there theres a large list of functiosn tha will help you.
  9. echo $_SERVER['SCRIPT_NAME']; echo "<br>"; echo __FILE__; echo "<br>"; echo $_SERVER['SCRIPT_FILENAME']; place that into a file to see different options. gdlk EDITED BY WILDTEEN88: Please wrap code within code tags ( ).
  10. well it look slike your somehow ending your string halfway through: '<a href="../imageupload/index.php" onclick="window.open(\' I dont use print, however that will be interpreted as onestring will it not. therefore your missing comma should bethe character after that. gdlk
  11. can you give us a list of expected input and output so we can see wht you want to be doing? thanks
  12. hmm first of all if your looking for recomendations/support on "CCLEAGUES", then you should post in the third part scripts board. I googled it - and it didnt appear to have any major links for it, so it doesnt look liek youll get good documentation ( though i really only did splay 5 seconds waiting for google and thats it). If your looking for a good system, probably open source then youll want somethign like: a google result: http://www.google.com.au/search?hl=en&q=php%2C+open+source+sports+management&btnG=Search&meta= http://sportstechnow.com/2008/04/24/score-os-open-source-fantasy-sports-management-system/ - looks ok - why not read more about that? as for offering support for a system - no one here will really officially support a particular script unless either a) they wrote it or b) their paid to. If you need to get some coding support for a system, or adaptations made - and you really arent interested in learning php.... then freelancing board is your friend. Plenty of people there will have a number of solutiosn to offer etc. Also, if your happy to do a lot of the points calculatiosn yourself ( or in excel or whatever), then maybe all you need is a form or CMS to do this, in which case SMF is awesome, and although i havent used them before: moddle and joomla might help you ( although i recomend you learn at least some basic php to use those). good luck.... edit: and be patient! most people here will read your post and go "wrong section" or "do your own research buddy"... so don texpect a reply so soon ( often youll have to wait at least a day for replies... sometimes up to a week on othe rboards around the place). edit(again):: DONT DOUBLE POST.... youve jsut poster a copy of this one into PHP installation which is also the wrong place. Maybe you shoudl read the boards descriptions before you post in there ( and thenread the guidlines?)
  13. *bump* i think i confused myself when i posted this ( and thats not a good thing!!!). here is my main question: if a client coonnects and enters a time (already in GMT).... the server is set a eg GMT -600, so that now returns the time at that timezone. when i convert times to GMT, does it treat my already formatted time as Timezone, and therefore adding 6 hours to it? I suspect that that is what is happening, and if so how could i help it ( assumign that my users/clients still enter data formatted to GMT)?
  14. Hi, Ive got my self into a pickle with times. IVe got a form where people enter the time/date of an event as GMT. it need it to store that timezone into the database..... ( its an INT field (yes Timestamp i know but anyway)) - and then it takes it out and compares it with a search term that is also in GMT. ie - all input/output and storage is in GMT. however my server is set to GMT -600 (http://wwp.greenwichmeantime.com/time-zone/usa/mountain-time/) now: Im placing my times in from GMT +1000, but ive converted them toGMT ( so instead of puting in 2100 i put in 1100 etc). I think my server is doign somethign weird with timezones. Could someone recomend a goot read through somewhere explaining the use of GMT and strtotime, date, gmmktime etc so that i can get my head aroudn this? Thanks
  15. ive got the following working 100%: <?php $OUTPUT = array(); $PAGE_LEVEL = 2; $_USER['doc_root'] = '../'; ob_start(); ### ### Main page output, start template buffering ### echo "Content part 1<br>"; echo "Content part 2<br>"; echo "Content part 2<br>"; $OUTPUT['CONTENT'] = ob_get_contents(); #$OUTPUT['CONTENT'] = "TESTING!!!"; #ob_get_flush(); ob_clean(); #ob_start(); require("../themes/template.php"); $OUTPUT['template'] = ob_get_contents(); ob_clean(); #ob_start(); require("../pre/crumbs.php"); $OUTPUT['CRUMBS'] = ob_get_contents(); ob_clean(); #echo $OUTPUT['template']."<br>"; #echo $OUTPUT['CRUMBS']."<br>"; $OUT = ""; #$OUT .= $OUTPUT['CRUMBS']; #$OUT .= "<br>".$OUTPUT['template']; #$OUT .= "<br>".$OUTPUT['CONTENT']; $OUTPUT['template'] = str_replace("[%CONTENT%]", $OUTPUT['CONTENT'], $OUTPUT['template']); $OUTPUT['template'] = str_replace("[%CRUMBS%]", $OUTPUT['CRUMBS'], $OUTPUT['template']); echo $OUTPUT['template']; #echo "This is my page What do you think?<br><br>"; #echo $_SERVER['SCRIPT_NAME']; #echo "<br>"; #echo __FILE__; #cho "<br>"; #echo $_SERVER['SCRIPT_FILENAME']; ?> I know its reasonably messy - but you can see that the template has [%.....%] markers, and thers where i customise my page. ive made use of the $_SERVER['SCRIPT_NAME'] variable to build the breadcrumb trail. I havent finished building all of the menus etc - but the templating is working. let me know what you think. *** Thanks to al the suggestions here - this is what im going with.
  16. yup - i usually do.. forgot this time ( been a whie since i was on here regularly) Thankyou!
  17. but if ive stored the output as a variable as i have done.. ( in the array)... it shouldnt really care whether its output to "echo" or otput to storage. * Ive tried a range of functions: ob_get_flush(); to get the contents, and that way i didnt have to clear the buffer and all sort of things. also - i tried commenting out all of the ob_clean();'s, and placed a single one after the echo $OUT; but it made no difference. Any other suggestions? Thanks
  18. Hi, Code: <?php $OUTPUT = array(); $PAGE_LEVEL = 1; $_USER['doc_root'] = '../'; ob_start(); ### ### Main page output, start template buffering ### echo "Content part 1<br>"; echo "Content part 2<br>"; echo "Content part 2<br>"; $OUTOUT['CONTENT'] = ob_get_contents(); #$OUTPUT['CONTENT'] = "TESTING!!!"; #ob_get_flush(); ob_clean(); #ob_start(); require("../themes/template.php"); $OUTPUT['template'] = ob_get_contents(); ob_clean(); #ob_start(); require("../pre/crumbs.php"); $OUTPUT['CRUMBS'] = ob_get_contents(); ob_clean(); #echo $OUTPUT['template']."<br>"; #echo $OUTPUT['CRUMBS']."<br>"; $OUT = ""; #$OUT .= $OUTPUT['CRUMBS']; #$OUT .= "<br>".$OUTPUT['template']; $OUT .= "<br>".$OUTPUT['CONTENT']; /* #$OUT .= str_replace("[%CONTENT%]", $OUTPUT['CONTENT'], $OUTPUT['template']); #$OUT .= str_replace("[%CRUMBS%]", $OUTPUT['CRUMBS'], $OUTPUT['template']); */ echo $OUT; ?> $OUTPUT['CONTENT'] isnt set - and doesnt display. eventually( as you can see from the commented out areas), Ill bs using the include files to replace content in a templat.... hence $OUTPUT['template'] Am I using the wrong function, or is there somethign else ive missed? thanks
  19. hmmmmm I thought id look at output buffering , because i know it captures output ( eg from echo etc)... and waiets for you to "flush" it beore it sdisplays...... I think thats what Ill do..... http://au.php.net/manual/en/function.ob-get-contents.php So ill program all my database stuff, and output.... something like: <?php start output buffering normal work require(template); output buffer then simply: </body> </hmtl> or whatever is needed?> I could also output body to a variable, and output menus to variables or use a combination of above.. .so what do you think of this?
  20. hmmm.. I dont particularly want to be using any prebuilt engines or setups ( otherwise id just use joomla or moodle etc). msn messaging to friends has said that option 2 is best, but that it woudl require custom error reporting ... so writing my own version of str_replace(); say i have template.php ( although my directory structure is a lot more complecated than that). If i was to go to login.php eg [domain]/login.php - i would want it to display using template.php in template.php, instead of having [CONTENT], would it be better to have: <?php require("login.php");?> ? See the only problem with this is that a) my urls would all be displayed as [domain]/template.php, whichi i dont want. also - my directory structures are ued to build teh breadcrumbs menu, so that would be likely harder, but whats your opinion? Is there a way that i can code it this way, but fool php into thinking that login.php is the actual running script? thanks
  21. Hi, Ive currently got a file that displays the page exactly how I want it, essentially a template. In it, wherever there are *unique* features, such as the page name, ive got: "[PAGE_NAME]". Im looking at different way sof diaplaying this on a large scale ( im building a CMS). as far as i know of ive got 4 options: 1. break apart the file into a range of smaller includes, and then build each page around that. 2. read that file and then use str_replace() to replace the unique parts 3. regular expressions???? ( not sure if they can replace text though). 4. Use a $PAGE array created elsewhere ( eg, in the CMS).... and have the template.php call the $PAGE values..... and then ocne proccessing etc etc is done, it simply goes: require(".../themes/template.php"); See where ive got the body of the page, its "[CONTENT]". I dont particularly want to have to use options one, because its harder to maintain ( i think). option 4 is ok, but what about an entire page's content? do you think thats getting unreasonable? Can anyone here offer a suggestion about how i shoudl be displaying this page? Thanks
  22. ** dont worry.... sry i looked into the manual, and tried the options of filenames: <?php echo $_SERVER['SCRIPT_NAME']; echo "<br>"; echo __FILE__; echo "<br>"; echo $_SERVER['SCRIPT_FILENAME']; ?> output: /tests/includes.php C:\xampp\htdocs\tests\dir\run.php C:/xampp/htdocs/tests/includes.php so i simply use 'SCRIPT_FILENAME' thanks ( I posted output for future referecne for people searchign forum Thanks:>:>:>
  23. oh - yeah .... sry didnt register to simply code the 2 lines of code... :|!! um - can i tell php in any way to use the filename of the script that has gone: require("ME???");??? Thanks
  24. Hi, if i am running a script from "..../www/update/index.php" and i include: "..../www/includes/login/login.php" or similar..... When I ask the login.php to display the script name, which URL will it display/use? will it display: ....../www/update/index.php or ..../www/includes/login/login.php? * context, im building a bread crumbs sort of menu. If it displayes the login.php directory, is there a way i can force PHP to return the file that called it??? Thanks
×
×
  • 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.