473,387 Members | 3,750 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.

back to html page from php

How do you go back to the html page you came in from from inside a php
script?

Nov 13 '06 #1
9 2627
Skijor wrote:
How do you go back to the html page you came in from from inside a php
script?
ehh, how do you mean? If you have an html page that includes php
(and your server is configured to parse .html as php, then:
<html>
<head><title>...</title></head>
<body>
<?php echo "Hello World!"; ?>
</body>
</html

if you mean executing a php script, and then redirecting, then its
something like this:

** php script*
if (TRUE == $jump) {
// yes yes, lets be complient
header("Location: http://www.somewhere.com/page.html");
}

** html page **
<html>
<head><title>...</title>/head>
<body>
<h1>Hello world</h1>
<p>you were redirected from php</p>
</body>
</html>

/Marcin
Nov 13 '06 #2
>
if you mean executing a php script, and then redirecting, then its
something like this:

** php script*
if (TRUE == $jump) {
// yes yes, lets be complient
header("Location: http://www.somewhere.com/page.html");
}
yes. this is what I mean. What about the converse? Calling a php
script from within html? I have an html static page that uses links to
a 3rd party shopping cart.
I want to use a shopping cart I wrote myself using php/mysql but what
do i replace the links with? I tried replacing them with a link to my
php cart script
(e.g., <a href="http://www.mydomain.com/myCart.php</a>)

This works and now I can use the header() function from within the
myCart.php script to get back. I guess my question is do I have to use
the <a href=tag to invoke the script on the server side? or a better
questions is can I just do this without problems?
>
** html page **
<html>
<head><title>...</title>/head>
<body>
<h1>Hello world</h1>
<p>you were redirected from php</p>
</body>
</html>

/Marcin
Nov 15 '06 #3
Skijor wrote:
yes. this is what I mean. What about the converse? Calling a php
script from within html? I have an html static page that uses links to
a 3rd party shopping cart.
I want to use a shopping cart I wrote myself using php/mysql but what
do i replace the links with? I tried replacing them with a link to my
php cart script
(e.g., <a href="http://www.mydomain.com/myCart.php</a>)
You need to place something to click between the <a href...and </a>.
This works and now I can use the header() function from within the
myCart.php script to get back. I guess my question is do I have to use
the <a href=tag to invoke the script on the server side? or a better
questions is can I just do this without problems?
You mean automatically invoke the shopping cart when you load an html
page? Well, you can mix php and html if you wish, just call your html
page <name>.php, and it will be processed as php, for instance like this:

foo.php:

<html>
<head><title>This is a sample</title></head>
<body>
<h1>Welcome</h1>
<?php
if ($_GET["foo"] = "something")
echo "Excellent, dude!";
?>
<p>This is an html-page paragraph</p>
</body>
</html>

Alternatively, use JavaScript in the page to, eg. fire up a popup window
(do a search for "javascript" and "popup"), and that can source the
cart. You can also do something with frames, etc. It will really very
much depend on what you want to achieve.

/marcin
Nov 15 '06 #4

(e.g., <a href="http://www.mydomain.com/myCart.php</a>)

You need to place something to click between the <a href...and </a>.
yes. i know.
>
This works and now I can use the header() function from within the
myCart.php script to get back. I guess my question is do I have to use
the <a href=tag to invoke the script on the server side? or a better
questions is can I just do this without problems?

You mean automatically invoke the shopping cart when you load an html
page?
no. I just wanted to know if using the <atag is the only way to
provide a link to the the cart (myCart.php). It's a silly question now
that I think about it.

Nov 16 '06 #5
Skijor wrote:
>
>>>(e.g., <a href="http://www.mydomain.com/myCart.php</a>)

You need to place something to click between the <a href...and </a>.

yes. i know.
>>>This works and now I can use the header() function from within the
myCart.php script to get back. I guess my question is do I have to use
the <a href=tag to invoke the script on the server side? or a better
questions is can I just do this without problems?

You mean automatically invoke the shopping cart when you load an html
page?


no. I just wanted to know if using the <atag is the only way to
provide a link to the the cart (myCart.php). It's a silly question now
that I think about it.
Well, since <ais not PHP code, might I recommend you try asking in
alt.html?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 16 '06 #6
Skijor wrote:
no. I just wanted to know if using the <atag is the only way to
provide a link to the the cart (myCart.php). It's a silly question now
that I think about it.
Well, no ;-) But that's well outside the scope of php.
Nov 16 '06 #7

Jerry Stuckle wrote:
Skijor wrote:
>>(e.g., <a href="http://www.mydomain.com/myCart.php</a>)

You need to place something to click between the <a href...and </a>.
yes. i know.
>>This works and now I can use the header() function from within the
myCart.php script to get back. I guess my question is do I have to use
the <a href=tag to invoke the script on the server side? or a better
questions is can I just do this without problems?

You mean automatically invoke the shopping cart when you load an html
page?

no. I just wanted to know if using the <atag is the only way to
provide a link to the the cart (myCart.php). It's a silly question now
that I think about it.

Well, since <ais not PHP code, might I recommend you try asking in
alt.html?
you might. but I think this is a pretentious comment.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 18 '06 #8
Skijor wrote:
Jerry Stuckle wrote:
>>Skijor wrote:
>>>>>(e.g., <a href="http://www.mydomain.com/myCart.php</a>)

You need to place something to click between the <a href...and </a>.

yes. i know.
>This works and now I can use the header() function from within the
>myCart.php script to get back. I guess my question is do I have to use
>the <a href=tag to invoke the script on the server side? or a better
>questions is can I just do this without problems?

You mean automatically invoke the shopping cart when you load an html
page?
no. I just wanted to know if using the <atag is the only way to
provide a link to the the cart (myCart.php). It's a silly question now
that I think about it.

Well, since <ais not PHP code, might I recommend you try asking in
alt.html?


you might. but I think this is a pretentious comment.

And since when is this an appropriate group for HTML? It's not. This
is a PHP group - hence the "php" in it's name.

Just trying to direct you to the appropriate place.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 18 '06 #9

Jerry Stuckle wrote:
Skijor wrote:
Jerry Stuckle wrote:
>Skijor wrote:

(e.g., <a href="http://www.mydomain.com/myCart.php</a>)

You need to place something to click between the <a href...and </a>.

yes. i know.
This works and now I can use the header() function from within the
myCart.php script to get back. I guess my question is do I have to use
the <a href=tag to invoke the script on the server side? or a better
questions is can I just do this without problems?

You mean automatically invoke the shopping cart when you load an html
page?
no. I just wanted to know if using the <atag is the only way to
provide a link to the the cart (myCart.php). It's a silly question now
that I think about it.
Well, since <ais not PHP code, might I recommend you try asking in
alt.html?

you might. but I think this is a pretentious comment.
And since when is this an appropriate group for HTML? It's not. This
is a PHP group - hence the "php" in it's name.

Just trying to direct you to the appropriate place.
Sorry. My bad.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #10

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

Similar topics

2
by: Chris | last post by:
I have a script that will navigate back and foreward using a form. The files it navigates are named: bg1.html, bg2.html, bg3.html, etc. This is happening in a frameset, where my BACK and FORWARD...
25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
10
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
5
by: Brad | last post by:
I created a base page class which sets a response filter and the filter injects additional html into the response output stream. The filter works fine and everything works as expected except for...
2
by: Microsoft News | last post by:
What I have is a message box that pops up. It is another browser window. The code is a general function that you pass message, title and a key to. The box works great except, that if you are on a...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
26
by: gswork | last post by:
i hadn't designed a web page from the ground up for about 9 years, then i was asked to do one. I'd dabbled with html and vaigly kept up with some of the developments but other than that i've been...
2
by: ShaneFowlkes | last post by:
I created a couple of quick test pages and to my surprise, these do not work either. When I click "Go Back" on test2.aspx, nothing happens. Ideas?? Surely I must be missing something obvious........
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:
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: 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...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.