back to html page from php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Skijor

    back to html page from php

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

  • Marcin Dobrucki

    #2
    Re: back to html page from php

    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("Locatio n: http://www.somewhere.c om/page.html");
    }

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

    /Marcin

    Comment

    • Skijor

      #3
      Re: back to html page from php

      >
      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("Locatio n: http://www.somewhere.c om/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.co m/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

      Comment

      • Marcin Dobrucki

        #4
        Re: back to html page from php

        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.co m/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>Th is 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

        Comment

        • Skijor

          #5
          Re: back to html page from php


          (e.g., <a href="http://www.mydomain.co m/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.

          Comment

          • Jerry Stuckle

            #6
            Re: back to html page from php

            Skijor wrote:
            >
            >>>(e.g., <a href="http://www.mydomain.co m/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.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Marcin Dobrucki

              #7
              Re: back to html page from php

              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.

              Comment

              • Skijor

                #8
                Re: back to html page from php


                Jerry Stuckle wrote:
                Skijor wrote:
                >>(e.g., <a href="http://www.mydomain.co m/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.
                jstucklex@attgl obal.net
                =============== ===

                Comment

                • Jerry Stuckle

                  #9
                  Re: back to html page from php

                  Skijor wrote:
                  Jerry Stuckle wrote:
                  >
                  >>Skijor wrote:
                  >>
                  >>>>>(e.g., <a href="http://www.mydomain.co m/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.p hp 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
                  >>>>>question s 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.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • Skijor

                    #10
                    Re: back to html page from php


                    Jerry Stuckle wrote:
                    Skijor wrote:
                    Jerry Stuckle wrote:
                    >Skijor wrote:
                    >
                    >>>>(e.g., <a href="http://www.mydomain.co m/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.ph p 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.
                    jstucklex@attgl obal.net
                    =============== ===

                    Comment

                    Working...