User Profile
Collapse
-
Thanks alot for you help :) I had no idea you could mix the two languages like that. Works like a charm -
-
Well its pretty simple. So far its just
[php]
if($myVar==$tar get){
header("Locatio n: http://my.server.com") ;
}
[/php]
But this code is running in a frame, so the redirection only applies to that frame's source, instead of the browser itself.
Hope that makes sense...Leave a comment:
-
Ok, but this is conditional based on some PHP variable. How do i get it only to issue that command when that PHP if statement passes?...Leave a comment:
-
Changing frame location
I have a script running in a frame. This script needs to be able to redirect the browser to an entirely different location. However, with the header("locatio n: ") method, only that frame's source is changed. How would I redirect the browser away from those frames? -
well its more or less a puzzle type of thing, so you have to win the puzzle before continuing anywhere. I already have the code to check whether or not they've won, and i guess i could just check for that on each page.Leave a comment:
-
Disbaling Leaving the Page
I don't mean disabling leaving the site entirely, forcing the user to remain at my god forsaken mess for the rest of eternity. But instead just disabling going to any other part of my site (until certain requirements are met). Is there any way to do this securely without putting a check for the requirements at the beginning of each page?
-Sake -
-
Forced refresh
I feel like I'm asking a lot of questions lately, so first, just let me thank all of you who have been helping me. It's saved me a world of time.
Anyway, I have a layout of two frames. On the side there is the links frame (named "leftFrame" , and then there is the content page (named "mainFrame" ).
I need a way to force refresh my leftFrame in the mainFrame. So, my php code is currently running in the... -
[php]
$query = mysql_query("SE LECT 'Id' FROM mobs WHERE location='$loca tion'");
$aMobs = mysql_fetch_arr ay($query,MYSQL _NUM);//available mobs
$randMob = rand()%(mysql_n um_rows($query)-1);
$lastMob = $aMobs[randMob];
[/php]
So pretty much i'm trying to get all Id's where their location = $location. Then i want to randomly select an Id from the aMobs array. Any ideas?Leave a comment:
-
Retrieving multiple rows
Hey Everyone,
Here's the code:
[php]
$query = mysql_query("SE LECT 'column' FROM table WHERE location='$loca tion'");
$queryA = mysql_fetch_arr ay($query,MYSQL _NUM);
[/php]
MYSQL_NUM_ROWS claims that $query returns 2 rows. However, for some I am not able to access $queryA. I imagine some thing's wrong with my fetch array function. But I'm kind of at a loss of ideas here.
Thanks alot... -
Deleting Cookies
Hey Everyone:
I dunno if it's just really late and i cant see the blatantly obvious error right in front of me, or there's something im doing thats completely out of my knowledge. Anyway, i ask you, is there anything wrong with this block of code:
[php]
if(isset($_COOK IE['lastMob'])){
$lastMob = $_COOKIE['lastMob'];
print "Cookie was set to: ".$_COOKIE['lastMob']."<br />";
... -
Thanks alot for the help, the round() function works great. :-)Leave a comment:
-
Floating point restriction
Hey Everyone,
Just wondering how I would restrict the amount of digits displayed when printing decimal floating point numbers. Not so it wouldnt calculate that many digits, just so it wouldnt display all of them.Hope that makes sense...
Thanks in advance,
Sake -
Ball Collision
Dear All,
I'm working on a 3d breakout game in C++, and I'm having a little trouble with the collision. It will detect that the ball has hit the paddle just fine, but after that, how do I determine where the ball should go? I've just been mirroring the direction
But this makes for very uninteresting gameplay. Any help would be very greatly appreciated.Code:Ball.Velocity().x *= -1;
-
Thanks, that sounds really ingenious actually :)
Just one other question though: How can I match dates from PHP and the server? I made the DATE column of type date, but Im not sure how to get the current date in the same format in PHP. I should use the date() function right?Leave a comment:
-
Switching Pics with the Date
I'm doing a little project for a site, and I needed to rotate a picture every day. I think I have most of the code planned out in my head, but I'm sorta stuck on how to tell when its a new day. Should I just store a date in my database, and if it doesn't match the current date, switch the picture? If I did that, how would I go about doing it? Is there a more efficient/easier way?
Thanks Alot,
Sake -
Optional method arguments
Hey,
If you don't want to read all this, just look at the bottom part :-P
I'm currently making a Tic Tac Toe game, just for fun, and ran across an interesting subject(for me). I have a method in class Player that can be used for two uses. It can check for a win and check for a possible win. Once it finds a possible win, it puts the X and Y coords of that possible win into a variable, located in the class. But what... -
Variable Truncation
Hi,
How do I truncate a variable to a certain size? For instance, the integer "12345" truncated to "123", so that it has only three numbers. Or the string "Hello World" to just "Hello" so it has just five characters. I'm using C++.
Thanks,
Sake
No activity results to display
Show More
Leave a comment: