Advertisement

09.17.2008 at 08:47PM PDT, ID: 23741170
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

document.location question and passing values

Asked by Simon336697 in PHP Scripting Language, JavaScript

Hi guys.

I have the following setup:

PAGE 1   (addmenu4entry.php)         ---------------------------->       PAGE 2 (processmenu4entry.php)

========================================================== addmenu4entry.php
<form action="processmenu4entry.php" method="post" style="margin-top:0%;">
<label style="color:white;">Type your term here to add a new entry:&nbsp;&nbsp;</label>
<input type="text" name="newmenu4entry" size="30" />
<input type="submit" name="submitword" value="SUBMIT" />
</form>

=========================================================== processmenu4entry.php
In here, I retrieve the value of the posted variable 'newmenu4entry' from
addmenu4entry.php as follows...

if ($set_status == 1) {
  $menu4_entry = $_POST['newmenu4entry'];

So I now have the value of $menu4_entry in processmenu4entry.php

#########################################
WHAT I WANT TO DO IN processmenu4entry.php
#########################################

a) After I have got the value of newmenu4entry through using

$menu4_entry = $_POST['newmenu4entry'];

I want to set up a confirm box requesting the user to either click on 'OK' to proceed,
or 'Cancel' to discontinue running the processmenu4entry.php script.

b) So, currently i put the following javascript function into my page:
This basically says "If you clicked on ok, then point to the same page im in, and set the parameter continue to 1, otherwise you clicked cancel, so set continue to be 0
====================================================================
<script type="text/javascript">
function confirmation() {
        if (confirm("Do you wish to proceed?")){
                document.location.href = "processmenu4entry.php?continue=1";
        } else {
        document.location.href = "processmenu4entry.php?continue=0";
        }
}
</script>
===================================================================

Now, after I have returned the value for

$menu4_entry = $_POST['newmenu4entry'];

I then called the confirmation function with:

================================== the below presents the user with the confirm box:
 if (!isset($_GET['continue'])) { ?>
<script type="text/javascript">confirmation(); </script> <?php

========================= if the user has already clicked on cancel, or ok, then the else follows..
1) which gets the value of continue from the query string
2) then checks the value of continue...

else {
$continue = $_GET['continue'];

if ($continue) {   do this

else { do that  }

########################
PROBLEM:
########################

I need access to the value of the $menu4_entry inside of:

else {
$continue = $_GET['continue'];

if ($continue) {   do this  ------> this is where i need access to the value of $menu4_entry

else { do that ---------> also here }

Because this if else is looking at the value of the continue parameter in the querystring submitted by the javascript function confirmation, it seems im losing access to the value of $menu4_entry inside this code, so im wondering how to get access to thie $menu4_entry inside this code area.

The value of $menu4_entry is available outside of this, but not when checking the value of continue.

I need to have access to $menu4_entry after the user has clicked on OK or cancel, so I can then use its value to perform other things.

Any help on this greatly appreciated.











Start Free Trial
[+][-]09.17.2008 at 10:03PM PDT, ID: 22507919

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, JavaScript
Sign Up Now!
Solution Provided By: TheAnarchist
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.17.2008 at 10:04PM PDT, ID: 22507922

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 10:47PM PDT, ID: 22508070

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 10:49PM PDT, ID: 22508080

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.17.2008 at 10:52PM PDT, ID: 22508091

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.22.2008 at 08:08AM PDT, ID: 22540716

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628