file include not working PLZ help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hvolvo
Forum Newbie
Posts: 6
Joined: Thu Mar 27, 2008 2:01 am

file include not working PLZ help

Post by hvolvo »

i am creating a website and there is a page for uploading images...
i wrote a small piece of php code to upload the file to a specific predefined directory & a small form to provide the interface
i wrote both these in a single page:
*****************************************************************
<?php
.... code...
?>
<form name="newad" method="post" enctype="multipart/form-data" action="">
<table>
<tr><td><input type="file" name="image"></td></tr>
<tr><td><input name="Submit" type="submit" value="Upload image"></td></tr>
</table>
</form>
*****************************************************************
this worked perfectly fine.

then i kept the php code in a separate file to be included later as i require it in multiple pages.
I included it in one page where i needed it:
*******************************************************************
<html>
..
..
<?php
require_once("filename.php");
?>
<form name="newad" method="post" enctype="multipart/form-data" action="">
<table>
<tr><td><input type="file" name="image"></td></tr>
<tr><td><input name="Submit" type="submit" value="Upload image"></td></tr>
</table>
</form>
..
..
..
</html>
*******************************************************************
(this file is with the extenssion .php)
bt now i cant click on the submit button on this page! :cry:
plz help me :oops:

thanking in advance.
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: file include not working PLZ help

Post by it2051229 »

yeah.. as i can see there's nothing wrong with your HTML and how you did it.. what do you mean you can't click it? is it disabled or something?? or is there any error message popping out?? I want to check your "filename.php" and where you placed the file in your server
hvolvo
Forum Newbie
Posts: 6
Joined: Thu Mar 27, 2008 2:01 am

Re: file include not working PLZ help

Post by hvolvo »

it2051229 wrote:what do you mean you can't click it? is it disabled or something?? or is there any error message popping out??
i mean, when i move my cursor over it, it doesnot show any difference(hilighting)
as if its a part of the background.

ok... after messing up with it for a long time i just found some thing...
in the main page where i am using it i also had a link to a css file in which i had given 'position=absolute' for a division
to position a menu list at the top of the page just besides my submit button
***************main page**************************

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>X's Home Page</title>
<link rel="stylesheet" type="text/css" href="templates/css/divisions.css" />
</head>

<body>
<center>
<form>
<input name="Submit" type="submit" value="Upload image">
</form>
</center>

<div id="main_menu">
<ul>
<li><strong><a href="">Message Book</a></strong></li>
<li><strong><a href="">Add a Friend</a></strong></li>
<li><strong><a href="">My Photos</a></strong></li>
<li><strong><a href="">My Settings</a></strong></li>
<li><strong><a href="">My Profile</a></strong></li>
</ul>
</div>

</body>
</html>

************************************************

********* part of CSS file***************************
#main_menu {
top:0;
left:0;
width:100%;
position:absolute;
padding:0;
}
..
..
..
************************************************

without 'position=absolute' the menu was appearing bellow the button level,

now if i remove this 'position=absolute' i can click on the button which opens a window to select an image

but i want it positioned on the top

the attachment pics are screenshots of the main page with and without 'position=absolute'

why is this happening? :banghead:

WITH
1with.JPG
1with.JPG (23.45 KiB) Viewed 52 times
WITHOUT
2without.JPG
2without.JPG (24.42 KiB) Viewed 52 times
User avatar
it2051229
Forum Contributor
Posts: 312
Joined: Tue Dec 25, 2007 8:34 pm

Re: file include not working PLZ help

Post by it2051229 »

lol you have a lot to learn in CSS boy... to tell you the truth i stopped making CSS codes because I made this one project before and I really like the way it looks.. i mean by that time, i'm a newbie in CSS and was using Internet Explorer as my browser.. so i tried to see how it looks like in firefox then BAAAMM!!!! i was like "WTF??????@#(*@)(#*@)(#*)@(*#)(@#*)@(#" it looked like @(*#$U#(*$#($.... yeah i mean, all those damn wasted time trying to make the website good was totally messed up in firefox... by that time i hated CSS.. i concentrated more on PHP.. so whenever i make websites, i download static design templates made by professionals and I just give life to the page in PHP... IN SHORT, I CANNOT ANSWER YOUUuuuu!!!! lol
Post Reply