Jump to content

ashrobbins87

Members
  • Posts

    70
  • Joined

  • Last visited

    Never

Everything posted by ashrobbins87

  1. Hi all, I'm having a massive pain trying to get z-indexes to work on my blog. http://www.ashrobbins.com Basically I want the black div with the date in it on the left (.date_and_tags2) to display underneath the main white content area (#Wrap). Can anybody see if there is a glaring issue here? I know that to use z-index, elements need to be positioned, and as far as I can tell they are. Any help appreciated. Thanks
  2. I dont have a live page as its all been developed on Apache on my laptop. I can post the code for a page using the css if that helps? Its pretty big though....
  3. Dammit I tried posting the whole file not just the comment..... /* CSS Document Author: Ashley Robbins Date last modified: 08/05/09 Page Description: This is the css file for the front end of the website */ /*setting link colours*/ a:link {text-decoration: none; color:#FF6600} a:visited {text-decoration: none; color:#FF6600} a:hover {text-decoration: underline; color: #FF6600;} a:active {text-decoration:none; color:#FF6600} a.speciallink {text-decoration: none; color:#FF6600} a:link.toolbar {text-decoration: none; color: white} a:visited.toolbar {text-decoration: none; color: white} a:active.toolbar {text-decoration:none; color: white} a.speciallink.toolbar {text-decoration: none; color: white} a:link.calendar {text-decoration:none; color:black} a:visited.celendar {text-decoration:none; color:black} a:active.calendar {text-decoration:none; color:black} a.speciallink.calendar {text-decoration:none; color:black} /*button background colour */ over.btnav { background-color: white;} /*setting size and colours of headings */ h1{ font-size:30px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} h2{ font-size:18px; color:#000000; font-family:Arial, Helvetica, sans-serif} h3{ font-size:14px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} h4{ font-size:20px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} h5{ font-size:14px; color:#000000; font-family:Arial, Helvetica, sans-serif} h6{ font-size:16px; color:#FF6600; font-family:Arial, Helvetica, sans-serif} /*setting font for body text */ body{font-family:Arial, Helvetica, sans-serif} /*image border colour */ img.small {border-color:#FF6600;} /*setting background image for totaliser */ img.totaliser{background-image:url(totaliser.php);} img.totaliservertical{background-image:url(totalisertest.php);} /*div to hold page contents centralised */ div.test { width : 1000px; margin-left: auto; margin-right: auto; margin:0px; margin:auto; position:relative; } /*div for calendar on events page */ div.events { height:500px; width:650px; margin:0px; margin:auto; position:absolute; left:12px; align:left; top: 82px; } /*div for small stories in archive */ div.archive { width:500px; margin:0px; margin:auto; left:0px; align:left; position:absolute; } /*div for links on parents page */ div.parentslinks{ width:500px; margin:0px; margin:auto; left:0px; align:left; } /*div to display staff details centrally on page */ div.staff { height:700px; width:600px; margin:0px; margin:auto; } /*div to display facilities centrally */ div.facilities { width:800px; margin:0px; margin:auto; } /*div to show latest events on right of page */ div.latestevents { height:350px; width:330px; margin:1px; margin:auto; border-color:#FF6600; border-left-style:solid; border-left-width:thin; position:absolute; right:0px; margin-top:40px; align:right; padding-left:10px; } /*div for body text on home page */ div.forhometext{ height: 250px; width:500px; margin:auto: } /*div for recent donations on fundraising news page */ div.fordonations{ height: 400px; width:230px; border-color:#FF6600; border-left-width:thin; border-left-color:; border-left-style:solid; padding-left:10px; } /*formatting background and colour of submit form buttons */ input.submit { font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FF6600; background-color:#FFFFFF; margin-left:0px; border-width:0; cursor:pointer; } td.parentslinks{ padding-left:20px; } #wrapper {margin:0; margin:auto; width : 1000px;} /*setting up elements for rounded bordered divs */ .bl{background: url(Static_Images/bl.gif) 0 100% no-repeat; width: 15em;} .br {background: url(Static_Images/br.gif) 100% 100% no-repeat} .tl {background: url(Static_Images/tl.gif) 0 0 no-repeat} .tr {background: url(Static_Images/tr.gif) 100% 0 no-repeat; padding:10px} .t {background: url(Static_Images/dot.gif) 0 0 repeat-x; width: 15em} .b {background: url(Static_Images/dot.gif) 0 100% repeat-x} .l {background: url(Static_Images/dot.gif) 0 0 repeat-y} .r {background: url(Static_Images/dot.gif) 100% 0 repeat-y}
  4. I have just finished commenting about 80 pages worth of code for my uni project, and now all of my divs are not aligning the way they should be according to the CSS. The css states that the main page content should be in a div called div.test which was all displaying fine and centrally before I commented, now it is going to the left of the page. I cant see anything wrong with the comments or any comments that are unclosed. Could someone please take a look and see if a fresh pair of eys can help me out?? <!-- Author: Ashley Robbins Date last modified: 08/05/09 Page Description: -->
  5. Thanks guys for the help, I've sorted it now and you're right I had to use byElementID and onKeyUp
  6. Ok great at least I now know its possible. I take it this can be done without the need to refresh the page? Can anyone point me in the direction of where to start??
  7. Is it possible to dynamically populate a text field, based on the content of other text fields on the same page? For example I have a firstname field and a surname field, and I want to populate a username field with the first letter of the firstname and the first 7 letters of the surname so that the user can see it. firstname: ashley surname: robbins username: arobbins Can this be done??
  8. Mate you're a genius that works perfectly!! Didnt even have to tweak it at all! Thank you
  9. I have a feature on my site which displays images for events in a gallery. Users can upload images to a directory on the server and the path to the file is saved in the DB. This path is then used to call the images to the gallery. At the moment though I can only get the images to display in a long list, and I would like to put them in table perhaps 2 or 3 columns wide. I dont know how to alter my loop so that it puts the first two images in one table row, then the next two in another row etc etc. As you can see I have already had a go, but it displays the same image twice in a row, then the next image twice in the next row. Any help please? Code is below.... <?php //Display images for this event $mysqli = mysqli_connect("localhost", "root", "Cadbury5", "opp_group"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { $eventImages_sql = "SELECT path FROM event_galleries WHERE event_title='".$event_title."' ORDER BY path DESC"; $eventImages_res = mysqli_query($mysqli, $eventImages_sql) or die (mysqli_error($mysqli)); if ($eventImages_res) { while ($newArray = mysqli_fetch_array($eventImages_res, MYSQLI_ASSOC)) { echo "<table align=\"center\"><tr>"; for ($x=1; $x<=2; $x++) { $path = $newArray["path"]; echo "<td><a href=\"cms/".$path."\" target=\"_blank\"><img src=\"cms/".$path."\" width=\"150\" height=\"100\"></a><br/>"; } echo "</tr></table>"; } } else { printf("Could not retreive records: %s\n", mysqli_error($mysqli)); } mysqli_free_result($eventImages_res); mysqli_close($mysqli); } ?>
  10. Anyone have any ideas? I cant work out how to give $new_f a value. I'm trying to use the $_POST[firstname'] value, which should be whatever is inside the textfield right?
  11. Ah yeah sorry that was just a typo when typing onto the forum. The code for that page is much bigger but none of it relates to the php. Thanks though!
  12. I am currently building the user management section of my site, and I am at the editing users stage. I have a popup which takes the id of a user from MySQL database and populates textfields with their info. I then want the user to be able to alter these textfields and send the new values to the database. Sounds simple enough but.... I can get the popup to pass the id number, but not the altered text from the txt fields. The script sending the data is below... <?php if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { $id = $_GET["i"]; $mysqli = mysqli_connect("localhost","root","Cadbury5","opp_group"); $getDetails_sql = "SELECT * FROM cms_users where id='".$id."'"; $getDetails_res = mysqli_query($mysqli, $getDetails_sql)or die(mysqli_error()); if ($getDetails_res) { $row = mysqli_fetch_assoc($getDetails_res); $f = $row['firstname']; $s = $row['surname']; $u = $row['username']; $p = $row['password']; } else { printf("Could not retreive records: %s\n", mysqli_error($mysqli)); } mysqli_close($mysqli); } echo "<h2>".$f." ".$s."</h2>"; ?> <form method="post" action="user.php"> <?php echo " <table> <tr><td>First Name: </td><td><input type=\"text\" name=\"firstname\" size=\"20\" value=\"".$f."\" /></tr> <tr><td>Surname: </td><td><input type=\"text\" name=\"surname\" size=\"20\" value=\"".$s."\" /></tr> <tr><td>Username: </td><td><input type=\"text\" name=\"username\" size=\"20\" value=\"".$u."\" /></tr> <tr><td>New Password: </td><td><input type=\"text\" name=\"newpassword\" size=\"20\" value=\"Enter New Password\" /></tr> <tr><td>Re-enter Password: </td><td><input type=\"text\" name=\"confirmpassword\" size=\"20\" value=\"Confirm New Password\" /></tr> </table></form> <br/><br/> "; $new_f = $_POST['firstname']; $new_s = $_POST['surname']; $new_u = $_POST['username']; $new_p = $_POST['newpassword']; $conf_p = $_POST['confirmpassword']; echo"<table> <tr> <td><input type=\"submit\" name=\"update\" value=\"Update User\" onclick=\"javascript:eventWindow('cms/updateuser.php?i=".$id."&f=".$new_f."');\"></td> <td><input type=\"button\" name=\"delete\" value=\"Delete\" onclick=\"javascript:eventWindow('cms/deletevalidation.php?i=".$id."');\"></td> </tr> </table>"; ?> and this is the code receving the data. <php $id = $_GET["i"]; $f = $_GET["f"]; echo $id; echo $f; ?> at the moment I'm just trying to echo the variables that are being passed to the new page, to make sure that they are being populated. Any help please????
  13. Hi guys and girls, I was wondering if anyone could help me out with a little problem I'm having. I have built a page which retrieves user details from a database and displays a list of names in a drop down list, this works fine. I then want the user to select a name and click a "View" button to display the details of that person in a pop up window. The pop up opens fine except the data which it displays is always for the last person in the drop down list, IOW the person that the loop finishes on. Does anybody know what I'm doing wrong? My code is below. <script type="text/javascript"> function eventWindow(url) { event_popupWin = window.open(url, 'event', 'resizable=yes,scrollbars=yes,toolbar=no,width=450,height=500'); event_popupWin.opener = self; } </script> <?php $mysqli = mysqli_connect("localhost","root","root","opp_group"); //Get list of users in drop down $getUsers_sql ="SELECT id, firstname, surname FROM cms_users ORDER BY firstname"; $getUsers_res = mysqli_query($mysqli, $getUsers_sql)or die(mysqli_error()); echo "<form method=\"POST\" action=\"\" > <select name=\"users\">"; while ($row = mysqli_fetch_assoc($getUsers_res)) { echo '<option value="' . $row['id'] . '">' . $row['firstname'] . ' ' . $row['surname'] . '</option>'; $id = $row['id']; } echo "</select> <a href=\"javascript:eventWindow('../user.php?i=".$id."');\"> <input type=\"submit\" name=\"viewuser\" value=\"View\" /> </a>"; ?> </form>
  14. Can anybody please help me out here? I am now using a simple hyperlink e.g. <a href="../cmsmenu.php">Back</a> ...but the page still returns blank. Does it have anything to do with the session variables being passed between each other??
  15. One little niggly thing though, every time the page is refreshed I get the error: Warning: unlink(../Images/Image018.jpg) [function.unlink]: No such file or directory in C:\wamp\www\Site_Pages\cms\Untitled-1.php on line 15 The filename is the file that was first in the loop the last time the page was loaded, even though this file may have been deleted.
  16. I think I've solved it. I was being a bit of a spud and forgot to close the form. I put in a </form> tage and it now seems to be working. Thank you so much for all your help guys, there should be a thanks or Rep button on this forum and you could all have some!!
  17. Right I think we're nearly there!! It now deletes a file, but whichever button I press it always deletes the last file in the folder, IOW the one the loop gets to last. <?php if(isset($_GET['delete']) && $_GET['delete']=='true') { unlink("../Images/".$_POST['fileToDelete']); } ?> <?php if ($handle = opendir("../Images/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $myfile = "../Images/".$file; echo "<td><a href=\"../Images/".$file."\"><img src=\"../Images/".$file."\" width=\"70\" height=\"50\"></a></td>"; echo "<form method=\"post\" name=\"deleteSomething\" action="?><?php echo $_SERVER['PHP_SELF'].'?delete=true';?><?php echo" > <input type=\"text\" name=\"fileToDelete\" value=".$file." > <input type=\"submit\" value=\"Delete\">"; } } closedir($handle); } ?>
  18. Parse error: syntax error, unexpected '"', expecting ',' or ';' in C:\wamp\www\Site_Pages\cms\Untitled-1.php on line 24 lonewolf and POG1 thanks for the input, I'm not sure I understand what you're saying tho, I'm really new to this!
  19. Ok I'm using Brian's code and have muddled it into something like this... <?php if ($handle = opendir("../Images/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $myfile = "../Images/".$file; echo "<td><a href=\"../Images/".$file."\"><img src=\"../Images/".$file."\" width=\"70\" height=\"50\"></a></td>"; if($_GET['delete'] > '') { unlink("dir/".$_GET['delete']); } echo "<input type=\"button\" value=\"Delete\" onClick=" if(confirm('Are you sure?')) { window.location="".$myfile."?delete=".$myfile.""; } "><br />"; } } closedir($handle); } ?> Where am I going wrong now?
  20. I am trying to display the contents of a folder and place a delete button next to each file. Then I want to be able to press the button and delete the file, but instead, when I refresh the page to view my changes, all of the files are deleted even though I dont touch the buttons. The code is below... <?php if ($handle = opendir("../Images/")) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $myfile = "../Images/".$file; echo "<a href=\"../Images/".$file."\">".$file."</a>"; echo "<img src=\"../Images/".$file."\" width=\"70\" height=\"50\">"; echo"<input type=\"button\" value=\"Delete\" onClick=\""; unlink($myfile); "\"><br />"; } } closedir($handle); } ?>
  21. Would you possibly be able to point me in the direction of one of these scripts? I've had a long search and can't find anything that suits my needs. I just need to be able to view the contents of a folder on the web server, and to delete files that are no longer needed.
  22. Is it possible for a logged in user to click a button and open a Windows Explorer window, so that they can manage the files that have been uploaded?
  23. I dont understand how this helps me? Does anybody else have any ideas about why my pages might be not displaying and just giving me a blank screen?
  24. I have a form which displays user data from the database and I want to be able to let the user change it and resubmit it to the database. This is the code for the form.... I know that $id, $f, $s and $u all have data in them because they display on the page, but I cannot update the new data that is entered in the form. I'm not sure if this is a PHP or MySQL problem. Any help appreciated! <form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\" value=\""; echo @$_POST['upload'] ? $_POST['upload'] : ''; echo "\"> <table> <tr><td>First Name: </td><td><input type=\"text\" name=\"firstname\" size=\"20\" value=".$f." /></tr> <tr><td>Surname: </td><td><input type=\"text\" name=\"surname\" size=\"20\" value=".$s." /></tr> <tr><td>Username: </td><td><input type=\"text\" name=\"username\" size=\"20\" value=".$u." /></tr> <tr><td>New Password: </td><td><input type=\"text\" name=\"newpassword\" size=\"20\" value=\"Enter New Password\" /></tr> <tr><td>Re-enter Password: </td><td><input type=\"text\" name=\"confirmpassword\" size=\"20\" value=\"Confirm New Password\" /></tr> </table> <br/><br/> "; $new_f = $_POST['firstname']; $new_s = $_POST['surname']; $new_u = $_POST['username']; $new_p = $_POST['newpassword']; $conf_p = $_POST['confirmpassword']; if($new_f) { if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } else { $updateUser_sql = "UPDATE cms_users SET firstname ='".$new_f."' AND surname ='".$new_s."' AND username ='".$new_u."' WHERE id = '".$id."'"; $updateUser_res = mysqli_query($mysqli, $updateUser_sql); if ($updateUser_res === TRUE) { echo "Update Successful"; header ("Location: user.php"); } else { printf("Could not update page: %s\n", mysqli_error($mysqli)); } mysqli_close($mysqli); } } echo"<table> <tr> <td><input type=\"submit\" name=\"update\" value=\"Update User\"></td> <td><a href=\"javascript:eventWindow('cms/deletevalidation.php');\"><input type=\"submit\" name=\"delete\" value=\"Delete\"></a></td> </tr> </table></form>";
×
×
  • 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.