Jump to content

Recommended Posts

i got like 874 lines of code..

 

 

is there a way i can simplify these, since there are 4 duplicates with different changes inside if and else statements..

 

e.g.

if{

  if{

    code 1

    }

  else {

    code 2

    }

}

else{

  if{

    code 3

    }

    else {

    code 4

    }

 

}

 

 

 

do i use class or include?.. it will be way easier since i'm lost in brackets..

Link to comment
https://forums.phpfreaks.com/topic/175114-solved-help-with-simplifying/
Share on other sites

this is what i attempted but not working

 

<?php
$radiobutton = $_GET['radiobutton'];
if($radiobutton == 'on')
{
include("searchtopic.php");
}
else
{
include("searchnormal.php");
}

?>

 

i want if radiobutton is checked on the submit form then use searchtopic code otherwise use searchnormal code..

 

 

this was just an attempt i saved the code in different files.. if another way is easier i'm welcome to do that..

 

 

 

What does your form look like?

 

 <form action="test.php" method="get">
<center>
   <input name="search" type="text" value='' size="25" />
   <input type="submit" name="submit" value="search">

   <input name="radiobutton" type="radio" value="radiobutton">
</center>

</form>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.