Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Donovan
Client



Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Thu Dec 07, 2006 3:08 pm Reply with quote

Let me explain.

If my page move.php has a function called like

checkmove($tid, $team_id);

Which checks to see if enemy exist on territory.

common.php has this function that ends like this.

Code:
//Look for enemy teams that may be on territory

$sql = "SELECT * FROM " . $prefix . "_tc_teams WHERE tid ='$tid' AND div_id != '$div_id'";
$result = $db->sql_query($sql);
$enemy = FALSE;
   if ($db->sql_numrows($result) > 0) {
$enemy = TRUE; //Enemy exist on territory


If enemy = TRUE, I don't want to return $enemy to the move.php page but to redirect to attack.php page then what would be the best way to do this.

My usual redirect written like

Header("Location: modules.php?name=whatever&file=attack");

...wont send the arguments, $tid, $team_id.
 
View user's profile Send private message Visit poster's website ICQ Number
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Dec 08, 2006 6:42 am Reply with quote

The difference may be between GET vs. POST. If you are expecting $tid and $team_id to be passed into your "redirect", then they have to be included as variables on your URL. The Header redirect is acting like a form GET.

_________________
Where Do YOU Stand?
HTML Newsletter::ShortLinks::Mailer::Downloads and more... 
View user's profile Send private message Visit poster's website
Donovan







PostPosted: Fri Dec 08, 2006 7:26 am Reply with quote

How do I include both variables into my url?

Maybe I can just pass one like this.

Header("Location: modules.php?name=whatever&file=attack&team_id = '$team_id'");

..or


Header("Refresh: 0; url=modules.php?name=whatever&file=attack&team_id = '$team_id'");

What does using this in the url do?

&mode=

I've seen this but don't know what mode is or what it could do.
 
montego







PostPosted: Sun Dec 10, 2006 9:20 am Reply with quote

Your first example should work, however, you would only use "&" and not "&". "&" will not work properly in this function. (One of the very few exceptions where you don't want to use the "&".)

If your script does not use the variable $mode, you don't need it. Wink
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©