473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP File....refresh page using submit button

This is a hard question, but I can't think of anyway to do this. I have a game as part of my website/forum I use. The people there aren't very helpful lol, but they have areas they must travel in order to get from point A to point B. Example is using a GO button (Submit) to travel Up, one for Down...ect. It does call information from my database in order to make them get to point B. When clicking GO, they are taken to a page that tells them whether it was a success, or they got caught, or they found something special. On that page, if successful or not, they have to click a link to REFRESH the page and return to the map. What I wanna do is totally get rid of this process. If on a failed move, it will take them to the right page, but when successful, I'd like to SKIP the entire page that says it was and have the main file refresh to their current location....to avoid clicks. I have the .php file and the template of the page..but nothing in the template would alter that. How can I make the page, on a successful move, just refresh in itself and they are in the right area without any extra clicks?

This is the PHP area, and where I think it's telling it to go to the success page;

//Update character area
$sql = " UPDATE " . TRAVEL_CHARACTERS_TABLE . "
SET character_area = '$destination_id'
WHERE character_id = '$user_id' ";
if( !($result = $db->sql_query($sql)) )
message_die(GENERAL_ERROR, 'Could not update character area', '', __LINE__, __FILE__, $sql);

travel_previous( Travel_area_change_success , travel_area , '' );
break;
}
}

The Travel_area_change_success is the language key that loads on the page I want to just get rid of saying...You changed areas successfully. And the travel_area is my .php file which under the success will say...CLICK here to return to previous page.
Aug 8 '06 #1
1 6727
why not add an IFELSE statement

I.E
IF{ the move is correct goto next page}
ELSE {return to same page}

look at the php manual for the correct wording of statement but i think this is the best way of doing this
Aug 9 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Noel Wood | last post by:
Hello, I have a problem that I'm sure is simple but I have searched the newsgroup and have not found it posted before so I apologize if it has been asked heaps of times before. I have a page that...
1
by: jcwmtl | last post by:
Hello all I'm building a suite of free php applications to create virtual worlds. My problem is i can't get my file to refresh. I am not a programmer and i started using php this week. my only...
10
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
7
by: Brian | last post by:
hello, I am looking for a way to auto refresh a web page that I created, but also let the user choose to stop the auto refresh. I can not figure out how to stop the auto refresh. Any help would...
1
by: Ibrahim. | last post by:
Hi, I have a login page, the problem I'm facing is like this; 1. Login page with submit button (being default button); 2. When first time the page is submitted then submit code is called. ...
11
by: gotonagle | last post by:
hi, can some help me in this regard i m entering some values in my databse from my asp page. for this i m using a submit button which submit the form to a new page that is 'insert.asp'. this page...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
4
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.