Jump to content

[SOLVED] Calling a script from within a script


slashchuck

Recommended Posts

Why does this not work?

<?php

.........

switch($testid){

      case '1':

          Gen1.php;

          break;

      case '2':

          Gen2.php;

          break;

      case '3':

          Gen3.php;

          break;

      }

.........

?>

i think you mustinclude()

<?php
.........
switch($testid){
       case '1':
           include(Gen1.php);
           break;
       case '2':
           include(Gen2.php);
           break;
       case '3':
           include(Gen3.php);
           break;
      }
.........
?>

Due to not reading the manual, www.php.net/include

 

<?php
.........
switch($testid){
       case '1':
           include('Gen1.php');
           break;
       case '2':
           include('Gen2.php');
           break;
       case '3':
           include('Gen3.php');
           break;
      }
.........
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.