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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:35:14+00:00 2026-05-20T09:35:14+00:00

if(isset($_GET[‘letters’])){ switch($_GET[‘letters’]){ case ‘a-e’: file_get_contents(‘text.php?text=a-e’); break; case ‘f-j’: file_get_contents(‘text.php?text=f-j’); break; case ‘k-o’: file_get_contents(‘text.php?text=k-o’); break;

  • 0
if(isset($_GET['letters'])){
                        switch($_GET['letters']){
                            case 'a-e':
                                file_get_contents('text.php?text=a-e');
                                break;

                            case 'f-j':
                                file_get_contents('text.php?text=f-j');
                                break;

                            case 'k-o':
                                file_get_contents('text.php?text=k-o');
                                break;

                            case 'p-t':
                                file_get_contents('text.php?text=p-t');
                                break;

                            case 'u-z':
                                file_get_contents('text.php?text=u-z');
                                break;

                            default:
                                file_get_contents('home.php');
                                break;
                        }
                    }

In this code i get this error:

Warning: file_get_contents(text.php?text=a-e) [function.file-get-contents]: failed to open stream: No error in *(the row of the file_get_contents())*

I also tried include. But it doesn’t work?

  • 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-20T09:35:15+00:00Added an answer on May 20, 2026 at 9:35 am

    You can’t pass parameters to a file on opening from your script. This can be done when sending an HTTP request for a page to the server, but not in this case.

    Also, beware that switch cases must be atomic. For example, if $_GET[‘letters’] was ‘b’, none of your switch cases would execute.

    I can’t tell from your post exactly what you’re trying to do. If you’re storing your text in flat files, use a better suffix, such as “.txt”. One approach would be to have multiple files, each corresponding to a category (e.g. ‘a-e’). You would set your file name in the switch statement.

    If on the other hand you’re trying to call code in your switch, file_get_contents is not the function to use. Use ‘require_once ‘my_file.php’ instead.

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

Sidebar

Related Questions

I am using this PHP code: if (isset($_GET['c'])) { $pages = array(home, upload, signup);
I have a script in PHP like this one: if(isset($_GET[ord])) { switch($_GET[ord]) { case
I have this code <?php session_start(); if (isset($_GET[cmd])) $cmd = $_GET[cmd]; else die(You should
<?php if(isset($_GET['action'])){ switch ($_GET['action']) { case 'login': include 'header.php'; if($_SERVER['REQUEST_METHOD'] == post){ if(!empty($_POST['password']) &&
So I have this code: <?php if (!isset($_GET['email']) && !isset($_GET['key'])) { echo 'NOT ALLOWED
I'm getting a syntax error on this PHP code: <snip> $last = (isset($_GET['last']) &&
<?php include 'db.php'; $mail=$_SESSION['session_u_e_mail']; if(!isset($_GET['edit'])) { $_GET['edit']=0; } switch($_GET['edit']) { case 1: echo Value;
This my code. /*******************************PHP CODE*****************************************/ if(isset($_GET['date'])){ // $date = $_GET['date']; $date = date('Y', strtotime($date));
This is my php code <?php if(isset($_GET['name'])) { $var = $_GET['name']; $newvar =str_replace (
When I ran this piece of code <?php include '../bin/config.php'; connect(); if (isset($_GET['id']) &&

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.