Jump to content

aytac

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aytac's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks , first one helped me ! echo '<center><form action="'.$strPage = $_POST['page'].'" method="POST"><select name="test">'; Thanks guys for helping me
  2. This is my code. 5th line is form action etc <?php echo '<table>'; echo '<tr><td colspan="3">'; /* Keuzelijst tonen */ echo '<center><form action="'.echo $strPage;.'" method="POST"><select name="test">'; echo '<option selected>Kies aantal rooster</option></center>'; echo '<option value="1">2 roosters</option>'; echo '<option value="2">4 roosters</option>'; echo '<option value="3">6 roosters</option>'; echo '<option value="4">8 roosters</option>'; echo '<option value="5">10 roosters</option>'; echo '<option value="6">12 roosters</option>'; echo '</select>'; echo '<input type="checkbox" name="zelfkeuze">Random aan'; echo '<button type="submit" name="knop" value="instok">OK</button>'; echo '</form></td></tr>'; echo '<table>'; echo $strPage; $strPage = $_GET['page']; $aantalrooster = $_POST['test']; $random = $_POST['zelfkeuze']; include ('klasse_lotto.php'); $objLotto = new klasse_lotto($aantalrooster, $random); $objLotto->tabel_tonen(); ?>
  3. Parse error: syntax error, unexpected T_ECHO in C:\xampp\htdocs\ictproject\lotto\index.php on line 5
  4. echo '<center><form action="'.echo $strPage.'" method="POST"><select name="test">'; echo '<option selected>Kies aantal rooster</option></center>'; echo '<option value="1">2 roosters</option>'; echo '<option value="2">4 roosters</option>'; echo '<option value="3">6 roosters</option>'; echo '<option value="4">8 roosters</option>'; echo '<option value="5">10 roosters</option>'; echo '<option value="6">12 roosters</option>'; echo '</select>'; echo '<input type="checkbox" name="zelfkeuze">Random aan'; echo '<button type="submit" name="knop" value="instok">OK</button>'; echo '</form></td></tr>'; Did you mean this ? But I've a problem with adding this to action. It does give me a syntax error ...
  5. Where do I need to add this ? <?php $page = $_GET['page']; ?> and 2nd thing : isn't that just printing it out on the website ? btw I ve uploaded my project , so you can have better look at it [attachment deleted by admin]
  6. yes but after i click on "OK" ?page=lotto disappear ...
  7. Hey , I've made a website with 2 menubuttons(lotto , euromillions). When I click on lotto -> I must choose a value of a dropdownlist and click on OK. Now when I click on "OK" after ive picked a value -> it says that the pagename is empty and gives an error. To fill the pagename I've added an ELSE function, but it does fix only 1 of the 2 forms which is not the point. Maybe I can fix this by using menuarray to make an IF-ELSE code for the 2 menu. Can someone give me an idea to solve this ? Index page -> to write the pagename which selects the included file. if (array_key_exists($_GET["page"], $arrMenuItems)){ $strPage = $_GET["page"]; }else{ //$strPage = "lotto"; //$strPage = "euromillions"; } MenuArray -> links to pages $arrMenuItems = array( "lotto" => array( 'menuitem'=>'lotto' , 'page_id' => '?page=lotto', 'page_name' =>'lotto', 'page_content'=> 'lotto/index.php', 'page_css'=>'lotto.css', ), "euromillions" => array( 'menuitem'=>'euromillions' , 'page_id' => '?page=euromillions', 'page_name' =>'euromillions', 'page_content'=> 'euromillions/index.php', 'page_css' => 'euromillions.css', ), );
  8. Hey all, I've a problem with including of my pages. When I do choose lotto on index.php , I do get the page and also can choose how many roster I want. But I can't see my lotto results, because it does refresh to the index.php again. How can I fix this problem ? this is the code of index.php: <?php echo '<table class="achtergrond" border="1">'; echo '<tr><td colspan="3">'; /* Keuzelijst tonen */ echo '<center><form action="'.$_SERVER['php_self'].'" method="POST"><select name="test">'; echo '<option selected>Kies een formulier</option></center>'; echo '<option value="1">Lotto</option>'; echo '<option value="2">Euromillions</option>'; echo '</select>'; echo '<button type="submit" name="knop">OK</button>'; echo '</form>'; echo '</td></tr>'; /* Als er op de knop gedrukt is , voer het lottoformulier uit*/ if(isset($_POST['knop'])) { echo '<tr><td>'; echo $waarde; /* variabel $waarde een waarde insteken via keuzelijst */ switch($_POST['test']) { case 1; include('formulieren/lotto.php'); case 2; include('formulieren/euromillions.php'); } echo '</td></tr>'; echo '</table>'; } ?> and this is the code of lotto.php: <?php echo '<table class="achtergrond">'; echo '<tr><td colspan="3">'; /* Keuzelijst tonen */ echo '<center><form action="'.$_SERVER['php_self'].'" method="POST"><select name="lotto">'; echo '<option selected>Kies aantal rooster</option></center>'; echo '<option value="1">2 roosters</option>'; echo '<option value="2">4 roosters</option>'; echo '<option value="3">6 roosters</option>'; echo '<option value="4">8 roosters</option>'; echo '<option value="5">10 roosters</option>'; echo '<option value="6">12 roosters</option>'; echo '</select>'; echo '<button type="submit" name="knop1">OK</button>'; echo '</form>'; echo '</td></tr>'; /* Als er op de knop gedrukt is , voer het lottoformulier uit*/ if(isset($_POST['knop1'])) { /* variabel $waarde een waarde insteken via keuzelijst */ switch($_POST['lotto']) { case 0; $waarde2 = 0; break; case 1; $waarde2 = 1; break; case 2; $waarde2 = 2; break; case 3; $waarde2 = 3; break; case 4; $waarde2 = 4; break; case 5; $waarde2 = 5; break; case 6; $waarde2 = 6; break; }...
×
×
  • 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.