Jump to content

creating a button within php


tipu

Recommended Posts

i bought a book on php mysql and i sort of digressed from the book, which is why i need help. the book told me how to create drop down menus within php, not html, and i was able to successfull do that. i used for loops instead of foreach, for my first comp. language is C++. anyways, i was able to create 3 drop down menus, 1 for the day, month, and year. how do i set up a button in the php that will redirect the information so that i can use it in other .php forms? I know how to do this using text/radio/check boxes using HTML forms, but not php. any help will be appreciated, thanks.

 

		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Untitled Document</title>
	</head>
	<?php
	$months = array (0=>'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'Novembver', 'December');	
	$days = range(1, 31);
	$years = range(2005,2015);

	echo '<select name = "month">';
	for ($i = 0; $i < 12; $i++)
	{
	echo "<option>$months[$i]</option>";
	}
	echo '</select>';


	echo "      ";


	echo '<select name = "days">';
	for ($i = 0; $i < 31; $i++)
	{
	echo "<option>$days[$i]</option>";
	}
	echo '</select>';


	echo "    ";


	echo '<select name = "year">';
	for ($i = 0; $i < 11; $i++)
	{
	echo "<option>$years[$i]</option>";
	}
	echo '</select>';

	echo "<button>HELLOFATTO</button>";


	?>

	<body>
	</body>
	</html>

Link to comment
https://forums.phpfreaks.com/topic/45231-creating-a-button-within-php/
Share on other sites

<form name=""frm" action="next_page_to_redirect.php" method="post">

<select name=day> ....  </select>

<select name=month> ....  </select>

<select name=year> ....  </select>

<input type="Submit" name="Submit" value="press button">

( echo "<input type=\"Submit\" name=\"Submit\" value=\"press button\">"; )

</form>

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.