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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:46:09+00:00 2026-06-18T08:46:09+00:00

i was just make a simple script, but it don’t work. function check_length($string, $min_length,

  • 0

i was just make a simple script, but it don’t work.

function check_length($string, $min_length, $max_length) {
  $length = strlen($string);
  if(strlen($length) < $min_length || strlen($length) > $max_length)
  { 
    header("Location: /kontakty/blad");
  }
}

check_length($_POST["name"], "3", "45");
check_length($_POST["surname"], "3", "45");
check_length($_POST["group_id"], "1", "11");

When i send data to script, the function don’t check this.


Edit: I was do like You wrote and now script don’t wanna redirect.

Full script

  • 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-18T08:46:11+00:00Added an answer on June 18, 2026 at 8:46 am

    You have a mistake. remove strlen on $length.

    function check_length($string, $min_length, $max_length) {
          $length = strlen($string);
    
         if($length < $min_length || $length > $max_length)
         { 
          header("Location: /kontakty/blad");
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to make a very simple YACC parser on Pascal language which just
I have to write my own hash function. If I wanted to just make
I use this simple script : <body> <script type=text/javascript> function mouseOver() { document.getElementById(img1).src =images/p2.jpg;
I am trying to make a simple script that will remove all unnecessary whitespace
I am trying to make a simple backup script for my remotely hosted git
I just want to ask a simple question, as I don't imagine how to
I'm very new in programming. The following task looks very simple but I don't
I am using this script to display MYSQL data, but I need to make
I'd like to make a subclass of NSInputStream. Simply, I tried to code just
I know I could just make all the Mix_Musics public, and not worry about

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.