
greatstar00
Members-
Posts
154 -
Joined
-
Last visited
Never
Everything posted by greatstar00
-
if ( (time() - mktime($certain_date) > 86400*7 ) {echo "true"; } //note, 86400 is second in a day, times 7, it is the seconds in a week
-
why not use google analytics http://www.google.com/analytics/ they give u alot of useful tools just insert a simple javascript to your page, all pages u can even know which country has the most users
-
showing only Monday-Thursday in this simple calendar
greatstar00 replied to sw45acp's topic in PHP Coding Help
//january 2010 $m = 1; $y = 2010; //calculate the number of days in the month $days = date('t',mktime(0,0,0,$m, 1, $y)); //Calculate the day of the week that the month starts on $startDay = date('w',mktime(0,0,0,$m, 1, $y)); for ($i=1; $i<=$days; $i++) { //output the days with a space if($startday+1<5 && $startday>0) echo $i . ' '; else echo ' ';//if not in mon to thurs, echo 2 spaces //increment the startday $startDay ++; //if the start day equals seven, which is not possible because //sunday = 0, saturday =6, so we need to start a new line if ($startDay == 7) { echo '<br />'; //set start day back to zero $startDay = 0; } } -
Help with creating suggestions for a search box
greatstar00 replied to proud's topic in PHP Coding Help
i remember there is a function, i forgot what it is this is the description it calculate the sound of two word like listen u may have lizten their sound are similar i remembered i read a function like this. -
Your site is registered, it will come onto a newly registered domain list (usually the case) how to find out this list?
-
did u tried to access template_files/a.php with a normal browser (without iframe, or frame)
-
depends what u want to search assume all field are text and u just search 1 or 2 words in those fields ignore separate words, if they input 2 words like this two kids will search "there are two kids", and this wont be match, "there are two little kids" and u can jump input search field, like they can have text in field1, and field3, field2 has nothing $arr=array(); if(!empty($field1)) $arr[]='1st_field='."'".$field1."'"; if(!empty($field2)) $arr[]='2nd_field='."'".$field2."'"; if(!empty($field3)) $arr[]='3rd_field='."'".$field3."'"; if(!empty($field4)) $arr[]='4th_field='."'".$field4."'"; if(!empty($field5)) $arr[]='5th_field='."'".$field5."'"; $searchstr=implode(' AND ', $arr); if(!empty($searchstr)) mysql_query("select * from `table` where $searchstr");
-
$sql="SELECT domain FROM domains WHERE user='".$_SESSION['user']."'"; i added single quote to surround $_SESSION['user']
-
to avoid further error like this always put ` ` around column names, or table names
-
u need to put `` around case (the one at "title, case, number") ` << left of 1, top of tab key cause case is a mysql reserved word why wont it work? cause the computer is dumb enough, it dont know what u mean, a reserved word, or a mysql command
-
did u printed out ip2long('HTTP_X_FORWARDED_FOR')??? to see its value
-
can u post your array values also? so, we can take a deeper look
-
Preserving line breaks (Text Area insertation to MySQL)
greatstar00 replied to wispas's topic in PHP Coding Help
if u dont want to use nl2br u can use <pre>textarea data</pre> -
u can try to look around authorize.net they provide sample php code, and tell u what to do if u afraid u might having bug, u can use their html form, they do offer this
-
How to automatically make page reroute to https?
greatstar00 replied to ghurty's topic in PHP Coding Help
http://www.php.net/manual/en/reserved.variables.server.php $_SERVER['HTTPS'] Set to a non-empty value if the script was queried through the HTTPS protocol. Note: Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol. As opposed to HTTP URLs which begin with "http://" and use port 80 by default, HTTPS URLs begin with "https://" and use port 443 by default. juse use header("Location: https://sample.com"): or <meta refresh="0:url=https://sample.com" /> -
This is a scenario where you would use CRON. To update player stats (+1000 gold) based on a few criteria (has a market?). Not to immitate the building process. i dotn use cron, i just update when the user sends request i dont update each minute, or each hour, or any time interval this idea is better when there are less people coming to the website
-
Need a little help with the following code.
greatstar00 replied to lesliegy's topic in PHP Coding Help
84600<< it isnt always 86400 if u want them can vote again at 12:AM, and they come back at 12PM, this isnt 86400 and what if they voted at 12AM, come back once at 1AM?, or come back 2nd time at 12PM? so, use currenttime-votetime+86400 u missed the script to update the voted time, or insert it, i recommend use replace mysql command and a function, at the voting script, to send error when it isnt 24 hr -
you dont need to update every minute this is the thing when users are online, they send u commands when they want, and you have them send u the command each 5 minutes or so this shouldnt be a problem the updating process is just about calculation, for instance, a user has 1000 gold per hour, and he is building a market that will be finished in 1 hour, and he left at 30 minute later, that market will increase 10 gold per hour $new_increment_rating=(((currentTime-finishTime)/3600)*10)>0?((currentTime-finishTime)/3600)*10):0; //the above line basically, do this math, ((currentTime-finishTime)/3600)*10), if it is negative, give it a zero //it is to calculate how much will the new market will give in that time $currentGold=$currentGold+(currentTime-OldUpdateTime)/3600*$currentRating+$new_increment_rating //calculate how much time passed, in hour, and times the gold increment rate, then plus the new market's number //now, update the currentRating $currentRating+=$new_increment_Rating; //delete the finished building stuff u can see, my idea is the best, u dont eat up much extra resource it is basically, update all stuff when the user request it without cron, scheduler, or timer
-
well, when u using mysql query, u can do string concatenation SELECT Officer, Date, LastName, FirstName, SID, InstantOffense, DischargeDate, ArrestDate, Booking, concat(Allegation1, Allegation2, Allegation3, Allegation4, Allegation5, Allegation6) as Allegation, Type, CourtDate, InterviewDate, HearingDate, HearingType, BoardDate, BoardDecesion FROM table1 NOTE, u can put delimiters, in concat like concat (str1, '|', str2, '|'...........)
-
You've got two options: 1) Create an offline program that can be un-screenshottable what if they disable active x control? if you create the program, browser will pop up a yellow bar to ask u, to run this active x control? wat if they choose no?
-
if you are seling picture either put watermark or, make the image lower quality, so, they dont steal the actual image It is impossible to prevent people to steal your image. and newbie, not that noob though can steal your image
-
so, what is your code on insert into database
-
Database search to display correct results
greatstar00 replied to stoni23's topic in PHP Coding Help
you dont have any security consideration should use mysql_real_escape_string and, why u have double mysql_query, if(isset($_GET['query']) <> "") evaluates to true based on your condition it looks like you search the doctors' name begins with the name they typed in what if they only remember the name in the middle? or the name at first place, and last place (only middle the middle part)? so, your query in the where condition should be where physician like 'str_replace($physician, " ", " %")' //meaning, replace all {space} with "{space}%" if u want to it to be more line google (with operator, like AND, OR) so, you should should consider this way too -
http://www.php.net/manual/en/function.set-error-handler.php try this, this is how error handling, i did it once you dont just write the function, u need to use the built-in function set_error_handler ()