473,385 Members | 1,727 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,385 software developers and data experts.

how to go to previsous page and do function

Hi guys,

i don't know how to write when i click a submit button, i can do a
function and go back to previous page.

eg, when i click "No" button, the system will do deletefunction(), and
go back to previous page. I only know if the button is
<input type =\"button\" name=\"submit\" value=\"No\"
OnClick=\"javascript:history.go(-1)\" ><br> i can go to previous page.
But how can i do deletefunction()??
thx

krista
Jul 17 '05 #1
1 2947
Krista wrote:
eg, when i click "No" button, the system will do deletefunction(), and
go back to previous page. I only know if the button is
<input type =\"button\" name=\"submit\" value=\"No\"
OnClick=\"javascript:history.go(-1)\" ><br> i can go to previous page.
But how can i do deletefunction()??


Going back with JavaScript does not submit to the server (I think), and
therefore you can't execute anything.

Instead make that a normal submit button and process it with php,
calling deletefunction() and redirecting to some page on your site:

<input type="submit" name="submit" value="No"/>

and your PHP script

<?php
// ...
if ($_POST['submit'] == 'No') {
deletefunction();
$redir = 'http://www.yoursite.com/index.html';
header('Location: ' . $redir);
// some browsers may not follow the redirect
exit("Redirected: <a href=\"$redir\">$redir</a>.");
}
// ...
?>
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the...
1
by: William E Hatto | last post by:
Hi 1 and all, I have an asp application/web site that uses a logon page then a page for the menus and separate asp pages for all the options in the menus. The options listed in the menu's...
1
by: William E Hatto | last post by:
My thanks to Nathan for the code below, but it does not work. I get the following error; Error Type: Microsoft VBScript compilation (0x800A03EA) Syntax error /dev/development/WAN RCI...
5
by: NanQuan | last post by:
I'm hoping someone can help me solve this error since I am at a total loss here. Usually I don't bother posting on any forums or groups on the internet and prefer to solve stuff myself but this is...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
1
by: alex | last post by:
Hi ! I couldn't make backups with our new system using db2 8.2. Every time I trigger a backup I get this error message: BACKUP DATABASE EBUERO2 ONLINE TO "/raid/backup/ebuero2/part1",...
2
by: Kiyomi | last post by:
Hello, I have some codes under event ButtonSend_Click to check the user input values. This check is complicated enough using different stored procedures. Then according the result of the...
7
by: Schmidty | last post by:
Okay...I have another 'newbie' question; I have a function that loads a page and the action is $_SERVER; In the form that is in a function(method?) within a class a variable is passed back to...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.