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

  • SEARCH
  • Home
  • 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 8451445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:14:33+00:00 2026-06-10T11:14:33+00:00

Why my email sript is not running ? I tried with isset(), strlen(), also

  • 0

Why my email sript is not running ? I tried with isset(), strlen(), also I have used it with other page i.e used script in other page and set action of form to that page url.
Variables are not empty. Below mentioned is the complete code of my script

    <body>
<?
$to="sunjava11@gmail.com";
$name=$_POST["name"];
$email=$_POST["name2"];
$phone=$_POST["name3"];
$text=$_POST["message"];
$message="
Name: ".$name."\n
Email: ".$email."\n
Phone: ".$phone."\n
Message: ".$text."
";
function okay (){

if(!empty($name))
{
return true;
}

if(!empty($email))
{

return true;
}

if(!empty($text))
{

return true;
}
}

if (okay()==true)
{
$headers="From ".$name;
$subject="Contact Online at Al-Khidmat Punjab Website ";
mail($to,$subject,$message,$headers);
}
else
{
echo "mail not sent";
}






?>
<form id="form1" name="form1" method="post" action="/subpage-recv">
  <table width="618" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="232" class="leftCol">Name</td>
      <td width="370"><label for="name"></label>
      <input type="text" name="name" id="name" class="input" /></td>
    </tr>
    <tr>
      <td class="leftCol">Email</td>
      <td class="rightCol"><input type="text" name="name2" id="name2" class="input" /></td>
    </tr>
    <tr>
      <td class="leftCol">Phone Number <span class="smalltext">(optional)</span></td>
      <td class="rightCol"><input type="text" name="name3" id="name3" class="input" /></td>
    </tr>
    <tr>
      <td class="leftCol" style="border:none">Message</td>
      <td class="rightCol" style="border:none"><label for="message"></label>
      <textarea name="message" id="message" cols="45" rows="5" ></textarea></td>
    </tr>
    <tr>
      <td colspan="2" align="center"><input type="submit" value="Send" id="send"></td>      
    </tr>
  </table>
</form>
</body>
  • 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-10T11:14:35+00:00Added an answer on June 10, 2026 at 11:14 am

    The global variables are not visible inside okay() .

    You may use the global-keyword or the $GLOBALS-array to be able to access them.

    http://php.net/manual/en/language.variables.scope.php

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

Sidebar

Related Questions

I'm using the PHPMailer-Lite class to build an email sending script and I'm not
My script send the email but it doesn't render the html tags. I'm not
I have done an email approval script following James Ferreira's youtube tutorial here .
I have written a perl script to send email using the gmail's smtp server:
I have a powershell script that will generate an email for users whose password
I have a php pipe script that receives an email, takes an attached *.csv
I have the following part of a validation script: $invalidEmailError .= <br/>&raquo;&nbsp;You did not
I am running a PHP script as a cron job. An email is fired
I have a complete automatic notification system running on my web page, that is
I want to email users an encrypted file from a Django Backend Script (running

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.