How to open a PHP success page in MIVA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imyb
    Mini Mivite

    • Oct 2013
    • 13

    #1

    How to open a PHP success page in MIVA

    Hi, I use miva to process the forms on my website, save the data in a txt file and email me the info. Once this is done I want to send the person to a "success page" so they know the form was sent successfully.

    How would I open a page called: http://www.mywebsite.com/success.php

    I looked into MV CALL ACTION but it's not working. It was working when it was an HTML page but now that I changed it to a PHP page it's not. Please help... This is what I had that was working with the HTML page... Only thing I changed was the .html to .php

    Yes, if I enter the URL in my browser it does load the page so my website is processing php files properly.

    Thanks!

    <MvASSIGN NAME="url" VALUE="http://www.mywebsite.com/success.html">
    <MvCALL ACTION="&[url];" METHOD="GET">
    <MvIF EXPR="{callobjecttype EQ 'tag' AND toupper(callobjectelement)
    EQ '/HEAD'}">
    <MvEVAL EXPR="<BASE HREF='&[url];'>">
    </MvIF>
    <MvEVAL EXPR="{callvalue}">
    </MvCALL>

    I don't understand that when I change the .html to .php it stops working.

    If there is ANY OTHER way in miva to open a URL I am willing to try that.
  • Bruce - PhosphorMedia
    Developer Partner











    • Mar 2006
    • 11256

    #2
    Re: How to open a PHP success page in MIVA

    Why did you change an HTML page to PHP? You say you can open it via a web browser, but does it give you the success message when you use the browser?

    This bit of code looks a tad 'hacky' at best.

    <MvIF EXPR="{callobjecttype EQ 'tag' AND toupper(callobjectelement)
    EQ '/HEAD'}">
    <MvEVAL EXPR="<BASE HREF='&[url];'>">

    If the page needs a variable base href you should pass that in the MvCall fields and use a PHP environment variable to grab it.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment

    • imyb
      Mini Mivite

      • Oct 2013
      • 13

      #3
      Re: How to open a PHP success page in MIVA

      We changed the entire website from an html design to a PHP design. So all pages are now PHP. I am new at miva so the href/php variable to grab it got me a little lost. In case this helps, here's my entire script. As for the "'hacky" statement this part of the script was found on the net a few years back and it was working. To be honest, I have no idea what it "really" does other than it used to send my users to the html page. If I understand your question correctly, I DO NOT need to pass any information to the php page. I just want to load the page. Send the user to the page. I am not sure why it works with an html page but not a php. I though that a URL LINK is a link and it should open. All that happens is a blank page with all the data in the URL ADDRESS. hope this helps.

      EVERYTHING ON THE SCRIPT BELOW WORKS FINE. IT EMAILS ME, SAVE THE INFO IN THE TXT FILE AND OPENS THE SUCCESS.HTML PAGE. All I want to do is change the success.html to success.php

      Really hope you can help, I am going nuts ;-) Thanks for your time!



      This is my entire script.... Removed the email and website URL to protect the client.




      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
      <!--TODAY'S DATE -->
      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->


      <MvASSIGN NAME="my_time_zone" VALUE="{timezone()}">
      <MvASSIGN NAME="month" VALUE="{time_t_month(dyn_time_t,my_time_zone)}">
      <MvASSIGN NAME="day" VALUE="{time_t_dayofmonth(dyn_time_t,my_time_zone) }">
      <MvASSIGN NAME="year" VALUE="{time_t_year(dyn_time_t,my_time_zone)}">


      <MvASSIGN NAME="date" VALUE="&[month]/&[day]/&[year]">






      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X -->
      <!--SAVING THE INFORMATION TO THE FILE SEPARATED BY TAB -->
      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X -->


      <MvEXPORT
      FILE="pif.dat"
      FIELDS="date,email,fullname,state,country,city,pho nenumber,cellphonenumber,workphonenumber,pagernumb er,job,income,program,track,playotb,playfromhome,y earsplaying,attendance,betpervisit,profit,timehand ,spouse,betfrom,questions"
      DELIMITER=" ">


      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX -->
      <!--E-MAILING THE INFORMATION FROM THE FORM TO CLIENT -->
      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX -->


      <MvSMTP
      TO="[email protected]"
      FROM= "&[email]"
      MAILHOST="localhost"
      SUBJECT="### CUSTOMER INFO FORM ###">


      Interested in : &[program]

      Date : &[date]
      Name : &[fullname]
      State : &[state]
      Country : &[country]
      City : &[city]
      Job : &[job]
      Income : &[income]


      Home # : &[phonenumber]
      Cell # : &[cellphonenumber]
      Work # : &[workphonenumber]
      Pager # : &[pagernumber]

      Are you showing a profit?
      &[profit]

      Comments or Questions:
      &[questions]

      </MvSMTP>



      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
      <!--GO TO THE CONGRATULATION PAGE AFTER THE -->
      <!--THE E-MAIL IS SENT AND INFO SAVED TO THE FILE. -->
      <!--XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->

      <MvASSIGN NAME="url" VALUE="http://www.mywebsite.com/success.html">
      <MvCALL ACTION="&[url];" METHOD="GET">
      <MvIF EXPR="{callobjecttype EQ 'tag' AND toupper(callobjectelement)
      EQ '/HEAD'}">
      <MvEVAL EXPR="<BASE HREF='&[url];'>">
      </MvIF>
      <MvEVAL EXPR="{callvalue}">
      </MvCALL>
      Last edited by imyb; 11-18-13, 06:03 PM.

      Comment

      • Bruce - PhosphorMedia
        Developer Partner











        • Mar 2006
        • 11256

        #4
        Re: How to open a PHP success page in MIVA

        Well, this isn't PHP, its Mivascript (old, uncompiled version 2 mivascript at that). You can just replace the MvCall with whatever "success message you want. Might do it in the following way (don't remember if this will work because of the age, but its worth a shot.

        So, instead of the MvCall stuff, just use:

        <mvif expr="{ NOT(g.SMTP_error) }">

        <h1> You've Done it!</h1>

        <mvelse>

        <h1> Sorry, something went wrong</h1>

        </mvif>
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment

        • imyb
          Mini Mivite

          • Oct 2013
          • 13

          #5
          Re: How to open a PHP success page in MIVA

          I think you are right. These scripts were made years ago and since they were working fine, we never touched them again until now. I know they are not PHP, I call them from my PHP website. I am ashamed to admit that I had no idea this was OLD STUFF. If I understand your solution correctly it will print on the screen the MESSAGE "You've Done it!". While this would "kinda" solve the problem I never like to have a client not on the main website or sent to a page on the website so that they can keep browsing around after sending their information.

          Even though this is OLD MIVA, is there a reason that a link to an HTML page loads but just to change the link to .php where the entire url is the same would not work? I was really hoping to just change the link from html to php and not have to learn more miva to transform my old scripts to newer version. I hate to say this but I don't even know how to compile the script.

          Comment

          • wajake41
            Mega Mivite


            • Dec 2009
            • 2294

            #6
            Re: How to open a PHP success page in MIVA

            When you change "http://www.mywebsite.com/success.html" to http://www.mywebsite.com/success.php you are attempting to execute a PHP named "success.php" on your server, not linking to an HTML page. Do you have a PHP success.php program that is using the PHP command "echo" to send a HTML page to your customer? Larry
            Last edited by wajake41; 11-18-13, 07:55 PM.
            Larry
            Luce Kanun Web Design
            www.facebook.com/wajake41
            www.plus.google.com/116415026668025242914/posts?hl=en


            Comment

            • imyb
              Mini Mivite

              • Oct 2013
              • 13

              #7
              Re: How to open a PHP success page in MIVA

              Hi Larry, Thanks so much for the reply and I am trying to understand what you are saying. Sorry, not a genius at this stuff but I am trying. This is what I can say about this....

              My file called success.php has HTML in it with sections in PHP to position images on the page, menu.... So the file is saved as a .PHP To setup the entire look of the website. Then I have the message I want for people to see after sending their information. To be honest your question went just a little bit over my head ;-) I looked at the page and don't see and ECHO on it. So, the best I can do is give you the link to the success page and see if that helps in any way.

              link to the success page i am trying to link to: http://www.theracingconsultant.com/success.php

              Thanks so much for your time

              Comment

              • wajake41
                Mega Mivite


                • Dec 2009
                • 2294

                #8
                Re: How to open a PHP success page in MIVA

                This little program when executed on the server will display a barebones You've do it! page: <?php
                $html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
                $html .= '<html><head><title>success</title></head><body>';
                $html .= "You've Done it!";
                $html .= '</body></html>';
                echo $html;
                die();
                ?>
                Last edited by wajake41; 11-18-13, 08:07 PM.
                Larry
                Luce Kanun Web Design
                www.facebook.com/wajake41
                www.plus.google.com/116415026668025242914/posts?hl=en


                Comment

                • imyb
                  Mini Mivite

                  • Oct 2013
                  • 13

                  #9
                  Re: How to open a PHP success page in MIVA

                  While I will keep this solution as an option. I REALLY want to send them to the success.php page because I want them on the website and not a little empty page with a you did it and no way to get back on the website. I know I could probably put a link to CLICK HERE TO GO BACK TO THE WEBSITE but I don't know if it's just me to me when I have to click to go back to a website it just looks "cheap" or "unfinished" for a lack of a better way to explain it. I think it looks better when people are sent to a page that matches the website layout. So, if there is any way to accomplish that it would be my first option.

                  I REALLY appreciate all your help. This is new and I had to learn lots of stuff really fast and this is the last piece of the puzzle I am missing. Thanks again!

                  Comment

                  • wajake41
                    Mega Mivite


                    • Dec 2009
                    • 2294

                    #10
                    Re: How to open a PHP success page in MIVA

                    Took a look at your link. I gather that is the "you've done it" page. So the problem is getting your success.php program to execute? Guess I'm confused about the html to php link change you described.
                    Larry
                    Luce Kanun Web Design
                    www.facebook.com/wajake41
                    www.plus.google.com/116415026668025242914/posts?hl=en


                    Comment

                    • imyb
                      Mini Mivite

                      • Oct 2013
                      • 13

                      #11
                      Re: How to open a PHP success page in MIVA

                      Sorry about the confusion... Lets see if I can explain it better. The link IS THE SUCCESS PAGE I want to sent the users to.

                      My website used to be entirely done in file all .html and not it is all done in .php

                      My script was working fine with the .html extension and I "thought" I could just change the link from:
                      "http://www.mywebsite.com/success.html" to http://www.mywebsite.com/success.php and it would just work but it doesn't. It work when I use the success.html but it doe NOT work when I use success.php... I just see a BLANK PAGE and in the URL LOCATION on top I see all the data that was sent on the form.


                      Or I can say it this way....


                      THIS WORKS:
                      <MvASSIGN NAME="url" VALUE="http://www.mywebsite.com/success.html">
                      <MvCALL ACTION="&[url];" METHOD="GET">
                      <MvIF EXPR="{callobjecttype EQ 'tag' AND toupper(callobjectelement)
                      EQ '/HEAD'}">
                      <MvEVAL EXPR="<BASE HREF='&[url];'>">
                      </MvIF>
                      <MvEVAL EXPR="{callvalue}">
                      </MvCALL>



                      THIS DOESN'T WORK:
                      <MvASSIGN NAME="url" VALUE="http://www.mywebsite.com/success.php">
                      <MvCALL ACTION="&[url];" METHOD="GET">
                      <MvIF EXPR="{callobjecttype EQ 'tag' AND toupper(callobjectelement)
                      EQ '/HEAD'}">
                      <MvEVAL EXPR="<BASE HREF='&[url];'>">
                      </MvIF>
                      <MvEVAL EXPR="{callvalue}">
                      </MvCALL>


                      ALL I AM CHANGING IS THE .HTML TO .PHP I just don't understand why it doesn't work, isn't it that a URL is a URL no matter where it goes? Or maybe it's just that a .php file doesn't work like a .html file and I just can't make it load. hope this clears it up

                      Comment

                      • wajake41
                        Mega Mivite


                        • Dec 2009
                        • 2294

                        #12
                        Re: How to open a PHP success page in MIVA

                        I think maybe I understand your situation a bit more. I think that the success HTML file is HTML with imbedded PHP. However when you change the file extension to php, you are now attempting to execute a program written in PHP which will then echo (write) html code back to the browser (IE, firefox, etc.). So php is a programming language used to format and output html, while html is just ascii text to be interpreted by a browser. I still don't understand what your ultimate goal is, just a you've done it message or the html page that you gave a link to? Why do this in php if the html page works?
                        Larry
                        Luce Kanun Web Design
                        www.facebook.com/wajake41
                        www.plus.google.com/116415026668025242914/posts?hl=en


                        Comment

                        • imyb
                          Mini Mivite

                          • Oct 2013
                          • 13

                          #13
                          Re: How to open a PHP success page in MIVA

                          I need it in .php because the NEW WEBSITE DESIGN is done in .php

                          When I say it works with .html is because in the past the website was .html and it was working fine. But now that I re-designed the website and it is all .php it will not work. I was expecting to just change the link from:

                          "http://www.theracingconsultant.com/success.html" to http://www.theracingconsultant.com/success.php and it would just work.

                          I can't use a .html because my website is designed in .php

                          The short is that I need to have my "OLD" miva script posted above (see post #3) load the link to: http://www.theracingconsultant.com/success.php


                          If there was another way to process my forms on my website to EMAIL ME THE INFO, SAVE IT INTO A .TXT FILE and SEND THE USER TO MY SUCCESS.PHP page that would be great. Maybe it's because I am using an OLD way of scripting in miva (no compilation, someone told me before I was using old miva).

                          Comment

                          • wajake41
                            Mega Mivite


                            • Dec 2009
                            • 2294

                            #14
                            Re: How to open a PHP success page in MIVA

                            Yes, I see that the success.php runs OK from a browser so there's no problem with it, hopefully somebody familiar with server side Miva (that's not me) can provide a solution that will execute the server success.php program rather than submit the success.html page. Sorry for the misguided replies. Larry
                            Larry
                            Luce Kanun Web Design
                            www.facebook.com/wajake41
                            www.plus.google.com/116415026668025242914/posts?hl=en


                            Comment

                            • imyb
                              Mini Mivite

                              • Oct 2013
                              • 13

                              #15
                              Re: How to open a PHP success page in MIVA

                              No problem Larry, I appreciate you taking the time to try to help. I appreciate it. From what you just wrote... Are you telling me that the script that was working before because it was HTML it was SUBMITTED and would work and the issue is that a PHP file it not really submitted but has to be EXECUTED? I guess this is the difference between an HTML and PHP file, they are executed differently... one is submitted the other needs to be EXECUTED to work?

                              If this is the case, then it at least gives me more options to search the internet for a solution. I even tried to do a 301 redirect of the old success.html to success.php but that didn't work either. My knowledge is reaching it's limit very fast ;-)

                              Comment

                              Working...
                              X