PC Nerd
Members-
Posts
1,122 -
Joined
-
Last visited
Never
Everything posted by PC Nerd
-
um.... front end design woudl be your problem, however: your AJAX woudl ask php for data, based on a timestamp value. your PHP would then query the database for things that happen + - 24 hours of that timestamp? and return then to AJAX in XML. sorry im not too good at this however i beleive thats the basics of it. gdlk
-
[SOLVED] changing a timestamp into a dropdown menu x3
PC Nerd replied to PC Nerd's topic in PHP Coding Help
**bump ** how can I do this? -
cheers
-
php6!!!!!! im just getting friends to move form version 4 - already!!! lol,thnkx btw how woudl you do it in php 6 - just out of interesnt????
-
** so i can jsut use a single index in PHP: $var = "string"; echo $var[0] ->> "s" ??? thnkx
-
well try echoing each line seperate and use the folliwng echo "<HTML etc etc value = '"$jobnum.."'>" thats the way i always do it - plus it helps to make your variabels easy to find in code because editors will color them as teh string, where as this way they will apear as variables gdlk
-
Hi, I was looking for functions in PHP thaty are similar to the ones on Python. specicically the way you can "index a string" in python: variable = "this string" print variable[0] -: t print variable[:5] -: this print variable[2:] -: string from there i can generate random numbers and basically come up with a complete string of random letters - from indexing the characters in the string How can i do this in PHP. i want to create a really long unique ID - so that i can use in in a database as email authentication -- except i want to create my own. hw can i create this indexing thanks
-
ok assuming that ALL your posts are in teh one table: SELECT post_ID from POSTS myslqi_nom_rows($QUERY_VARIABLE); as for the topics.... do the same thing but with a WHERE added to the query SELECT topic from POSTS WHERE topic == "XXX" gdlk
-
*** contact me http://www.phpfreaks.com/forums/index.php/topic,171257.0.html I can code this for you. also - try yourself - its always good to have a challenge gdlk
-
if your looking for somethign similar to what son phpfreaks? at the top of the page? PHP Freaks Forums > PHP and MySQL > PHP Help > Topic: Forum Breadcrumb trail - help! well personally what i woudl do is to have every page statically define its location. eg this page woudl define its name as "PHP Freaks Forums > PHP and MySQL > PHP Help > ***". then what you woudl do is have a function that finds *** and replaces it with a $PAGE_NAME variable - or the name of a post or whatever. another way you coudl do it is to have each new level in a new directory from teh root etc. then you could simply play with your directories in PHP using **slice()???*** and then post it like that. this way would work best becase you could change directories etc and you woudlnt have to change any code gdlk
-
after scanning the post is thsi what you want: $IMAGES[1]['name'] = ""; $IMAGES[1]['URL] = ""' $IMAGES[1]['location'] = ""; $IMAGES[2]['name'] = ""; $IMAGES[2]['URL] = ""' $IMAGES[2]['location'] = ""; $IMAGES[3]['name'] = ""; $IMAGES[3]['URL] = ""' $IMAGES[3]['location'] = ""; ect? jsut define it like that will do yyou
-
i have the following structure on my site. i log every time a user requests a page ,and its stored in page requests. it stores the IP - User_ID, loggin_Id and the page name in the Database from there i can download and look at the general movements of people acors my site. what you woudl do is do a query based on the at table ,looking for page requrests int eh last XX minutes - and then sort out all the users etc. ** makes your you make it so that your looking for pages that are User_Login only gdlk
-
[SOLVED] changing a timestamp into a dropdown menu x3
PC Nerd replied to PC Nerd's topic in PHP Coding Help
ok i tried that. and this is my exact timestamp - its an example of one out of the database 1197908318 from here, if i could simply determine the minutes, hours and date i could get the selction working. also - as i thin ki mentioned before - i need this to all work off a certain timezone, which meants i htink well need to user strtotime() to get the times... eg strtotime( "+ 2 months AEST"); etc. Thanks -
[SOLVED] changing a timestamp into a dropdown menu x3
PC Nerd replied to PC Nerd's topic in PHP Coding Help
firslty that HTML example- is the output from the code i pasted above. secondly - its only a snippet of the output - each line is teh same except its values. finally i want whatever item to be selected, that would combine to give me $Start_Date, which is a timestamp from a database ( which i know is within the values of this form.) eg, if the time was XXX day XXX Hours, 10 minutes. the <option value = '600'>10</option> would become <option value = '600' selected>10</option> does thsi make sense? what i need is a function that given the arrays of values ( which is $Days $Hours and $Minutes from the code i pasted above) - i need it to tell me what the value os $Start_Date is - through those drop down menus im stumped on how to do this Thanks -
[SOLVED] changing a timestamp into a dropdown menu x3
PC Nerd replied to PC Nerd's topic in PHP Coding Help
um basically yes. however the day will be in teh format of: 17/12/07 - Monday etc. here is the output of my code i posted in my second post. this is only a few lines of it becasue it echos out to be hundreds of lines FOR THE DAYS: <option value = '1202083200'>04/02/08 - Monday</option> <option value = '1202169600'>05/02/08 - Tuesday</option> <option value = '1202256000'>06/02/08 - Wednesday</option> <option value = '1202342400'>07/02/08 - Thursday</option> <option value = '1202428800'>08/02/08 - Friday</option> <option value = '1202515200'>09/02/08 - Saturday</option> <option value = '1202601600'>10/02/08 - Sunday</option> <option value = '1202688000'>11/02/08 - Monday</option> <option value = '1202774400'>12/02/08 - Tuesday</option> <option value = '1202860800'>13/02/08 - Wednesday</option> <option value = '1202947200'>14/02/08 - Thursday</option> <option value = '1203033600'>15/02/08 - Friday</option> <option value = '1203120000'>16/02/08 - Saturday</option> <option value = '1203206400'>17/02/08 - Sunday</option> FOR THE HOURS <option value = '3600'>1</option> <option value = '7200'>2</option> <option value = '10800'>3</option> <option value = '14400'>4</option> <option value = '18000'>5</option> <option value = '21600'>6</option> <option value = '25200'>7</option> <option value = '28800'>8</option> <option value = '32400'>9</option> FOR THE MINUTES: <option value = '60'>1</option> <option value = '120'>2</option> <option value = '180'>3</option> <option value = '240'>4</option> <option value = '300'>5</option> <option value = '360'>6</option> <option value = '420'>7</option> <option value = '480'>8</option> <option value = '540'>9</option> <option value = '600'>10</option> those are my values echoed out for my drop down menu's. I want to simply select the valid ones. thanks -
[SOLVED] changing a timestamp into a dropdown menu x3
PC Nerd replied to PC Nerd's topic in PHP Coding Help
ok. that helps a little. a) how woud li change that to select the timestamp placed into the code? ie i can generate a form with the selected values into the three arrays, however i cannot see how to select teh current values. also b) Im not familiar with teh shorthand if statement ( i recognise it not dont know how to read it.) Thsi is my code for the three menues: <?php $Days = array(); $Hours = array(); $Minutes = array(); $follow = 1; for($i=strtotime("today AEST");$follow == 1;$i += 86400) { $day = date("d/m/y - l", $i); $Days[$i] = $day; #$i = $i + 60*60*24; if($i >= strtotime("+ 2 months")) {$follow = 0;} } for($i = 0; $i < 24;$i++) { $hour = $i * 60 * 60; $Hours[$i] = $hour; } for ($i = 0; $i < 60; $i++) { $Minutes[$i] = $i*60; } ?> from there i just loop through and add them to the menus. Start Date: <select name = 'Start_date_day'><?php foreach($Days as $field => $value) { echo "<option value = '".$field."'>".$value."</option>\n";} ?></select> Hour: <select name = 'Start_date_hour'><?php foreach($Hours as $field => $value) { echo "\t<option value = '".$value."'>".$field."</option>\n";} ?></select> Minutes: <select name = 'Start_date_minute'><?php foreach($Minutes as $field => $value) { echo "\t<option value = '".$value."'>".$field."</option>\n";} ?></select> Thanks for your help so far EDIT: I wanted to be able to create the menus the same way (same code as posted), but have a way of checking to see if its part of the current date etc. and select it etc. thnks -
as far as i know you cont have to serialize to place thigns into an array
-
your quotes are cancellingout. try just doing plain html: ?> <html etc> <?php or : echo "<form action = 'finishjob.php' method = 'POST'>\n"; gdlk
-
Hi, ive got a timestamp: $Start_Date and what I want to do is create drop down boxes for day, hour and minute - and have the timestamps value selected across the three menus. eg, if the timestamp is for 25/12/07 12:30 pm (AEST), then I want to create a drop down menu that has all the days between strtotime("today AEST"); and +2 months, a drop down with the hours 00 - 23, and the minutes 00 - 59. If this doesnt make sense then please let me know. If anyone has any suggestions, I'd really appreciate them. I also need it to work with different timezones - and nto work off GMT. ie, I specified timezone in the strtotime function. Thanks for your time
-
its telling you that your user doesnt have access to the database. within the script either update to a new user/password to connect with - or create that user with the set password in your database. its also telling you that your not using a password to connect - which is a very bad idea in terms of security. gdlk
-
also helpful for testing if a variable is set is: if(empty($_GET['page'])) {echo "variable empty";}
-
i dont know about directly however if php returns: <vars> <variable_name>VALUE</variable_name> </vars> or similar javascript will be able to store theat value *** my xml is probably wrong but i hope you get the idea