Jump to content

New Coder

Members
  • Posts

    146
  • Joined

  • Last visited

    Never

Everything posted by New Coder

  1. This is what happens. <html> <head></head> <body> <?php Blah Blah php stuff ?> <!-- Large Comment --> </body> </html> works fine, but... <html> <head></head> <body> <?php Blah Blah ?> <!-- Large Comment --> <?php php stuff ?> <!-- Large Comment --> </body> </html> The page displays but links etc stop working. Wierd. Cheers
  2. I might be wrong but remove these lines: <div class="left-btm"><img src="images/left-bottom.gif" width="282" height="26" border="0" /></div> <div class="right-btm"><img src="images/right-bottom.gif" width="517" height="50" border="0" /></div> You are calling the image in the stylesheet aswell. In your classes left and right Hope this helps
  3. Hello all, I hope someone can help. I want to comment out a large amount of HTML code. I am using the <!-- --> syntax but for some reason if I exceed 1080 characters the page no longer functions properly. Is there another method other than <!-- --> that will allow me to comment a large amount of code? Many Thanks
  4. Have you tried? $description = $row['description']; What does strip slashes do? If you just want to clean the string up use $description = rtrim($row['description']); Hope this helps, but could be a mile off lol
  5. Aah yes passing through the url you are probably restricted to 255 charaters I would look into cookies or breaking $msg down into smaller variables and then either still use cookies or post method to the next page Hope this helps
  6. I would say its working on the pass but $msg is blank. test it by creating a variable on the first page eg $test = "hello"; Then header( "Location: $thankyouurl?test=$test" ); exit ; and finally on the thankyou page <? $test= $_GET['test']; echo ($test); ?>
  7. yes but you will need to then echo it <? $msg = $_GET['msg']; echo ($msg); ?> would be a way to check if you have passed it
  8. I might be wrong put I'm sure you could pass the $msg variable through the url. This is fine as long as it isn't sensitive data. header( "Location: $thankyouurl?msg=$msg" ); exit ; And then use : $msg = $_GET['msg']; on the thank you page. hope this Helps
  9. I have figured it out and both are now working a treat. <SCRIPT language="JavaScript"><!-- //script hider function form_validator(theForm) { if(theForm.department.value == "") { alert("You must choose a Department."); theForm.department.focus(); return(false); } return (true); } // end script hiding --></SCRIPT> I just had to remove the value of department. At a guess, is it because I'm using a query to populate the options and "Choose department" is not brought through from the query but is hard coded? Beacause I found that if I put "Choose department" in the table it regonised it as a selection. Anyway Thanks Yesideez and TRI0N
  10. Working a treat... Thanks They can still select Choose department as an option but if they choose another, when the page is re-visited it will show their previous selection. Javascript isn't a strong area of mine either. I'm going to play around with this little bit of javascript to see if I can get it to work but essentially it's close to the desired result. Thanks
  11. Thats ok, I think this may do what I want. From what I can see this is attempting to dispaly the users previous selection within the drop down box. Therefore should i be declaring what value $department will hold first? Many thanks
  12. Cheers, will try new code. Should I use instead of script or aswell as? If still using script, I have some questions. function form_validator(theForm) Where it says (theForm) should I put my form name in there? and than at all other instances? I have tried both, and I can't get either to work?
  13. Great Cheers, Is there a way of allowing the drop down box always available but to display the option thay have previously chosen? Many Thanks
  14. Even if somebody can't help me with the code, does anybody know if it's possible?
  15. Hello all, No doubt this type of question turns up now and then, but I have searched this site and Google but haven’t got a solution to my problem. I have a page where a user selects the department they belong to. I have a few different questions. Currently, once they have selected a department they do not get the choice again, but if they click save without selecting an option from the drop down it stores their department as “Choose Department”, which clearly isn’t a department and cannot be changed. Can I get it so if they leave the option as Choose department it won’t save and they have to pick a selection? Or is there a way so that the drop down box is always available but will display the option they have selected in the past when they re-visit? The latter is better because it will allow users to change it, if for instance they move departments. here's what i've got so far:- <form action="edit_details.php" method="post"> <?php if ($department != null) { echo ( $department); } else { $sql2="SELECT distinct department FROM dept_codes order by department"; $rs2 = mssql_query( $sql2, $conn ) ; echo ("<select name=\"department\">"); echo "<option selected>Choose Department</option>"; while($row2 = mssql_fetch_array($rs2)) { echo ("<option value=\"$row2[0]\">$row2[0]</option><br/>\r\n"); } echo ("</select>");} ?> <input type="submit" value="Save"></form> Many Thanks
  16. Ok thanks, I will give the no-cache headers a try and will let you know how I get on. Many Thanks
  17. Hello all, Is there a way that I can get a page to refresh it's information if navigated to from another page using the refresh button. For instance: A user is viewing page 1, they navigate to page 2, they return to page 1 by preesing the back button. Can page 1 then refresh itself just incase the details have changed since last viewing? Many thanks
  18. Try $query_Sched1 = "SELECT * FROM schedule WHERE sem = \"%s\" AND comment1 LIKE \"starts 03%\" ORDER BY dept, number, section, ASC"; Hope this helps Not sure what you are trying to do with this part though:- , $colname_Sched); Cheers
  19. $sql="SELECT `clan_name`,`wins`,`losses`,`message`,`clan_id`,`link` FROM `bhdsingle` ORDER BY `wins` DESC"; $res=mysql_query($sql) or die(mysqll_error()); while ($row = mysql_fetch_array($res)) { $list = "<table>"; $list .= "<tr>"; $list .= "<th>Clan Name</th>"; $list .= "<td>".$row["clan_name"]."</td>"; $list .= "<tr>"; $list .= "</table>"; echo( $list ); } Add more columns etc to suit when you know how you want table displayed
  20. Hello all, I was wondering if anybody could help me. I'm trying to see if a variable that is created from a DB value can be checked for a specific value, and then carry out an if statement depending on the result. Heres what I have tried. <?php $num = mssql_num_rows ($rs); if ($num !=0) { $row = mssql_fetch_array( $rs ); $list = "<table border=\"0\" cellpadding=\"4\" width=\"98%\">"; $list .= "<tr>"; $list .= "<th>Name</th>"; $list .= "<td>".$row["name"]."</td>"; $list .= "<th></th>"; $staffcode = $row["staffcode"]; $list .= "</table>"; echo( $list . "<br>" ); } else { header("Location:no_details.php"); exit();} mssql_close ( $conn ); if ( $staffcode != "Standard User" ) { echo ( " <form action=\"edit_details.php\" method=\"post\"> <table border=\"0\" cellpadding=\"4\" width=\"98%\"> <tr> <th width=\"75%\">Staff Code</th> <td><input type=\"text\" value=\"$staffcode\" name=\"staffcode\"></td> </tr> </table> <input type=\"submit\" value=\"Save\"></form> " ); } else { echo ( " <table border=\"0\" cellpadding=\"4\" width=\"98%\"> <tr> <th width=\"75%\">Staff Code</th> <td>$staffcode</td> </tr> </table> " ); } ?> But it's just ignoring the if statement and carrying out the first part of the If regardless. Can I do it this way? What am I doing wrong? Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.