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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:07:04+00:00 2026-05-27T19:07:04+00:00

Ok so I have a php variable called $contact_id which is inputted from the

  • 0

Ok so I have a php variable called $contact_id which is inputted from the POST method.

$contact_id = $_POST['contact_id']; 

I want this variable to either store a phone number or an email address. I know this isn’t the best way to do things but I have to work with what I have been given.

I was thinking of having something like

if($output = checkEmailValidation($contact_id) == 1 || $output = checkPhoneValidation($contact_id) == 1)
{
//input into database
}
else
{
//display error message
}

checkEmailValidation($input)
{
//do something

return $whatever
}

checkPhoneValidation($input)
{
//do something

return $whatever
}

First of all would this work. Second of all what would I put in the functions to make this work.

Thanks.

  • 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-27T19:07:04+00:00Added an answer on May 27, 2026 at 7:07 pm

    For email and phone, I’d go here:

    Phone:
    http://regexlib.com/DisplayPatterns.aspx?categoryId=7&cattabindex=6&AspxAutoDetectCookieSupport=1

    Email:
    http://regexlib.com/(A(llgnVic_ey1CZ-ARhYWF5QuIIWLB_e6dL5XiIJIyg6XJi02tVUo6G-L3wnj86Y6iAAoHxFNohNJupckHv1t4NZOxUY2-7EPAF80Lp5q96SMN10FzqKsTUj58iAOwyeNYbpecP25_crQt663bemwnIVb4EJijt_raaBeWYVnQiw7c1nSrQQ3W3PNoyopPWB6K0))/DisplayPatterns.aspx?cattabindex=0&categoryId=1

    You can use PHP’s preg_match function to check them: http://php.net/manual/en/function.preg-match.php

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

Sidebar

Related Questions

I have a variable called $result which should store all the results from my
I have a PHP-variable called $go_Adress which contains the adress I need to get
I want to have a string variable for a PHP class, which would be
I have a php variable called $VrHistorySlider , defined like this: $VrHistorySlider.='<table border=0><tr><td>(oldest)</td><td style=padding:0px
I have a variable called $tags , which just references from a database field.
Static variable gotcha in php I am from Java background and have switched to
I needed suggestions for the following scenario. I have a php variable called $data
I have a variable called $final_time_saving which is just a number of minutes, 250
I have a php variable: $foo My MySQL table called data has the following
I have a variable called captcha from input in my form. In my javascript

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.