I need helping fetching the URLs I have stored in my database and opening a new page.
I am using a dynamic drop down menu for users to select a category and company. Once a user selects category(parent table) the child table opens up. The user then can click the submit button to open that page.
This is my child table
CREATE TABLE `companies` (
`comp_id` int(10) unsigned NOT NULL auto_increment,
`comp_name` text NOT NULL,
`comp_cat_id` mediumint(8) unsigned NOT NULL,
`comp_url` varchar(512) NOT NULL,
PRIMARY KEY (`comp_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=128;
My form code is
<form id="form1" name="form1" method="post" action="">
<select size=1 name="Parent" id="Parent" onchange="WA_FilterAndPopulateSubList(Child_WAJA,MM_findObj('Parent'),MM_findObj('Child'),0,0,false,': ')">
<option value="">Please Select Below</option>
<?php
do {
?>
<option value="<?php echo $row_Parent['cat_id']?>"><?php echo $row_Parent['cat_name']?></option>
<?php
} while ($row_Parent = mysql_fetch_assoc($Parent));
$rows = mysql_num_rows($Parent);
if($rows > 0) {
mysql_data_seek($Parent, 0);
$row_Parent = mysql_fetch_assoc($Parent);
}
?>
</select>
</form>
<p> </p>
</div>
<div class="stepone">
<h3> Step Two:</h3>
<p> Choose a Company <strong><em>(Optional) </em></strong></p>
<form id="form2" name="form2" method="post" action="">
<select size=1 name="Child" id="Child">
<option>Please Select a Company</option>
</select>
<input type="image" src="images/global images/gobutton.png" name="go" id="go" value="Submit" />
</form>
<p> </p>
</div>
I cant figure out what PHP code I need to put in the action to call my 'comp_url' row and open a new page.
I have come up with
action="<?php echo <a href={'$row_Child['comp_url']}'/a>?>">
But it doesn't work
Please let me know if you need more information.
I am new to all this.
Thanks again!!