Solved

Getting error when clicking on link

Posted on 2007-03-21
9
196 Views
Last Modified: 2007-03-22
I think this page might be wrong.  When I click on a one of the links such as whoweare, I get a an error:

The requested URL /help.asp was not found on this server

The entire page is this:

<?php
function GetCurrentPage($CallId){
    switch ($CallId) {
    case "whoweare":
        $GetCurrentPage = "<div style=\"margin-top: 40px; font: normal 15px verdana\" align=\"center\">Who We Are</div><div class=\"faq_default\" style=\"margin-left: 125px; margin-bottom: 20px\">&nbsp;&nbsp;&nbsp;&nbsp;As a homeowner, property owner or renter, it can be frustrating at times to find someone qualified to perform a particular home or yard service you need.  Presently, you’re mostly limited 2 choices.  One is looking through the Yellow Pages or perhaps newspaper classified ads.  The other is by using the popular word-of-mouth method.  Most residents in any community would rather select a service provider by word-of-mouth than by other available means. This is because you often will receive at least some information from others on the quality and completeness of the work performed.  The word-of-mouth sources usually are neighbors, friends, relatives, social clubs, where your work or shop. Yes, the word-of-mouth method can be effective but unfortunately is often limited to just a few people you can find that had work done similar to what you need done.  Fortunately there is a better way to hire competent help that provide reliably good service at a reasonable price.";
        $GetCurrentPage = $GetCurrentPage ."<p>&nbsp;&nbsp;&nbsp;&nbsp;We are residents in Moore County with the same service needs as anyone else.  Over the years, we often felt frustrated with the current limited options of finding a service provider who can be trusted to do good work at a fair price. So we decided to do something about it.  We thought, why not utilize the tremendous growth and increasing breadth of the Internet to offer a more compelling and convenient way of finding services you need, when you need them.";
        $GetCurrentPage = $GetCurrentPage ."</p><p>&nbsp;&nbsp;&nbsp;&nbsp;Welcome to Ask2bsure.com, a new Internet service being introduced in mid 2007 to all residents in Moore County and surrounding areas. The service we provide is at no cost to anyone using the service. All we ask is that when the service provider you hired completes the work, you take a few minutes to rate the company’s work for other residents to see.  If the provider doesn’t maintain an overall fully satisfactory rating, as rated by you and other residents in the community, the company will no longer be listed as a recommended service on Ask2bsure.com. We think though, most service providers will appreciate our service since they can look at their customer rating reviews on our website and improve in performance areas residents see as lacking.  The end result we hope will be more qualified services being offered to a greater number of happy customers in our community.</p></div>";
         break;
        case "suggestions":
                  $GetCurrentPage = "<div style=\"margin-top: 40px; margin-left: 200px\"><table><tr><form action=\"/send_suggestion.php\" method=\"post\"><td>Your Email:</td><td><input type=\"text\" name=\"email\" size=\"40\"></td></tr><tr><td valign=\"top\">I have a suggestion...</td><td><textarea rows=\"10\" cols=\"50\" name=\"suggest\"></textarea></td><td></tr><tr><td colspan=\"2\" align=\"center\" height=\"24\"><input type=\"submit\" value=\"Send Suggestion\"></td></form></tr></table></div>";
               break;

        case "contact":
                  $GetCurrentPage = "<div style=\"margin-top: 40px; margin-left: 200px\"><table><tr><form action=\"/send_suggestion.php\" method=\"post\"><td>Your Email:</td><td><input type=\"text\" name=\"email\" size=\"40\"></td></tr><tr><td valign=\"top\">Your Comments</td><td><textarea rows=\"10\" cols=\"50\" name=\"suggest\"></textarea></td><td></tr><tr><td colspan=\"2\" align=\"center\" height=\"24\"><input type=\"submit\" value=\"Send Suggestion\"></td></form></tr></table></div>";
                  break;
        case "faq":
                  $GetCurrentPage = "<div style=\"margin-top: 40px; margin-left: 125px; color: #134282\" id=\"faq_q\">Why was Ask2bsure.com created?<div class=\"faq_default\">We are residents in Moore County with the same service needs as anyone else.  Over the years, we often felt frustrated with the current limited options of finding a service provider who can be trusted to do good work at a fair price. So we decided to do something about it.  We thought, why not utilize the recent tremendous growth and increasing breadth of the Internet to offer a more compelling, convenient and quick way of finding services with a proven track record of doing good work.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\" id=\"faq_q\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"mjx.toggle('menu2'); return false\">What service categories are provided?</a><div id=\"menu2\" class=\"faq\">Presently we plan to offer 36 home & yard services such as appliance service & repair, carpet cleaning, driveway repair and home remodeling. Our intent is to have the services listed to accommodate more than 90% of all service provider inquiries associated with your home and yard.  If there is a service you need that is not listed, we encourage you to make suggestions to us to include additional categories. We promise to review all suggestions that can easily made directly from our website – just click the Suggestions tab under Help.";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\">If the community response is very enthusiastic to Ask2bsure.com’s service, we will consider expansion to other areas.  Under consideration are a wide range of personal services such as taxicabs, clothing alterations, pet grooming and florists.  Also we’re considering automotive services such as installing alarm systems, body shop repair and windshield replacement.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"mjx.toggle('menu3'); return false\">Why is your website titled Ask2bsure.com?</a><div id=\"menu3\" class=\"faq\">Finding the right service provider to do important work requires us to ask “due diligence” questions about the company’s qualifications. We will ask each company if they are licensed, insured or bonded. Before listing a company we will ask to be sure about the provider’s performance track record in doing good work. We require a minimum of 3 customer ratings be on file of the company’s prior work.  The company then will only be listed if it has a minimum 3 star rating (satisfactory performance) as rated by people like you. The company then must maintain this minimum rating of satisfactory, to continue being listed on Ask2bsure.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"mjx.toggle('menu4'); return false\">Is there anything I should do in helping me choose the right Service Provider?</a><div id=\"menu4\" class=\"faq\">You should ask to be sure about the company’s suitability to do the work.  Some typical questions you might ask would be: Have you done this specific type of work before? Are you familiar with the building code in my town?  Will you obtain the necessary town permits to do the work?  Do you have names of references I can call?  If you then are satisfied with the answers received, then confidently hire that service.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"javascript:mjx.toggle('menu5');\">Do I have to pay anything in using your service?</a><div id=\"menu5\" class=\"faq\">No, the service is absolutely free to anyone needing a service that lives in Moore County or surrounding counties. We receive payment to operate our business directly from the service providers. Just the way they would have to pay to promote their business typically – newspapers, publications, Yellow Pages, TV and radio commercials etc.";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\">We do ask residents however to log on to Ask2bsure to fill out a <u>frank and fair rating assessment of the company’s work once the work is completed</u>. It’s important to do for 2 reasons:  1. Community residents will appreciate your candid assessment when they review the company’s qualifications in deciding to hire them or not.  2.  Your feedback is essential to the listed company for them to review their strengths and weaknesses as determined by their customers and make improvements where necessary.  One final note, if you do not have a computer or don’t have access to one, please ask the service provider who did the work for you, for a printed copy of the Rating sheet. They should have a courtesy supply for their customers.  Once you fill it out, you can then mail it in to Ask2bsure. Once received, we will then gladly enter it into our system.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"javascript:mjx.toggle('menu6');\" title=\"Expand? Collapse?\">Does Ask2bsure.com provide any guarantee on the services provided?</a><div id=\"menu6\" class=\"faq\">No, we do not offer any guarantee that the service provided to you will be satisfactory.  Our role is to ask each provider listed on Ask2bsure.com for certain required information (business license #’s, asking if they are insured or bonded, how long have they been in business etc.) and expect them in good faith to answer honestly and fully.  We then ask each customer to fill out a frank and fair assessment of the completed work that we then share with all residents making an inquiry of the provider’s performance history.  We also ask anyone considering hiring a particular company to ask “due diligence” questions (see # 4 above) before you decide to hire.  In the end it’s in your hands to make the right hiring decision and we try to provide you with helpful information in the selection process.</div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px; margin-bottom: 20px;\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"javascript:mjx.toggle('menu7');\" title=\"Expand? Collapse?\">Will my privacy be protected in using your website?</a><div id=\"menu7\" class=\"faq\">Yes.  We think it’s absolutely essential your privacy be protected.  Initially, when you are in the process of finding companies that do the type of work you’re requesting, we ask you to <u>only enter your zip code</u> so we can list providers found starting closest to the town you live in.  So there is no private information asked for at this point in the finding process.  After the work is completed, we ask you to rate the company’s performance.  At that time we state you can optionally provide your name, address, phone # and e-mail address to facilitate the provider making contact with you.  The provider may want to contact you if there was a problem identified in the review that needs to be remedied or the provider might ask for some clarification on some review details.  Your privacy is important to us and the optional personal information, if given, will not be shared with anyone else.</div>";
                break;
      }
}


$strSections = "faq|FAQ,whoweare|Who We Are,suggestions|Suggestions,contact|Contact Us";

echo "<div id=\"faq_menu\">";

$strSplitSections = explode(",",$strSections);

for ($i = 0; $i<sizeof($strSplitSections); $i++){
      $strTempSplit = explode("|",$strSplitSections[$i]);
      echo "<div id=\"" . $strTempSplit[0] . "\" class=\"tabs\"";
     
      if($strTempSplit[0] == trim( strtolower( $_GET["id"] ) ) ) {
            echo " current\">";
      } else {
            echo " style=\"cursor:pointer\" onclick=\"GoToPage('" .$strTempSplit[0]. "')\">";
      }
      echo $strTempSplit[1]. "</div>";

}
           

echo "</div>";
echo "<div id=\"content\">" .$GetCurrentPage. "" . $_GET["id"]. "</div>";
?>
0
Comment
Question by:pingeyeg
  • 5
  • 4
9 Comments
 
LVL 5

Expert Comment

by:Oscurochu
Comment Utility
where is the javascript defined function "GoToPage()"?
0
 
LVL 1

Author Comment

by:pingeyeg
Comment Utility
Sorry,

<script type="text/javascript" language="javascript">
function GoToPage(id){
  window.location = 'http://'+document.domain+'/help.asp?id='+id
}
</script>
0
 
LVL 5

Expert Comment

by:Oscurochu
Comment Utility
what is the filename of the php file?
0
 
LVL 1

Author Comment

by:pingeyeg
Comment Utility
I just realized I did that, but now I only get the name of the page I am looking for and not the information for it.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 5

Expert Comment

by:Oscurochu
Comment Utility
You have defined the page contents in a function that isn't being called.

Either set a return value for the function GetCurrentPage() and print the value, or remove the " function GetCurrentPage()" line, the beginning, and ending braces.
0
 
LVL 5

Accepted Solution

by:
Oscurochu earned 500 total points
Comment Utility
this is what i would do (it should work, if the old code worked):

<?php
    $CallId = $_GET['id'];
    switch ($CallId) {
    case "whoweare":
        $GetCurrentPage = "<div style=\"margin-top: 40px; font: normal 15px verdana\" align=\"center\">Who We Are</div><div class=\"faq_default\" style=\"margin-left: 125px; margin-bottom: 20px\">&nbsp;&nbsp;&nbsp;&nbsp;As a homeowner, property owner or renter, it can be frustrating at times to find someone qualified to perform a particular home or yard service you need.  Presently, you’re mostly limited 2 choices.  One is looking through the Yellow Pages or perhaps newspaper classified ads.  The other is by using the popular word-of-mouth method.  Most residents in any community would rather select a service provider by word-of-mouth than by other available means. This is because you often will receive at least some information from others on the quality and completeness of the work performed.  The word-of-mouth sources usually are neighbors, friends, relatives, social clubs, where your work or shop. Yes, the word-of-mouth method can be effective but unfortunately is often limited to just a few people you can find that had work done similar to what you need done.  Fortunately there is a better way to hire competent help that provide reliably good service at a reasonable price.";
        $GetCurrentPage = $GetCurrentPage ."<p>&nbsp;&nbsp;&nbsp;&nbsp;We are residents in Moore County with the same service needs as anyone else.  Over the years, we often felt frustrated with the current limited options of finding a service provider who can be trusted to do good work at a fair price. So we decided to do something about it.  We thought, why not utilize the tremendous growth and increasing breadth of the Internet to offer a more compelling and convenient way of finding services you need, when you need them.";
        $GetCurrentPage = $GetCurrentPage ."</p><p>&nbsp;&nbsp;&nbsp;&nbsp;Welcome to Ask2bsure.com, a new Internet service being introduced in mid 2007 to all residents in Moore County and surrounding areas. The service we provide is at no cost to anyone using the service. All we ask is that when the service provider you hired completes the work, you take a few minutes to rate the company’s work for other residents to see.  If the provider doesn’t maintain an overall fully satisfactory rating, as rated by you and other residents in the community, the company will no longer be listed as a recommended service on Ask2bsure.com. We think though, most service providers will appreciate our service since they can look at their customer rating reviews on our website and improve in performance areas residents see as lacking.  The end result we hope will be more qualified services being offered to a greater number of happy customers in our community.</p></div>";
         break;
        case "suggestions":
                  $GetCurrentPage = "<div style=\"margin-top: 40px; margin-left: 200px\"><table><tr><form action=\"/send_suggestion.php\" method=\"post\"><td>Your Email:</td><td><input type=\"text\" name=\"email\" size=\"40\"></td></tr><tr><td valign=\"top\">I have a suggestion...</td><td><textarea rows=\"10\" cols=\"50\" name=\"suggest\"></textarea></td><td></tr><tr><td colspan=\"2\" align=\"center\" height=\"24\"><input type=\"submit\" value=\"Send Suggestion\"></td></form></tr></table></div>";
               break;

        case "contact":
                  $GetCurrentPage = "<div style=\"margin-top: 40px; margin-left: 200px\"><table><tr><form action=\"/send_suggestion.php\" method=\"post\"><td>Your Email:</td><td><input type=\"text\" name=\"email\" size=\"40\"></td></tr><tr><td valign=\"top\">Your Comments</td><td><textarea rows=\"10\" cols=\"50\" name=\"suggest\"></textarea></td><td></tr><tr><td colspan=\"2\" align=\"center\" height=\"24\"><input type=\"submit\" value=\"Send Suggestion\"></td></form></tr></table></div>";
                  break;
        case "faq":
                  $GetCurrentPage = "<div style=\"margin-top: 40px; margin-left: 125px; color: #134282\" id=\"faq_q\">Why was Ask2bsure.com created?<div class=\"faq_default\">We are residents in Moore County with the same service needs as anyone else.  Over the years, we often felt frustrated with the current limited options of finding a service provider who can be trusted to do good work at a fair price. So we decided to do something about it.  We thought, why not utilize the recent tremendous growth and increasing breadth of the Internet to offer a more compelling, convenient and quick way of finding services with a proven track record of doing good work.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\" id=\"faq_q\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"mjx.toggle('menu2'); return false\">What service categories are provided?</a><div id=\"menu2\" class=\"faq\">Presently we plan to offer 36 home & yard services such as appliance service & repair, carpet cleaning, driveway repair and home remodeling. Our intent is to have the services listed to accommodate more than 90% of all service provider inquiries associated with your home and yard.  If there is a service you need that is not listed, we encourage you to make suggestions to us to include additional categories. We promise to review all suggestions that can easily made directly from our website – just click the Suggestions tab under Help.";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\">If the community response is very enthusiastic to Ask2bsure.com’s service, we will consider expansion to other areas.  Under consideration are a wide range of personal services such as taxicabs, clothing alterations, pet grooming and florists.  Also we’re considering automotive services such as installing alarm systems, body shop repair and windshield replacement.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"mjx.toggle('menu3'); return false\">Why is your website titled Ask2bsure.com?</a><div id=\"menu3\" class=\"faq\">Finding the right service provider to do important work requires us to ask “due diligence” questions about the company’s qualifications. We will ask each company if they are licensed, insured or bonded. Before listing a company we will ask to be sure about the provider’s performance track record in doing good work. We require a minimum of 3 customer ratings be on file of the company’s prior work.  The company then will only be listed if it has a minimum 3 star rating (satisfactory performance) as rated by people like you. The company then must maintain this minimum rating of satisfactory, to continue being listed on Ask2bsure.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"mjx.toggle('menu4'); return false\">Is there anything I should do in helping me choose the right Service Provider?</a><div id=\"menu4\" class=\"faq\">You should ask to be sure about the company’s suitability to do the work.  Some typical questions you might ask would be: Have you done this specific type of work before? Are you familiar with the building code in my town?  Will you obtain the necessary town permits to do the work?  Do you have names of references I can call?  If you then are satisfied with the answers received, then confidently hire that service.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"javascript:mjx.toggle('menu5');\">Do I have to pay anything in using your service?</a><div id=\"menu5\" class=\"faq\">No, the service is absolutely free to anyone needing a service that lives in Moore County or surrounding counties. We receive payment to operate our business directly from the service providers. Just the way they would have to pay to promote their business typically – newspapers, publications, Yellow Pages, TV and radio commercials etc.";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\">We do ask residents however to log on to Ask2bsure to fill out a <u>frank and fair rating assessment of the company’s work once the work is completed</u>. It’s important to do for 2 reasons:  1. Community residents will appreciate your candid assessment when they review the company’s qualifications in deciding to hire them or not.  2.  Your feedback is essential to the listed company for them to review their strengths and weaknesses as determined by their customers and make improvements where necessary.  One final note, if you do not have a computer or don’t have access to one, please ask the service provider who did the work for you, for a printed copy of the Rating sheet. They should have a courtesy supply for their customers.  Once you fill it out, you can then mail it in to Ask2bsure. Once received, we will then gladly enter it into our system.</div></div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"javascript:mjx.toggle('menu6');\" title=\"Expand? Collapse?\">Does Ask2bsure.com provide any guarantee on the services provided?</a><div id=\"menu6\" class=\"faq\">No, we do not offer any guarantee that the service provided to you will be satisfactory.  Our role is to ask each provider listed on Ask2bsure.com for certain required information (business license #’s, asking if they are insured or bonded, how long have they been in business etc.) and expect them in good faith to answer honestly and fully.  We then ask each customer to fill out a frank and fair assessment of the completed work that we then share with all residents making an inquiry of the provider’s performance history.  We also ask anyone considering hiring a particular company to ask “due diligence” questions (see # 4 above) before you decide to hire.  In the end it’s in your hands to make the right hiring decision and we try to provide you with helpful information in the selection process.</div>";
                  $GetCurrentPage = $GetCurrentPage ."<div style=\"margin-top: 10px; margin-bottom: 20px;\"><a href=\"#\" style=\"color: #134282; text-decoration: none;\" onClick=\"javascript:mjx.toggle('menu7');\" title=\"Expand? Collapse?\">Will my privacy be protected in using your website?</a><div id=\"menu7\" class=\"faq\">Yes.  We think it’s absolutely essential your privacy be protected.  Initially, when you are in the process of finding companies that do the type of work you’re requesting, we ask you to <u>only enter your zip code</u> so we can list providers found starting closest to the town you live in.  So there is no private information asked for at this point in the finding process.  After the work is completed, we ask you to rate the company’s performance.  At that time we state you can optionally provide your name, address, phone # and e-mail address to facilitate the provider making contact with you.  The provider may want to contact you if there was a problem identified in the review that needs to be remedied or the provider might ask for some clarification on some review details.  Your privacy is important to us and the optional personal information, if given, will not be shared with anyone else.</div>";
                break;
      }


$strSections = "faq|FAQ,whoweare|Who We Are,suggestions|Suggestions,contact|Contact Us";

echo "<div id=\"faq_menu\">";

$strSplitSections = explode(",",$strSections);

for ($i = 0; $i<sizeof($strSplitSections); $i++){
      $strTempSplit = explode("|",$strSplitSections[$i]);
      echo "<div id=\"" . $strTempSplit[0] . "\" class=\"tabs\"";
     
      if($strTempSplit[0] == trim( strtolower( $_GET["id"] ) ) ) {
            echo " current\">";
      } else {
            echo " style=\"cursor:pointer\" onclick=\"GoToPage('" .$strTempSplit[0]. "')\">";
      }
      echo $strTempSplit[1]. "</div>";

}
           

echo "</div>";
echo "<div id=\"content\">" .$GetCurrentPage. "" . $_GET["id"]. "</div>";
?>
0
 
LVL 5

Assisted Solution

by:Oscurochu
Oscurochu earned 500 total points
Comment Utility
change the last line, before ?>, to

echo "<div id=\"content\">" .$GetCurrentPage. "</div>";
0
 
LVL 1

Author Comment

by:pingeyeg
Comment Utility
Think you so much for that.  I only have one more problem, but I guess I can post that on a new thread.
0
 
LVL 1

Author Comment

by:pingeyeg
Comment Utility
Yup, that fixed it!!  Great!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now