-
Posts
2,527 -
Joined
-
Last visited
Everything posted by DeanWhitehouse
-
Is there a way to pull HTML code from a HTML file?
-
unless you use ob_start();
-
can you show all the code, or is that it?
-
404 means page missing, therefore the link is wrong.
-
try adding error_reporting(E_ALL); to the top of the page
-
and what if js is disabled??
-
Ok, thanks. I made it work by having it open a small window when it changes, but this is not the best way to go.
-
wow, most of the replys are darkwater and js having a discussion. I would say that he should use sessions, and then have another page with visible profiles on and use get, but that is my preference.
-
Need help with ""Warning: Cannot modify header information ""
DeanWhitehouse replied to TheFreak's topic in PHP Coding Help
Please read this before posting header errors http://www.phpfreaks.com/forums/index.php/topic,37442.0.html It is in big letters at the top of the forum , so you couldn't of missed it. -
Ok, this is the whole code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="alternate stylesheet" media="screen" href="classic.css"> <link rel="alternate stylesheet" media="screen" href="original.css"> <link rel="alternate stylesheet" media="screen" href="dark.css"> <link rel="alternate stylesheet" media="screen" href="light.css"> <link rel="alternate stylesheet" media="screen" href="modern.css"> <script type="text/javascript"> <!-- function preview() { var browser=navigator.appName; if(browser =="Microsoft Internet Explorer") { } else { var theme =document.reg.theme.value; document.getElementById("style").href = theme; } } --> </script> <link rel="stylesheet" id="style" media="screen" href="original.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Pragma" content="no-cache"> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <meta http-equiv="expires" content="0"> <title>Mail App - Registration</title> </head> <body> <div id="main"> <h1 align="center">Registration</h1> <p id="title">Register Here With Your Email address, then you can send emails to multiple addresses from this site.</p> <form id="reg" name="reg" action="" method="post"> Name:<input id="name" type="text" name="name" size="40"><br> Username:<input id="uname" type="text" name="username" size="40"><br> Password: <input id="pword" type="password" name="password" size="40"><br> Confirm<br> Password: <input id="cpword" type="password" name="confirmp" size="40"><br> Email: <input id="email" type="text" name="email" size="40"><br> Confirm Email: <input id="cemail" type="text" name="confirme" size="40"><br> Theme: <select id="theme" name="theme" onChange="preview()"> <option value="original.css">Original</option> <option value="classic.css">Classic</option> <option value="dark.css">Dark</option> <option value="light.css">Light</option> <option value="modern.css">Modern</option> </select><br> <p id="tc">To register you need to agree to our <a href="javascript:void(0)" onClick="tc()">terms and conditions</a>:<input id="tc" type="checkbox" name="agree" size="40"></p><br> <input id="sub" type="submit" value="Submit" name="reg"> </form> </div> </body> </html> I added the browser detection, just to disable it looking wrong in IE.
-
Sorry the code posted are just snippets, the js is in the script tag's and there is a form that calls the function on change. It works fine in safari and ff , the theme changes instantly, but in IE it only changes a part of the page, this part has div tags around it, until i open a new tab then the rest of the page is changed.
-
Have you tried running the php code on it's own to see if it works, as this isn't a php problem so it should be moved to the js forum.
-
then thats a js problem, not php
-
can u post the current code with changes you made.
-
Is mod_desc definetly a row? try adding error_reporting(E_ALL); to the top of the script
-
also remove the @ from session_start(); as this stops errors appearing( i think, correct me if i'm wrong) <?php session_start();
-
PHP, Javascript and iframes.....ARGHHHH
DeanWhitehouse replied to aussiexile's topic in PHP Coding Help
read up on a xmlHTTPrequest (i think). -
Try this, and see if there is an error in your statement <?php require "config.php"; $type = $_REQUEST['model']; $select = 'SELECT mod_desc'; $from = ' FROM module'; $where = ' WHERE type = \'' .$type' . '''; $queryResult = mysql_query($select . $from . $where) or die("Error!".mysql_error()); while ($row = mysql_fetch_array($queryResult)) { echo $row['mod_desc']; } mysql_close($conn); ?>
-
I have made a JS function to change the style sheet of my page. <link rel="alternate stylesheet" media="screen" href="classic.css"> <link rel="alternate stylesheet" media="screen" href="original.css"> <link rel="alternate stylesheet" media="screen" href="dark.css"> <link rel="alternate stylesheet" media="screen" href="light.css"> <link rel="alternate stylesheet" media="screen" href="modern.css"> <!-- function preview() { var theme =document.reg.theme.value; document.getElementById("style").href = theme; } --> <link rel="stylesheet" id="style" media="screen" href="original.css"> But in internet explorer it only changes part of the page until i either open a new window or tab. Is this to do with my js code
-
I have made this function to laod a different style sheet when they change a drop down box. <script type="text/javascript"> function preview() { var theme =document.reg.theme.value; document.getElementById("style").href = theme; } </script> <html> <body> <select id="theme" name="theme" onChange="preview()"> <option value="original.css">Original</option> <option value="classic.css">Classic</option> <option value="dark.css">Dark</option> <option value="light.css">Light</option> <option value="modern.css">Modern</option> </select> </body> </html> My problem is that there is a lsight delay before it loads the next style sheet. Is there any way to preload the style sheets?
-
read what i posted please before commenting. I am asking for help with setting the while loop for the variables.
-
anyone?
-
bump