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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:18:13+00:00 2026-06-03T00:18:13+00:00

The following code is for a template that handles the forgot password section of

  • 0

The following code is for a template that handles the forgot password section of our website. (Please don’t berate me for it’s stupidity, I didn’t write it)
What I need to do is embed ‘/inc/forgot_password_form’ with a message of ‘Your PID must be numeric’ if the $_POST[‘PID’] has non numeric chars.
How would I modify this code to do that?

I know I can do it client-side using my jQuery validator but I’d rather do it here because I can also check a minimum value and show a special message for it.

{if segment_2 == 'submit'}
<?
  $embed_params = 'EmailAddress="' . $_POST['EmailAddress'] . '" PID="' . $_POST['PID'] . '" ';
?>
{embed='/inc/forgot_password_form' message='{exp:forgot_password:send_email code="{segment_3}" <?=$embed_params?>}' <?=$embed_params?>}
{if:elseif segment_2 == 'reset'}
{embed='/inc/forgot_password_reset' email='{exp:forgot_password:check_code code="{segment_3}" }'  code="{segment_3}"}
{if:elseif segment_2 == 'reset_submit'}
{embed='/inc/forgot_password_reset' message='{exp:forgot_password:update_password code="<?=$_POST['code']?>"  password="<?=$_POST['password']?>" }' }
{if:else}
{embed='/inc/forgot_password_form' }
{/if}

Edit with new code:

So you are saying to do it like this?

{if segment_2 == 'submit'}
<?
  $embed_params = 'EmailAddress="' . $_POST['EmailAddress'] . '" PID="' . $_POST['PID'] . '" ';
  if (!is_int($_POST['PID']) {
      {embed='/inc/forgot_password_form' message='You submitted an invalid Member #.' <?=$embed_params?>}
  } else {
      {embed='/inc/forgot_password_form' message='{exp:forgot_password:send_email code="{segment_3}" <?=$embed_params?>}' <?=$embed_params?>}
  }
?>
{if:elseif segment_2 == 'reset'}
{embed='/inc/forgot_password_reset' email='{exp:forgot_password:check_code code="{segment_3}" }'  code="{segment_3}"}
{if:elseif segment_2 == 'reset_submit'}
{embed='/inc/forgot_password_reset' message='{exp:forgot_password:update_password code="<?=$_POST['code']?>"  password="<?=$_POST['password']?>" }' }
{if:else}
{embed='/inc/forgot_password_form' }
{/if}
  • 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-03T00:18:14+00:00Added an answer on June 3, 2026 at 12:18 am

    Doing this via PHP is very simple, just you the is_int function.

    if (is_int($_POST['PID'])){
    
    // do this code
    
    }
    else{
    
    // Do this code
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that compiles and works well: template<typename T> T GetGlobal(const
My situation is the following: I have a template wrapper that handles the situation
Consider the following code: template<int* a> class base {}; int main() { base<(int*)0> test;
I have the following code: template <typename T> LuaCall& operator>>(T) { BOOST_STATIC_ASSERT(sizeof(T) == 0);
I have the following code: template <class T> struct pointer { operator pointer<const T>()
I have something like the following code: template<typename T1, typename T2, typename T3, typename
The following template specialization code: template<typename T1, typename T2> void spec1() { } Test
Given the following piece of code: template<typename T> class MyContainer { typedef T value_type;
This is using the web app framework, not Django. The following template code is
Inside my template function I have the following code: TypeName myFunction() { TypeName result;

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.