LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-20-2005, 08:30 PM   #1
Runnerdave
LQ Newbie
 
Registered: Jul 2005
Location: Australia
Posts: 13

Rep: Reputation: 0
Unhappy Problem loading css in php


Hi, I am having a strange problem sometimes when submitting a form, what happens is that my page after submission does not get the css styles and looks awful, but of course if I refresh it gets the css and is rendered properly.

I suppose it has to do with the speed at which apache renders the page an probably it can't load the css fast enough.

Any ideas?

thanks a lot
 
Old 07-21-2005, 02:30 AM   #2
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
Apache probably has nothing to do with this.

The answer probably lies within the script. Can you post the relevant section of your HTML/PHP file so that we can see if there is a problem?

Maybe the place where you include the CSS is wrapped around a PHP conditional which might get bypassed when you post the form.
 
Old 07-21-2005, 09:21 PM   #3
Runnerdave
LQ Newbie
 
Registered: Jul 2005
Location: Australia
Posts: 13

Original Poster
Rep: Reputation: 0
I ommitted a lot of crap, but this maybe the relevant part:

Code:
<?
if($save_x > 0 || $saveCreate_x > 0)	
	{
		$message = " "; //used to give feedback on the action performed to the user
		$id = $id+0;
		/webapps/footers/array_footer_writer.php?id=0","r"));
			//end of updating array footer file

.
.
.
.lots of saving to databases and writing text files :o
.
.
			
			$message = "[Rows affected (setting this record): ".$rows_affected_1."]";
			if($save_x > 0)
			{
				//echo $message;
				header("Location: /admin/publisher/admin_websites.php"); /* Redirect  browser */
			}
}
	?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Admin Websites (Menu System)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
	@import "/import/import.css";
</style>
<body>


<form action="admin_websites.php" method="post" name="edit_form" onsubmit="return validate()">
<?
								if($delete=="1"){
									echo	"<td><input type=\"image\" src=\"/images/button_delete.gif\" alt=\"delete\" name=\"delete\" width=\"54\" height=\"17\">&nbsp;&nbsp;&nbsp;<a href=\"/admin/publisher/admin_websites.php\"><img src=\"/images/button_cancel.gif\" alt=\"cancel\" widht=\"56\" height=\"17\"  border=\"0\"></a></td>";
								}
								else{
									echo	"<td><input type=\"image\" src=\"/images/button_save.gif\" alt=\"save\" name=\"save\" width=\"49\" height=\"17\">&nbsp;&nbsp;&nbsp;";
									echo	"<input type=\"image\" src=\"/images/button_saveandcreate.gif\" alt=\"save & create\" name=\"saveCreate\" width=\"109\" height=\"17\">&nbsp;&nbsp;&nbsp;";
									echo	"<a href=\"/admin/publisher/admin_websites.php\"><img src=\"/images/button_cancel.gif\" alt=\"cancel\" widht=\"56\" height=\"17\"  border=\"0\"></a></td>";
								}
								?>

</form>
 
Old 07-21-2005, 10:09 PM   #4
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
Hmm... I cannot see a problem there. I noticed you use a <style> tag. Did you try using the <link rel="stylesheet" href="import/import.css" type="text/css"> tag instead of the <style> tag?

Also make sure you don't output anything to the browser in the PHP block before the start of the HTML code.

Last edited by vharishankar; 07-21-2005 at 10:11 PM.
 
Old 07-26-2005, 02:48 AM   #5
Runnerdave
LQ Newbie
 
Registered: Jul 2005
Location: Australia
Posts: 13

Original Poster
Rep: Reputation: 0
thanks for the interest but I tried the <link rel="stylesheet" href="import/import.css" type="text/css"> tag without success.

It would be good if any other guy here could give some ideas
 
Old 07-26-2005, 06:04 AM   #6
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
Did you try checking the outputted HTML code underneath? Maybe you could post some sections of the resulting page so that we could try tracking the problem from that end.
 
Old 07-26-2005, 09:27 PM   #7
Runnerdave
LQ Newbie
 
Registered: Jul 2005
Location: Australia
Posts: 13

Original Poster
Rep: Reputation: 0
well here it goes:

(the source code has that space between the top and the first line <!DOCT)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head><style type="text/css">
	@import "/import/import.css";
</style>
<script src="/import/javascript_functions.js" type="text/JavaScript"></script>
<script type="text/javascript">
window.onload = function(e) {
	function_preloadImages('/images/nav_top_home_over.gif','/images/nav_top_about_over.gif','/images/nav_top_campuses_over.gif','/images/nav_top_faculties_over.gif','/images/nav_top_my_over.gif','/images/nav_top_search_over.gif','/images/nav_top_index_over.gif','/images/nav_top_courses_over.gif')

 	//variable firstTime is declared and set in the above included file javascript_functions.js and it is 
	// intended to avoid resizing of fonts for first time visitors (david)
	if(!firstTime)
	{
		ts('body',1);
	}
} 
</script>

<title>Admin Website's Menus (Menu System)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
<!--
function validate()
{
if ((document.edit_form.name.value==""))
{
alert ("You must enter a name for your menu!")
return false
}
}
//-->
</script>
</head>

<body><!--Start:
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in linking css file in xml geethu Programming 0 09-10-2005 06:51 AM
CSS: Can you spot the problem? flamesrock Programming 2 07-28-2005 03:41 PM
CSS - problem with margins in cells J_K9 Programming 2 06-30-2005 12:10 PM
Cedega 4.3 CSS problem w/ Nvida FX 5600 Ultra kizuna Slackware 4 04-15-2005 06:15 PM
Survey: fav program for PHP/HTML/CSS coding xervious Linux - Software 8 03-16-2005 11:04 AM


All times are GMT -5. The time now is 11:46 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration