alignment issue
Posted: Sat Dec 06, 2008 7:50 am
When posting PHP code in this forum, please enclose it in [ php] .. tags, as I have done below for you. Thank you.
Hi,
I am using the following embedded code for 5 navigation buttons namely a,b,c,d & e but if you see the screen shot, the navigation buttons are not getting aligned horizontally & proportionately while the codes suggest just that.
Am i missing something here?
thanx,
phpquery
Hi,
I am using the following embedded code for 5 navigation buttons namely a,b,c,d & e but if you see the screen shot, the navigation buttons are not getting aligned horizontally & proportionately while the codes suggest just that.
Am i missing something here?
thanx,
phpquery
Code: Select all
<?php
if(isset($_POST['create']))
{
$value=$_POST['value'];
$style=$_POST['style'];
//echo $value;
$filetype=$_POST['filetype'];
$sitename=$_POST['sitename'];
if($sitename==''| $value=='')
{
header("location: home.php?ref=1");
}
else
{
mkdir('D:\work\apache2triad\htdocs\\'.$sitename,0777);
$sitepath='D:\work\apache2triad\htdocs\\'.$sitename;
}
////////////////////////////////////////
$i=1;
while($i<=$value)
{
$file[$i]=$_POST['filename'.$i];
$key[$i]=$_POST['keyword'.$i];
/*echo $file[$i];
echo $key[$i];
echo $i;*/
$i++;
}
////////////////////////////////////////////
$i=1;
while($i<=$value)
{
if($file[$i]!='' && $key[$i]!='')
{
$ourFileName[$i] = $sitepath.'/'.$file[$i].'_'.$key[$i].'.'.$filetype;
$ourFileHandle = fopen($ourFileName[$i], 'w') or die("can't open file");
fclose($ourFileHandle);
$filename[$i]=$file[$i].'_'.$key[$i].'.'.$filetype;
//echo $filename[$i];
}
else
{
if($file[$i]!='')
{
$ourFileName[$i] = $sitepath.'/'.$file[$i].'.'.$filetype;
$ourFileHandle = fopen($ourFileName[$i], 'w') or die("can't open file");
fclose($ourFileHandle);
$filename[$i]=$file[$i].'.'.$filetype;
}
}
$i++;
}
////////////////////////////////////////////
if($style=='horizontal')
{
$l=800/$value;
$start='<!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=utf-8 />
<title>Untitled Document</title>
</head>
<body>
<table width=800 height=800 border=1 align=center bgcolor=#CC99FF>
<tr height=90 width=800>
<td height=90 valign=top>
<img src=winter.jpg height=90 width=100%>
</td>
</tr>
<tr hieght=25>';
$end='</tr>
<tr height=600>
<td height=600 valign=top>
<img src=winter.jpg height='.$l.' width='.$l.'><br>
<img src=winter.jpg height='.$l.' width='.$l.'><br>
<img src=winter.jpg height='.$l.' width='.$l.'><br>
<img src=winter.jpg height='.$l.' width='.$l.'>
</td>
</tr>
<tr height=90>
<td valign=bottom>
<img src=winter.jpg height=90 width=100%>
</td>
</tr>
</table>
</body>
</html>';
$i=$value;
while($i>0)
{
$content='<td width='.$l.' align=center border=1><a href=http://localhost/'.$sitename.'/'.$filename[$i].'>'.$file[$i].'</a></td>'.$content;
//$content1='<td width=400>aaaaa</td>'.$content;
$i--;
}
$cont=$start.$content.$end;
//echo $content;
}
if($style=='vertical')
{
echo 'vertical';
}
////////////////////////////////////////
$i=1;
while($i<=$value)
{
//$ourFileName1 = $sitepath.'/'.$file[$i].'_'.$key[$i].'.'.$filetype;
$ourFileHandle = fopen($ourFileName[$i], 'w') or die("can't open file");
fwrite($ourFileHandle,$cont);
fclose($ourFileHandle);
$i++;
}
}
if($_GET['ref']==1)
{
?>
<script type="text/javascript">
alert('* field should not be left blank');
</script>
<?php
}
?>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="home.php">
<table width="646" border="1" align="center">
<tr>
<td width="122">Enter No Of links</td>
<td colspan="2">
<input type="text" name="value" id="value" />
*
<input type="submit" name="enter" id="enter" value="enter" />
</td>
</tr>
<?php
if(isset($_POST['enter']))
{
$a=$_POST['value'];
$i=1;
while($i<=$a)
{
?>
<tr>
<td>enter name of files</td>
<td width="167">
<input type="text" name="filename<? echo $i;?>" id="filename" />
*
</td>
<td width="293">keyword
<input type="text" name="keyword<? echo $i;?>" id="keyword" /></td>
</tr>
<?php
$i++;
}
?>
<input name="value" type="hidden" value="<? echo $a; ?>" />
<tr>
<td>filetype
<select name="filetype" id="filetype">
<option>html</option>
<option>php</option>
</select></td>
<td>style
<select name="style" id="style">
<option selected="selected">horizontal</option>
<option>vertical</option>
</select></td>
<td>site name
<input type="text" name="sitename" id="sitename" />
*</td>
</tr>
<tr>
<td colspan="3" align="right">
<input type="reset" name="reset" id="reset" value="reset" />
<input type="submit" name="create" id="create" value="create" />
</td>
</tr>
<?php
}
?>
</table>
</form>
</body>
</html>