Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Posts posted by justsomeguy

  1. the WHOLE point of css is to seperate content from design.
    Well that brings up a good point.. what if the designer, for whatever reason, specifically wants their site to be viewed only exactly how they designed it? What options do they have?
    what are you talking about?  I have IE6 and it does css layouts just fine.????????
    Everyone has IE6. There are some things that IE does fine, and some things that it doesn't. IE does borders, and backgrounds, and those sort of things reasonably fine, but it's not so great with positioning. Or rather, it does it different than everyone else. I'm thinking back to the days where everyone wrote javascript that detected IE or Netscape, and had different code for each browser. These days, you see a CSS sheet with a bunch of IE hacks where IE needs the extra code to do the same thing that other browsers do.
  2. well, with other programs you can't view source and start editing it.
    When you install ConTEXT, you can have it replace Notepad, and every call to Notepad goes to ConTEXT.You should also just be able to specify which source editor you want to use. I see your 'IE is fine' comment, I don't know if IE can do that or not, but it's definately not fine.
  3. i'm just wondering if it was possible to use SQL to retrieve the latest information.Part of the database has to retrieve the last exercise the student has completed regardless of when they completed it, in other words, user's don't specify a date.The date of when this exercise is completed is going to be placed on the form along with the name of the exercise.

    Just get all records (or limit 1) and order them descending by date. The first record will be the most recent.
  4. Well, you will need to move all the data back to the first page and then show it again. This is really much easier if you are only using 1 page, then you don't have to move any data around.

  5. Yeah, you have everything in the while loop. Move all the html out of the loop. It looks like you are trying to set up a 2-column layout, so you just need a variable to say if you are or are not in the left column. You have the main table set up with 3 columns though, so since you are using tables here I recommend that you put all the nav in one cell, and the user list in another cell, with a nested table that lists all the users.

    <?php######################################################################## Copyright (c) 2006 TIArts.org# Coded by # http://.com#######################################################################include '../includes/header-members.php';// This will display by order of lastname then the rest just fills ininclude '../includes/db.php';?><link href="../includes/tia.css" rel="stylesheet" type="text/css" /><table width="700" height="10" align="center"border="0" cellspacing="0" cellpadding="0"> <tr>   <td><div align="center"></div></td> </tr></table><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" width="700" height="300" align="center">  <TR VALIGN="top"  ALIGN="left">    <td width="125" height="225" rowspan="2" align="left" valign="top"><?php include '../includes/links-members.php'; ?></td>    <td width="575" align="center" valign="middle">      <table border="0" width="100%" cellspacing="0" cellpadding="0"><?php$left_column = true;$result = mysql_query("SELECT * FROM users ORDER BY lastname ASC");while ($r = mysql_fetch_assoc($result)){  if ($left_column)  {    echo "<tr>";  }?>  <td width="50%">  <div align="left">    <a href="profile.php?u=<? echo $r[id]; ?>"title=<? echo $r[medium]; ?>  onmouseover="main.src='../images/mem/<? echo $r[id]; ?>a.jpg'"onmouseout="main.src='../images/mem/bg.jpg'" class="footer2"><? echo $r[firstname]; ?><? echo " "; echo $r[lastname]; ?></a>  </div>  </td><?php  if (!$left_column)    echo "</tr>";  $left_column = !$left_column;}if (!$left_column)  echo "</tr>";?>      </table>    </td>  </tr></table><?phpinclude '../includes/footer.php';mysql_close();?>

  6. Forget the comment, just put it in a PHP script and set a bunch of variables. If you are talking about users, you can make an array of users or something. Just set the variables, nothing will show up in output, and you won't have to do any text processing to get the information.

  7. Cool. You should change that to one of these two though:

    	<a href="<? echo $r['website']; ?>">WEBSITE</a><br>	<a href="mailto:<? echo $r['email']; ?>">EMAIL</a><br /><br />	<a href="<? echo "{$r['website']}"; ?>">WEBSITE</a><br>	<a href="mailto:<? echo "{$r['email']}"; ?>">EMAIL</a><br /><br />

    You get a small performance hit if you leave out the quotes on the array index, because the engine first looks for a constant by that name (i.e. website or email), and it goes through a couple things before trying a string. So putting the quotes in enforces that it just uses the string. You don't need the double quotes surrounding it at all if you are only outputting one variable, but if you do put it in quotes it's best to surround it with the {} and then use single quotes for the array index.

  8. The point of XHTML was to make an HTML document, in addition to being HTML, also to be a well-formed XML document. That is why you need tags like <br /> instead of <br>. There is no closing tag for <br> (no </br> tag). An anchor tag has a closing tag: <a href="xxx">yyy</a>; there is a </a> that closes the tag. So in order to be a valid XML document, all tags need to be closed, and that is why tags like <br /> or <img /> close themselves.But really, it's a bad argument to say that the problem is that you aren't allowed to make any mistakes. You should not be allowed to make any. The web was a terrible place when anyone who knew how to copy and paste was throwing up webpages that only looked halfway decent in IE. If you don't know what you are doing, then you may want to try to find work somewhere else. No other job lets you make mistakes (if you found one, let me know), so there's no reason that you should be allowed to make mistakes with HTML or any other web language.

  9. You'll probably want them to either click on a filename or select a file from a dropdown. Either way, the page that lets them edit the file needs to get the filename from somewhere. You can either get the list of files and spit them out in a list of links, or in a dropdown.The page that gets the filename needs to open the file and write the contents inside the text box. That page also needs to make sure to put the filename in a hidden input field to send to the next page:

    <?phpecho "<input type=\"hidden\" name=\"filename\" value=\"" . htmlentities($filename) . "\">";echo "<textarea name=\"editfile\">" . file_get_contents($filename) . "</textarea>";?>

    When the user submits that page, you need to get the edited file contents and just open the same file and write the new contents into it. Here's a reference and example on how to write data to a file:http://www.php.net/manual/en/function.fwrite.php

  10. Try this code. I loaded it into a code editor to format it, and it looks like you had a non-quote closing a string. This line:$query = "SELECT * FROM table WHERE year IS NOT NULL";was closed by some other character (not a "). It looked like a ", but it was something else (some sort of evil twin anti-quote no doubt).

    <?phpmysql_connect ("host", "user", "password") or  die ("Cannot connect with MySQL");mysql_select_db ("db") or  die ("Cannot connect with database");$query = "SELECT * FROM table WHERE year IS NOT NULL";$result = mysql_query($query) or die (mysql_error());while ($rekord = mysql_fetch_assoc ($result)) {  $year = $rekord['year']; // varchar(4) field in db  $month = $rekord['month']; //char(2) field in db  $day = $rekord['day']; //char(2) field in db  if ($year && $month && $day)   {    $day=$day+1; // day of deleting records    $timestamp = strtotime($year."-".$month."-".$day);    $kasuj=date("Y-m-d", $timestamp);    if (date("Y-m-d")>=$kasuj)     {      $query = "DELETE FROM table WHERE CURDATE() >='".$kasuj."' AND year IS NOT NULL";      mysql_query($query) or die (mysql_error());      print "Old recods removed";    }  }}?>

  11. Well, one of the templates wouldn't require any maintaining. You want the print copy as barren as possible probably, so it would be something like this:

    {template loop start}<h1>{title}</h1><p>{body}</p>{template loop end}

    It's just not a big deal to maintain that.I understand the reasons, my point is that it's not enough of a reason to justify the trouble of CSS.The only beef I have with CSS now is the same beef I had with javascript in 1998. It starts out and everyone is really excited by it, but it turns out that every browser does something different. So it requires all these hacks to try to make it do the same thing in every browser. I had enough fun programming javascript for Netscrape version 4.79 (anyone? anyone?) that I realized that I'm not going to spend my time hacking for browsers anymore, I'm just going to use what I know works everywhere and move on. In a year, or two, or three or whatever I'm sure CSS support will mature a lot and it will be fine to use the way javascript is fine today, I just don't think it's there yet. That's why I got all excited about tables, I just don't think there's any reason to throw them out yet. A table+CSS layout works great for me everywhere I use it. The day will come when it will be easier to do pure CSS and have it work right everywhere, but that day is not today. Firefox, Opera, and Safari are all on the right track, but MS really needs to set up a permanent IE department with 3 divisions: engine feature upgrades, standards compliance, and bug fixing, and they need to put out patches and new releases at the same rate as everyone else is. And in order for that to happen, they really need to separate IE from the OS (I heard they were going to.. we'll see). IE wouldn't matter if 85% of users weren't using it, but that's not going to change overnight.

  12. Well have you ever tried anything else? I used Notepad for years before I saw the light (and the syntax highlighty colors). If all you want is a little extra help from a lightweight program, like some auto-indenting, syntax coloring, maybe insert common code chunks, check out ConTEXT. If you want a little more, like FTP connections, code auto-formatting etc, check out PSPad. I use them both for various things, it's a real big help when writing code, it makes it much easier to instantly determine the structure of the code you're looking at. And both programs are lightweight, fast, and free, and both of them have communities in the forums. These programs really do save a lot of time. ConTEXT, for example, can save any file as an HTML page that shows the source code syntax highlighted through HTML. PSPad has a command to auto-format HTML, you can paste in a big ugly chunk of code, auto-format it, and have nicely indented and laid out code instantly. The name of the game is saving time, and these programs do it quickly and free.

  13. If you are only worried about images, the safest way is to check through PHP. You can use the getimagesize function to get information about the file. It supports these types:GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP, IFF, JP2, JPX, JB2, JPC, XBM, or WBMPThe return value of getimagesize is an array containing this info:width (pixels)height (pixels)typewidth="xxx" height="xxx" html attribute string for <img> tagMake sure you read the documentation page. The type is given as a number 1=GIF, 2=JPG, etc. Check out the doc for details.The advantage to doing this check in PHP is that 1) it doesn't rely on the file extension, it looks at the contents of the file and determines what type it is and 2) even if you turn off javascript the check will still take place. The disadvantage is that the file upload has to take place before the check, so the user may have to wait for the upload to find out that there is a problem with the file. But if you put the list of accepted types on the upload page, then that's their fault anyway.

  14. Well if the path is correct, and if the file is in a web-readable directory, then it should not return a 'not found' error. If it does, then either the path is wrong, you don't have the file in a web-readable directory (put it under wwwroot or /www), or both.

  15. I don't think you need this in reg.asp:

    <% If Len(Request("name"))= 0 then %><%response.write("enter correct data")%>  <%=Server.UrlEncode(Request("name"))%><% End IF %>

    You aren't submitting the data to reg.asp, so the name will never be there.You need to look for the error message and display that:

    <% If Len(Request("error")) > 0 then %><%response.write(Request("error"))%><% End IF %>

    Also, have add.asp redirect back to reg.asp, not to d.asp.

  16. I don't think this has ever really been a problem. Do you really go around changing the way websites look when you are surfing, or do you just read the content and move on? If a site has a terrible layout, I'm not going to sit there and adjust a CSS sheet so that I have the privelage of using that site. Instead I'll go back to Google and click on the next one. If someone has bad taste, I'm not going to sit there and try to fix it. But with Opera at least (I'm sure there are Firefox extensions to do the same), I can turn off a lot of things that people use for annoying purposes, like Flash, javascript, or java. That's about as far as I'm willing to go to fix someone's mistakes before I move on.As for cellphones or portable devices, personally I'm not on a big kick to make everything I do accessible on a cellphone. I've seen plenty of devices with VGA screens, and they show existing sites well, it's just a smaller screen. If someone has a text phone, and the client specifically requests that their content be viewable on a cell phone, then I will use PHP to detect the user agent as best I can and send different content to the device. All of the page content comes out of a database anyway, so it's trivial to set up a white layout with no styling at all and organize the content using <h#> and <p> tags instead of loading the normal HTML template.And if someone really wanted to see the website, they wouldn't be surfing on a text phone anyway. My roommate already has a VGA phone, it's a matter of time until the price point reaches a certain level and VGA devices become commonplace. When that happens, you won't need an alternate layout, they can view the same thing.

  17. I haven't heard anything about anything that does that. You might be able to read all the file data into a string and use the data as input into imagecreatefromtruecolor like I did in the image resize script. I'm not sure what would happen though.

  18. <?php$result = mysql_query("SELECT * FROM users ORDER BY lastname ASC");while ($row = mysql_fetch_assoc($result)){  ...  echo "<a href=\"{$row['website']}\">{$row['website']}</a>";  echo "<a href=\"mailto:{$row['email']}\">{$row['email']}</a>";  ...}?>

    That SQL statement has the order by lastname clause in it. I'm not sure what you mean by the tours, what does the tour field look like when it has data in it? If people could be involved in more than one tour, then you probably want to use another table to handle that. Something like this:table tours id nametable user_tours user_id tour_idThen you can build queries to get all users on a certain tour, or find out how many tours a user is on, or whatever.

  19. From what I can see, it looks like the Dispose method is implemented by someone who creates a custom class in order to destroy that class gracefully, without any memory leaks or anything else like that.If you don't understand what I just said, you probably need to either 1) do some reading and/or research into object-oriented programming or 2) don't create your own object classes.The Close method looks like it is pre-defined on a lot of built-in objects, but I don't think Close de-allocates memory the way Dispose does. For example, if you Close a database object, it will simply close the connection to the database, but the database object will remain in memory. However, if you Dispose of the database object, the object will automatically close and will be removed from memory.

  20. As far as I know, Response.Redirect only has 1 parameter. So all of these do the exact same thing:Response.Redirect("test.asp")Response.Redirect("test.asp", true)Response.Redirect("test.asp", false)Response.Redirect("test.asp", "I", "really", "like", "baby", "goats")All of them do the same thing, the first parameter (the filename) is the only thing used.

×
×
  • Create New...