Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6095495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:49:07+00:00 2026-05-23T12:49:07+00:00

When I initially wrote this script, the site design did not require the execution

  • 0

When I initially wrote this script, the site design did not require the execution of the html after the die() functions. Now it does. I realize I can copy the end of the HTML code into each of the die() statements, but it contains a php include file (footer.inc.php) which is then ignored. (This is the workaround that I am going with at the moment, so the page looks OK but does not contain the footer.)

I tried switching the die() functions in the first sequence to if() and elseif() functions, but then it displays both the die() message and the message after the email code that indicates the email function was successful.

I am sure there is a way to have the script execute only one of these statements without using the die(), but I can’t figure it out. Any tips would be greatly appreciated!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta name="google-site-verification" content="0QW3jKsbHBGLvnLgLIoSHRuxjHBUI_MMQ0wn9J-4eo4" />
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
 <link href="../stylesheet.css" rel="stylesheet" type="text/css" /> 
  <link rel="icon" href="../images/favicon.ico" type="image/jpg" />
<title>Center Court - Schedule a racquet pick-up</title>
</head>
<body>
<div id="container">

<div id="liquid-round">
    <div class="top"><span></span></div>
        <div class="center-content">

<div id="header">
<?php include("../header2.inc.php"); ?>
</div>
<div id="nav">
<?php include("../nav.inc.php"); ?>
</div>
    <div id="phpscreen">
<?php
    //retrieve details from POST submission
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $address = $_POST['address'];
    $city = $_POST['city'];
    $retrieval = $_POST['retrieval'];
    $needed = $_POST['needed'];
    $string = $_POST['string'];
    $outofstock = $_POST['outofstock'];
    $tension = $_POST['tension'];
    $scale = $_POST['scale'];
    $extras= $_POST['extras'];
    $notes = $_POST['notes'];

    //validate sumbitted data
    if (empty($name)){
    die('<p class="center">Please provide your name.</p> <form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>');
    }

    if (empty($email)){
    die('<p class="center">Please provide your email.</p> <form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>');
    }

    if (empty($phone)){
    die('<p class="center">Please provide your phone number.</p> <form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>');
    }

    if (empty($address)){
    die('<p class="center">Please provide your address.</p> <form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>');
    }
    if (empty($city)){
    die('<p class="center">Please provide your city.</p> <form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>');
    }
    if (empty($needed)){
    die('<p class="center">Please provide the date and time you need your racquet.</p> <form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>');
    }
    //formulate email message
    $to = 'centercourtstringing@yahoo.com';
    $from = 'centercourtstringing.com';
    $subject = 'Contact from centercourtstringing.com';
    $body = "
    Name: $name\r\n
    Email: $email\r\n
    Phone number: $phone\r\n
    Address: $address\r\n
    City: $city\r\n
    Retrieval method: $retrieval\r\n
    Needed by: $needed\r\n
    String type: $string\r\n
    Similar or upgrade OK: $outofstock\r\n
    Tension: $tension\r\n
    Unsure scale: $scale\r\n
    Extras: $extras\r\n
    Special requests or notes: $notes\r\n";
    if(mail($to, $subject, $body, "From $from")){
        echo '<p>Your pick-up has been requested. You should receive confirmation shortly via e-mail or phone. If you do not hear from us by the end of the day, please call Center Court Tennis Shop at 203-966-2543.</p><p class="center"><a href="http://centercourtstringing.com">Return to home page</a></p>';
    }else{
        die('<p>Sorry, there was a mail delivery error. please call Center Court Tennis Shop at 203-966-2543 to schedule your pick-up.</p><p class="center"><a href="http://centercourtstringing.com">Return to home page</a></p>');
        }
        ?>
        </div>

<div id="footer">
<?php include("../footer.inc.php"); ?>
</div> <!--end footer-->

</div><!--end center content-->

    <div class="bottom"><span></span></div>
</div><!--end liquid-round-->
</div><!--end container-->

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-18191457-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script></body> </html> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:49:07+00:00Added an answer on May 23, 2026 at 12:49 pm

    You can build an $error variable and check it before attempting the email. Something along the lines of:

    $error = '';
    //validate sumbitted data
    if (empty($name)){
        $error .= '<p class="center">Please provide your name.</p>';
    }
    
    if (empty($email)){
        $error .= '<p class="center">Please provide your email.</p>';
    }
    
    // etc...
    
    if (empty($error)) {
        //formulate email message
        $to = 'centercourtstringing@yahoo.com';
        $from = 'centercourtstringing.com';
        $subject = 'Contact from centercourtstringing.com';
    
        // etc...
    
        if (mail($to, $subject, $body, "From $from")) {
            echo '<p>Your pick-up has been requested...</p>';
        } else {
            die('<p>Sorry, there was a mail delivery error...');
        }
    } else {
        echo $error;
        echo '<form><p class="center"><input type="button" value="Go back" onClick="history.go(-1);return true;"> </p></form>';
    }
    
    // Rest of HTML
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a script with two functions executed by setInterval() . One function rotateTheSun()
I initially designed my system following the s# architecture example outlined in this codeproject
I have read through the similar questions but do not see one like this.
I wrote a Windows Forms script that searched for all non-hidden and non-readonly folders
This is my second foray into Ajax and I'm not quite sure how to
Java was initially slow before the JIT but today performance is pretty close to
I need to generate buttons initially based on quite a processor and disk intensive
I have a modal popup that initially shows some content but expands a div
Right, initially ran: c:\regsvr32 Amazing.dll then, (accidentally - I might add) I must have
Currently Tomcat's login support redirects users back to where they initially were when the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.