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 8720821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:07:10+00:00 2026-06-13T07:07:10+00:00

I have a contact form that checks if some field is empty when you

  • 0

I have a contact form that checks if some field is empty when you click on ‘complete order’
It should refresh the page and display the error message.

But im using a page rename (some easy way to rename pages and have multiple pages on same php page)

So i put the contact form in order.php?action=order

This is the code:

<?php
if(isset($_GET['action']) && $_GET['action'] != '') {
   $action = $_GET['action'];
} else {

}
?>
<?php
if(isset($action)) {
  if($action == 'order') {
?>
<div class="container">

            <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform">
                <fieldset>


                    <?php if(isset($hasError)) { //If errors are found ?>
                        <p class="alert-message error">Opps! Looks like you forgot to fill some specify field, please <b>go back</p> and fill the empty field.</p>

                    <?php  } ?>

                    <?php if(isset($emailSent) && $emailSent == true) { //If email is sent ?>
                        <div class="alert-message success">
                            <p style="color: white;" ><strong>Your Order has been Successfully Sent!</strong></p>
                            <p style="color: white;" >Thank you for submitting your order, <strong><?php echo $pname;?></strong>! Please check your Private Messages folder at <strong><?php echo $forum;?></strong>, as we will get back to you soon. You will redirect back to homepage in less than 5 seconds.<meta HTTP-EQUIV="REFRESH" content="5; url=http://justxp.plutohost.net/jonydesigns/index.php"></p>
                        </div>
                    <?php } ?>
                        <div class="formwarp">
                        <div class="tos1">
<input type="checkbox" id="new_info_yes" class="box1"> I agree to the <a href="#" style="color: #4fc5cf;" >Terms of Service</a>.
    </div><br />
<div id="new_info_form">
                    <div class="clearfix">
                        <label for="subject">
                            <span class="coloring">Forums Name:</span>
                        </label>


                                            <div class="input">
                            <select name="forumn" id="forumn" class="span6 required" role="select" aria-required="true">
                                <option value="slct">Please select a forum</option>
                                <option value="hackforums">Hackforums</option>
                                <option value="sythe">Sythe</option>
                                <option value="rune-server">Rune-Server</option>
                            </select>
                        </div>
                    <br />
<div id="slct" class="colors">You haven't selected any forum.</div>
<div id="hackforums" class="colors" style="display:none"> <span id="brdr">HackForums:</span> Discount Percent: <font color="green">10%</font> </div>
<div id="sythe" class="colors" style="display:none"> <span id="brdr">Sythe:</span> Discount Percent: <font color="green">15%</font> </div>
<div id="rune-server" class="colors" style="display:none"> <span id="brdr">Rune-Server:</span> Discount Percent: <font color="green">15%</font> </div>
<script type="text/javascript">
    $(function() {
        $('#forumn').change(function(){
            $('.colors').hide();
            $('#' + $(this).val()).show();
        });
    });
    </script> </div>
<br />
                    <div class="clearfix">
                        <label for="name">
                            <span class="coloring">Forums Username:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="forumuser" id="forumuser" value="" class="span6 required" role="input" aria-required="true" />
                        </div>
                    </div>

                    <div class="clearfix">
                        <label for="phone">
                            <span class="coloring">Personal Name:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="pname" id="pname" value="" class="span6 required" role="input" aria-required="true" />
                        </div>
                    </div>


                    <div class="clearfix">
                        <label for="email">
                            <span class="coloring">Email Address:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="email" id="email" value="" class="span6 required email" role="input" aria-required="true" />
                        </div>
                    </div>
                                        <div class="clearfix">
                        <label for="email">
                            <span class="coloring">PayPal Email Address:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="ppemail" id="ppemail" value="" class="span6 required email" role="input" aria-required="true" />
                        </div>
                    </div>

                    <div class="clearfix">
                        <label for="subject">
                            <span class="coloring">Product Type</span>
                        </label>
                        <div class="input">
                            <select name="product" id="product" class="span6 required" role="select" aria-required="true">
                                <option>Please select a product\project</option>
                                <option>PSD to HTML</option>
                                <option>Web Design</option>
                                <option>Thread Design</option>
                                <option>Logo Design</option>
                                <option>Banner Design</option>
                                <option>Thread design + Signature</option>
                                <option>Other (Please type in additional information field)</option>
                            </select>
                        </div>
                    </div><br />
<div style="margin-left: -13%;" id="line"></div><br />
                    <div class="clearfix">
                        <span class="coloring">Information</span>
                        <div class="input">
                            <textarea rows="8" name="message" id="message" class="span10 required" role="textbox" aria-required="true"></textarea>
                        </div>
                    </div>
                    <div class="clearfix">
                        <span class="coloring">View Information</span>
                        <div class="input">
                            <textarea rows="8" name="messageview" id="messageview" class="span10 required" role="textbox" aria-required="true"></textarea>
                        </div>
                    </div>
                    <div class="clearfix">
                        <label for="phone">
                            <span class="coloring">Additional Information:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="additional" id="additional" value="Additional information regarding the product" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" class="span6 required" role="input" aria-required="true" />
                        </div>
                    </div>
                    <div class="clearfix">
                        <label for="phone">
                            <span class="coloring">PSD link:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="psd" id="psd" value="PSD link here" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" class="span6 required" role="input" aria-required="true" />
                        </div>
                    </div>
                    <div class="clearfix">
                        <label for="phone">
                            <span class="coloring">Your Budget:</span>
                        </label>
                        <div class="input">
                            <input type="text" name="money" id="money" value="$0.00 Enter your budget" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" class="span6 required" role="input" aria-required="true" />
                        </div>
                    </div>
                    <div class="actionss">
                        <input type="submit" value="Complete Order" name="submit" id="submitButton" title="Click here to submit your message!" />
                    </div>
                </fieldset>
            </form>
            </div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){

    $('input#upload_yes').change(function(){
        if($(this).is(':checked')) {
            $("#upload_form").show();
        } else {
            $("#upload_form").hide();
        }
    });

    $('input#new_info_yes').change(function(){
         if($(this).is(':checked')) {
                $("#new_info_form").slideDown(500);
        } else {
                $("#new_info_form").delay(300).slideUp(500);;
        }   
    });

    //Trigger the change event so the divs are initially shown or hidden.
    $('input[type=checkbox]').trigger('change');

});
</script>
<?php
  } 
  elseif($action == 'contact') {
  ?>
 <!-- action=contact info here -->
<?php
  }
}
?>

This starts the page ?action=order

<?php
if(isset($action)) {
  if($action == 'order') {
?>

It displays the form and everything is ok..
But when you fill everything and click complete order, it redirects to order.php and it doesn’t display any alerts, it should display this alert if the order was sent:

                <?php if(isset($emailSent) && $emailSent == true) { //If email is sent ?>
                    <div class="alert-message success">
                        <p style="color: white;" ><strong>Your Order has been Successfully Sent!</strong></p>
                        <p style="color: white;" >Thank you for submitting your order, <strong><?php echo $pname;?></strong>! Please check your Private Messages folder at <strong><?php echo $forum;?></strong>, as we will get back to you soon. You will redirect back to homepage in less than 5 seconds.<meta HTTP-EQUIV="REFRESH" content="5; url=http://justxp.plutohost.net/jonydesigns/index.php"></p>
                    </div>
                <?php } ?>

And should display this error if something was empty:

                <?php if(isset($hasError)) { //If errors are found ?>
                    <p class="alert-message error">Opps! Looks like you forgot to fill some specify field, please <b>go back</p> and fill the empty field.</p>

                <?php  } ?>

but it doesn’t show the error at all, all it does it redirect you to order.php page but if successful it just sends the email but will not display any alert.

How could I fix it or what is causing it to happen?

http://justxp.plutohost.net/jonydesigns/order.php?action=order

Sorry for the huge code, I just didn’t know how to ask this question more cleaner.

  • 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-06-13T07:07:11+00:00Added an answer on June 13, 2026 at 7:07 am

    A right I solved it,

    I put moved the errors section out of the page, to the start of , now it checks if there was an error or not, if yes it will display the errors or alerts.

    Sorry for posting such an easy question ^^

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a contact page (contact.php) that sends a form (formsend.php) when people fill
Have a form that is emailed with checkboxes. Some checkboxes have an optional field
I've got a basic PHP contact form and have it process.php file that checks
I have a contact form that can be hidden using .slideToggle() but I want
I have a contact us form that uses Ajax (i.e. relies on asynchronous requests).
i have a PHP contact form that submits data, and an email...: <?php $dbh=mysql_connect
I have an Ajax contact form that links to a jquery file but for
i have bought a template that have built in contact form problem is that
I have a simple contact form with Subject and Message that I want to
I have a contact form that has a drop-down for referral source. If Magazine

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.