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

How I can navigate to different pages from a single page using different buttons?

I have a web page in php. I put two buttons in the form on the page. Now the problem is that I want to navigate into different pages , but i cant. The buttons are say submit and back. if I pressed submit i want to go to reg.php or if I pressed back, i want to goto home.php. How can i do this?
Sep 3 '10 #1
3 1702
Markus
6,050 Expert 4TB
Ask the Javascript guys.
Sep 3 '10 #2
JKing
1,206 Expert 1GB
Make your buttons links.
Sep 3 '10 #3
kovik
1,044 Expert 1GB
If these buttons are related to a form, the submit button should just be a regular submit button and the back button (which I personally call a "cancel" button) should be an anchor.

If the action attribute of your form element is "reg.php", then hitting submit will send your user to reg.php. If the href attribute of your anchor element is "home.php", clicking it will send your user to home.php.


But like I said, the cancel button shouldn't be a button. Don't send a button in to do a link's job.
Sep 3 '10 #4

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

Similar topics

0
by: James | last post by:
Hi, I am trying to build a shopping cart for my DVD website and am having trouble reading variable over different pages. I have a page that allows the user to add things to their cart and this...
23
by: Dufe | last post by:
Hello all: To deal with the problem of differing user screen resolutions, I've explored: 1) making the pages in PHP, 2) having different pages on the same page and selecting the proper one via...
3
by: RCS | last post by:
I have an app that I have different "sections" that I want to switch back and forth from, all while having the server maintain viewstate for each page. In other words, when I am on Page1.aspx and...
8
by: Ed Jay | last post by:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?...
1
by: Christian Blackburn | last post by:
Hi Gang, I have trouble getting my single page Aspx pages to allow the imports and or inherits command. Can someone reply with an example. Thanks, Christian Blackburn
5
by: Chris | last post by:
How do I reference a control on another page? Regards.
1
by: markroworth | last post by:
Hi there, I want to create a form with two buttons on that navigate to two different pages. The code I have at the moment looks like this: <form action="login.php" method="post"> <table...
3
by: google | last post by:
Hi I'm looking for some advice, so if anyone wants to contribute I would be grateful. I'm trying to create a web application. By application I mean something that is like a Windows...
1
by: jdkhan | last post by:
i want to use two lists one dependent on other just like city dependent on country selection how can i do this in single page using PHP
1
by: timsamshuijzen | last post by:
The website I am developing is implemented as a Single Page Interface (SPI). During a visitor's session all new content gets loaded by JavaScript (Ajax), no new pages get loaded and the URL in the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.