Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Ranked #1K
~17.1K People Reached
Favorite Forums
Favorite Tags

32 Posted Topics

Member Avatar for jrwin_19

There is no way to do that. What you can do is store the player logout time, and when he logs in again, compare the times and do necessary changes.

Member Avatar for crammo
0
1K
Member Avatar for 68thorby68

[code] <?php $query = "SELECT DISTINCT event_date FROM events WHERE event_date >'$startdate' AND event_date <'$enddate'"; $result = mysql_query($query); $date = ''; while($row = mysql_fetch_assoc($result)) { $date = $row['event_date']; echo "<b>". $date . "</b><br />"; $query2 = "SELECT event_name FROM events WHERE event_date='$date'"; $result2 = mysql_query($query2); while($row = mysql_fetch_assoc($result2)) { $row['event_name'] …

Member Avatar for james_horn165
0
140
Member Avatar for LloydFarrell

The "case" end with [b]:[/b] not [b];[/b] [code] switch($ad) { case "add1.gif": header("Location: http://www.google.co.uk"); break; case "add2.gif": header("Location: http://www.youtube.com"); break; } [/code]

Member Avatar for syamsasi
0
747
Member Avatar for Midnite002

Well, since you [quote]trying to learn from all this and use this for a project at the same time[/quote] ... than take a look at this [URL="http://php.net/manual/en/function.copy.php"]copy()[/URL].

Member Avatar for Stefano Mtangoo
0
320
Member Avatar for veledrom

The most common way would be to make a unique id for the session. For example create a hash from users ip and browser he uses. Regenerate session id's after logout, set session timeout and so on.

Member Avatar for amd_k8
0
255
Member Avatar for LloydFarrell

Hm, what kind of query is that? [code]mysql_query("SELECT * FROM table ORDER BY RAND(), LIMIT 1");[/code] I guess... [code] <?php include_once "connect_to_mysql.php"; $sql = mysql_query("SELECT * FROM table"); while($row = mysql_fetch_assoc($sql)) { $add = $row['add']; $link = $row['link']; $title = $row['title']; echo ' <b>'.$add.'</b> <a href="'.$add.$link.'" title="'.$title.'"></a>'; } ?> [/code]

Member Avatar for vaultdweller123
0
1K
Member Avatar for almahmeed

If you are using utf-8 in meta tag, mention that all source files should be also saved in utf-8.

Member Avatar for muralibobby2015
0
96
Member Avatar for codewalkz

Check the mktime() function. Parse your dates in it and it will return the number of seconds since unix epoch, these are just two big numbers which can be easily compared.

Member Avatar for webbespoke
0
115
Member Avatar for takeshi

Well... seems that you lost a curly brace ({) and a semi-colon in your switch statement... Next, where is your actually searched string? I mean [code] $term = mysql_real_escape_string((string)$_POST['term']); [/code] Third, your SQL syntax is kinda wrong [icode]... LIKE '%term%[/icode] ..., I suppose it should be - [icode]... LIKE '%$term%'[/icode] …

Member Avatar for takeshi
0
106
Member Avatar for takeshi

First of all your form... [code=html] <div> <form method="post" id="newsletterform" action="search.php"> <p><input type="text" name="term" id="s" style="width: 95%;" /></p> <p><select name="criteria"> <option value="1">course</option> <option value="2">surname</option> <option value="3">department</option> <option value="4">email address</option> <option value="5">student no</option> </select></p> <p><button class="Button" type="submit" name="search"></p> </form> </div> [/code] Now in the php script you just parse the value …

Member Avatar for takeshi
0
820
Member Avatar for almahmeed

Also to make the page cross-browser, I would recommend to set to null margin and padding to all elements. [code] * { margin: 0; padding: 0; } [/code] The issue is that different browsers set up different margin and padding to HTML elements.

Member Avatar for diafol
0
175
Member Avatar for hbat66

[code] //... $currentspecial = @mysql_query($query); $currentsub = @mysql_query($query2); if($currentspecial != $currentsub) { //... [/code] There is no way to compare two arrays in a such way. Let's see... you are comparing $currentspecial with $currentsub and actually you are comparing the Resource ID's returned by the mysql_query() function, not arrays of …

Member Avatar for vaultdweller123
0
193
Member Avatar for catcoffee

You are selecting a picture rating for each photo right?? Then why all of your comparison you didn't put in the loop? [code] <?php $sql="SELECT * FROM photo WHERE type='current'"; $result = mysql_query($sql); while($row=mysql_fetch_assoc($result)) { $rating =$row['votes']; if ($rating >= 0 && $rating <= 1) { $rate = "0"; } …

Member Avatar for catcoffee
0
84
Member Avatar for nehashri

The thing is that we can create an array with 4 elements (for ach form "yes/no" radio) stored in $_SESSION. Say the user clicked "yes" on 1-st form... the first element will become "1", and so on. Doing the needed stuff according to array elements.

Member Avatar for amd_k8
0
116
Member Avatar for aneeka

Set of questions with radio buttons... the person clicks the correct answer then presses a submit button, the script loops through all pressed buttons and calcultes the result.

Member Avatar for amd_k8
0
91
Member Avatar for hno
Member Avatar for Mujahid158

A lot easier would be to make the page self refreshing within some timespan.

Member Avatar for diafol
0
148
Member Avatar for takeshi

No way to do it in PHP. VB or JS are at client side, PHP only server side. Anyway you can create a page in php with such task using HTML forms...

Member Avatar for vaultdweller123
0
136
Member Avatar for peko_peko

A simple example... which loops through "pdf" directory, outputs all files with *.pdf extension and their size in bytes. [code] <?php $dir = "./pdf"; $hnd = opendir($dir); while($file = readdir($hnd)) { if(substr($file,-3) == 'pdf') { echo '<p>'.$file.': '.filesize($dir.'/'.$file).'</p>'; } } closedir($hnd); ?> [/code]

Member Avatar for peko_peko
0
200
Member Avatar for LloydFarrell

The error you were getting, is because wrong date() use... So far you tried to merge the strings inside the function, while date() gets only correct date modifiers. Try that... [code=php] $image_name = date('Ymdhis') . "." . $image_ext[1]; $image_name = $dest.$image_name; [/code] BTW doing explode() to get image extension could …

Member Avatar for LloydFarrell
0
203
Member Avatar for azegurb

Yes you are right... seems you just copy-pasted some code from a buggy site... (The &gt; is the HTML entity for ">")

Member Avatar for azegurb
0
78
Member Avatar for takeshi
Member Avatar for OmniX

The problem code please... I think that with "/" should not be problems at all, while the "\" in most cases has to be doubled, e.g. "\\".

Member Avatar for amd_k8
0
93
Member Avatar for muralibobby2015
Member Avatar for Mike516

So? Whats the error? I don't think there are mediums on that forum...

Member Avatar for amd_k8
0
72
Member Avatar for sfrider0

I think javascript could be handy here. To every button assingning an "onclick" event, which overrides the forms "action" field, adding an extra argument, the rows ID. So, after submitting the form the URL would be, for example "index.php?id=3". All what remains is to pass the $_GET['id'] variable and delete …

Member Avatar for FlashCreations
0
9K
Member Avatar for veledrom

Using urlencode() may solve the problem, but the thing is that plus and space signs in URL have the same value, they are not recomeded to use at all in URLs.

Member Avatar for veledrom
0
164
Member Avatar for nadnakinam
Member Avatar for nadnakinam
0
100
Member Avatar for architact

First .htaccess file: [code] RewriteEngine On RewriteRule ^\.htaccess$ - [F] RewriteCond %{HTTP_HOST} ^([^.]+)\.domainname\.com$ RewriteRule ^$ /index.php?user=%1 [L] [/code] Second, we must set a redirection from whatever "username.domainname.com" link to "domainname.com". Thats achieved by talking to your hosting provider to setup such a redirect. Third, according to your site link generation, …

Member Avatar for architact
0
143
Member Avatar for SamiBH

I am always using separate queries, so as my example would be: 1. Get all users id's. 2. Foreach user id, get posts count. Store the id's and posts count into arrays. 3. Sort the array by descendant.

Member Avatar for SamiBH
0
110
Member Avatar for 68thorby68

Because you generated an output to browser, by making <script> tags and so on. Check the reference for header() function. There is said that NO OUTPUT should be BEFORE sending headers, not even a space or line feed. Instead of headers, you can use "document.location.href" javascript property. That is redirect …

Member Avatar for 68thorby68
0
162
Member Avatar for RicardoE

For every user we create a hash (MD5 or any other), store it in the database, and send it to the recipient. Then we just check the given hash in the link with existing one in the database.

Member Avatar for RicardoE
0
101

The End.