Jump to content

Displaying Code on comand on/off


Jay2391

Recommended Posts

okay here is what I am thinking

 

I have some code anything that when runs displays "hello world!!!"

 

So I want to create a link of a button that displays and removes the item in the same screen

 

I know this is not correct and it dosen't have to be a button it can be a simple link

I am carrying an ID value that i must preserve on the Self.PHP post...

 

I know I am wrong but I am loooking for clues..

 

here are my toughts:

 

 

print '<h4><form action = "self.php" method="post">$on=TRUE<p>';

if($on== FALSE and $off == TRUE){  <---- Current stage when oppening page
code = TRUE:
if(code == TRUE){
  run code
}

}
print '<br><input type="submit" name="submit" size"20" value="on"/><br /></h4>';

then have another button that says the oposite

print '<h4><form action = "self.php" method="post">$on=false<p>';

if($on== TRUE and $off == FALSE){
  code = TRUE:
if(code == TRUE){
  run code
}

}
print '<br><input type="submit" name="submit" size"20" value="off"/><br /></h4>';

Link to comment
https://forums.phpfreaks.com/topic/36671-displaying-code-on-comand-onoff/
Share on other sites

that work FYI I figure it out... is there a better way let me know

 

		

   echo "<br><a href=\"tourney_admin.php?tourney_id=$tourney_id&switch=on\">Turn on </a>";

   echo "<br><a href=\"tourney_admin.php?tourney_id=$tourney_id&switch=off\">Turn on </a>";
				   echo "<br>$switch";
				   if($switch == on){	

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.