Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Posts posted by justsomeguy

    Format

    If you're using Jscript:datesIf you want to output a floating point number with a specific precision, look at Number.toFixedIf you're using VBscript, you're going to have to find it on your own. VB and all it's demon spawn make me want to chunder.

  1. OK, notwithstanding the fact that both of you apparently automatically assume that I'm completely incompetent and have no clue what I'm talking about, no, I do not have an example right now. My post was in response to a site I was looking at, and I can't recall what that was. I will be sure to let you know the next time I run across such a site.The reason that the sites render slowly is because developers don't take the time to develop a decent layout, they just throw floating divs all over the place and call it a layout. At least using tables to lay out the structure of the page forces the developer to think about the layout and make choices, instead of simply throwing 10 divs on top of each other. Is that the fault of CSS? No, it's not. Is it the fault of incompetent developers? Yes, it is. Does CSS make it easier to be incompetent? Yes, it does.On the topic of CSS positioning - CSS has never had good support for this. Before the align attribute was deprecated, I had very few problems getting a page to look exactly like the image that the designer gave me. Granted, it wasn't all that easy to update, these were the early days, but that's the way it was done and it worked just fine. It seems that the W3C is having fun saying that 1) now everyone has to use CSS to be in compliance and 2) CSS is not going to support everything that it's supposed to replace.What I mean by footer positioning - the goal is to have a footer either 1) appear at the bottom of the screen, if there is not not enough content to fill up the screen or 2) appear at the end of the content, if the content takes up more than one screen. Regardless of whether or not this is *possible* to do, it is not as easy as it should be. I don't know what the W3C thinks people make web sites for, but there are some very basic things that they left out, including things like that, vertical alignment, etc. It's like the W3C totally ignored them. Case in point: horizontal alignment. Sure, there's a 'text-align' property. But I think the argument goes, at least with tables, that they should only be used for specifically what they are intended for (tabular data, etc). So clearly 'text-align' only applies to text (or else why qualify it with 'text'), so where is the normal horizontal alignment property? Are we expected not to align anything but text? That is what I mean when I'm saying that CSS leaves things out, like we are all supposed to have our pages conform to what the W3C thinks a web page should be.

    What are you talking about??? Absolute positioning??? Absolute positioning is not what is meant by a CSS layout.
    I'm glad we agree. I'll leave it up to you to explain that to the legion of web developers who are doing exactly that.
    You need to face facts...someday you will have to change your code...why not now? W3C has laid out there guidelines for web standards and modern browsers are working toward full support of them.You won't be able to ignore them forever.
    That's completely arrogant, I'm not ignoring anything. Quite the opposite, I'm trying to figure out how to do what I want to do using the 'new rules', and when it turns out that the new rules don't support what I want to do, what choice do I have? The W3C has always laid out their guidelines, and browser vendors have always chosen what to support, what not to support, and what to add of their own. Vendors are getting better about not doing that so much, but there's still a long way to go.As for why not change everything now? That's an easy answer. What if a year from now the 'next big thing' comes out, what then, do I change everything again, and wait another year? The fact is that browsers, IE in particular, don't even support CSS to a decent degree, and I'm not going to go scrambling about to change everything when people are going to be using the exact same browser they were in 2001 to look at the damn page. I've got better things to do than to update my codebase every time the W3C decides to publish a document. I don't work for the W3C. Once CSS has attained a satisfactory degree of market penetration and actually has good support behind it, I will be much less reluctant to depend on my clients having the necessary software to look at their intranet, but I'm not going to use some newer technology and expect software from 2001 to be able to use it. I don't think that IE6 got the W3C's memo about tableless layouts, and I'm not going to sit around and field support calls from clueless users because of CSS. All of my pages validate, all of my pages look the way I want them to, and all of my pages work. What's the problem?
    Nicely put fella I am tired of people squeeling about CSS layouts just cos they carnt be bothered to learn something new.Makes you wonder why they are even in this trade really as things in this trade are changing all the time.I am supprised people with this opinion even use computers, I mean what was wrong with the type writer A?
    Are you really that ignorant? Do you think you know me? Apparently you do, because you are implying I don't belong in this industry. You think the issue here is because I don't want to learn about CSS? You are right about one thing though - things are changing all the time. Excuse me if I'm too busy to jump on the newest bandwagon as soon as it rolls up.I'm not trying to start a flame war here, I just get a little irritated when people younger than myself accuse me of not knowing what I'm talking about, when the irony is that you do not know what you are talking about (since you're talking about my qualifications).
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    That is your document type definition. It tells the browser what rules to apply when the browser renders the page. In this case, you are telling the browser to behave according to the XHTML 1.0 Strict doctype. You can specify different doctypes there and the browser will (should) display the page differently, according to whatever set of rules you tell it to follow.You may want to point the W3C validator to your website and see if it flags anything as wrong for XHTML 1.0 Strict.http://validator.w3.org/
  3. I'm thinking it's because there is that line of executable code in the class definition. I believe that the class definition only declares everything, it declares functions (methods) and variables (properties). If you want to declare and initialize a variable, you can only initialize it to a constant value, not through a function call. If he wants something to execute when the class gets instantiated, then that should go in the constructor.

    class user {  function user ()  {    $this->name = $this->data("name");  }  function data ( $rowinfo )   {    $rowinfo = "'$rowinfo'";    $query = "SELECT * FROM xM_members WHERE id = '$sesID'";    $result = mysql_query( $this->query );    $row = mysql_fetch_array( $this->result );    return $row[$rowinfo];  }}

    Edit: I'm pretty sure you want to use mysql_fetch_assoc instead of mysql_fetch_array, $rowinfo is a string, not a number

  4. I'm a little confused, is the PCAverage field in each row, so that one row consists of something like this:

    Day      Hour  Quarter  PCTotal PCAverageMonday   4     1        7       7

    Is the PCTotal field only a single number, or a list of numbers? The query you have there looks like it will calculate the averate PCTotal (one number in each field) over all rows that do not match a certain day. The easiest way to get the average is to run that query, get the average out of the result set, and then use another query to update the average somewhere else. Or am I missing something?

  5. Check here or here for help on the Excel thing. Since it's not an open format, you may run into some problems, but there appears to at least be a component that you can use.With regard to PDF, I doubt you are going to be able to find something that will programmatically convert an Excel document to a PDF. You can just create a PDF, but I'm not sure about the conversion. But if you want to create a PDF, you will have to install a third-party component, which will mean you either need to have access to the web server, or you will need to be really good at sweet-talking the IT staff (purple lipstick is a good start).

  6. It's probably easiest to have everything on the same page. Have the page that shows the login fields also be the page that adds them to the database. That way, you can check on the top of the page if they submitted the form, and if they did, you can check their username and password. If they are fine, you add them to the database and either give them a welcome message or redirect them to another page, and if they have an error you can just show them the error message and give them the login form again.If you want to do it with 2 pages, then you will want your second page to redirect to the first page with an error message.

    if user = "" thenresponse.redirect("reg.asp?error=" & server.URLEncode("enter a name"))end ifif pass = "" thenresponse.redirect("reg.asp?error=" & server.URLEncode("enter the password"))end if

    Then you need the reg.asp to look for an error variable in the querystring and display the message.

  7. I think you're confusing your terminology, biology is a 'field', not a row. A row is a single set of all fields. If you have a table called users, some fields might be id, password, name, etc. A row of the table would be one record, so it would be something like:'user123', 'cleverpassword', 'Test User' etcAnyway, it looks like you need to build a SQL search query. That's always a fun time. You will probably need to build a query using plenty of ANDs and ORs. The way you have it now, you have the keywords separated by "AND", so that means that all keywords need to appear in the field in order for the row to be included in the search. If you have "OR" instead, that would indicate that you can have any keyword and still have the search succeed. Or, you can go one step further and have radio buttons where the user could pick "all keywords" or "any keyword", and then you switch between AND or OR.Anyway, if you want to search in more than one field (say, 'biography' and 'tours'), it would look something like this:

    $query = "SELECT id,username,email,biography, tours FROM users " ."WHERE (biography LIKE '%".$keywords['0']."%' OR tours LIKE '%".$keywords['0']."%')";for ($i=1; $i<count($keywords); $i++) {$query = $query." AND (biography LIKE '%".$keywords[$i]."%' OR tours LIKE '%".$keywords[$i]."%')";}

    If you want to do the any/all thing, you could add something like this:

    <input type="radio" name="any" value="any">Any word  <input type="radio" name="any" value="all">All words...$any = $_POST['any'];if ($any == "any")  $bool = "OR";else  $bool = "AND";$query = "SELECT id,username,email,biography, tours FROM users " ."WHERE (biography LIKE '%".$keywords['0']."%' OR tours LIKE '%".$keywords['0']."%')";for ($i=1; $i<count($keywords); $i++) {$query = $query." {$bool} (biography LIKE '%".$keywords[$i]."%' OR tours LIKE '%".$keywords[$i]."%')";}

    Log in

    No problem. I was pretty pumped when I realized I could do that too, I've never liked mousing over something and seeing the status bar pop up and load an image, and javascript preloading always seemed like a hack (which it is). This way seems to work pretty well.

  8. You can't see the PHP code unless you have direct access to the files (through FTP or something). The PHP code in the script gets executed by the server, and the server sends the browser whatever the PHP tells it to, so by looking at the output, you have no way of determining what code produced that. It's a feature of PHP though, so that people can't see how you're doing things if you don't want them to.

  9. When you export in Flash, you can have Flash create the HTML code for you. You want the version in the HTML code to match the version of the Flash player you exported your movie for. You probably don't want the code saying to use the Flash Player 6 if you exported for Flash Player 8.

  10. Vertical alignment will only come into play if you set the height of the element. If you set the height of the element to 200px, and then write one line of text in it, you can use vertical alignment to say where the text shows up. But if you don't set the height, the element will only be as large as it needs to be (it will be the minimum height necessary), so vertical alignment doesn't have any effect.With regard to min-height, keep in mind that IE doesn't support min-height at all.

  11. There are several ways you can do this. You can force <h3> to be displayed inline instead of block:

    <h3 style="display: inline;">

    or

    <style type="text/css">.inline { display: inline; }</style><h3 class="inline">

    Or you could just bump the font up:

    <span style="font-size: 150%;">

  12. Good lord man, first of all, you need to use puncuation (you know, periods and commas) to break up your post, and some line breaks wouldn't hurt either. Your entire post is one rambling sentence, and it's not easy to understand.Second: the word is "submission". I tried to copy and paste that text into Word to run a spell check on it but Word just exploded and refuses to do anything else or deallocate its memory until I apologize. Also, the word is "goes", as in "the bus goes down the street", not "go's" or "gose".Read this thread, it's about your first problem: http://w3schools.invisionzone.com/index.php?showtopic=4138It covers the topic of changing a login form with a welcome message. I have no idea what you're talking about for the second problem, I don't understand what the issue is.

    its sumost to post it but it dustint post
    I think you mean "it's supposed to post it but it doesn't post".
  13. First, about when you write the output. It's probably better to either use single quotes, or escape the $ sign so as not to confuse the parser:

    $output = '$db = array(); ' . $newentry;foreach ($db as $key => $value) {    $output .= ' $db[\''.$key.'\'] = "'.$value.'";';}

    Also, I'm confused about the first 2 lines of code you have. It looks like you are writing PHP code to a file, and the code creates and sets up an array. So these are the first 2 lines:

    include('db.php');$db = array();

    It looks like you include the file that builds the array, but the next line is the array construct which assigns a new blank array to $db. Take out the second line and see what happens, I think that will probably fix it. Or you can also replace it with this, to make sure that the first time this runs $db is created, but won't be replaced:

    if (!isset($db))  $db = array();

    With the image issue, if you can get to the file directly then it's not a permissions problem. One thing to do is to make sure you wrap all your variables inside strings in curly brackets. You have one variable called $images and one called $imagesource, so when the engine sees echo "...$imagesource..." I'm not sure if it reads that as "...{$imagesource}..." or "...{$images}ource...". Also, in the link you shouldn't have & separate variables, only &. Saying remove.php?key=xxx&value=xxx makes a variable called key and a variable called amp;value. & is only for displaying the ampersand in text. Anyway, I've just cleaned up the code a little, see if it works:

    foreach ($db as $key2 => $value2) {     $imagesource = $images.$value2;    echo "<img src=\"{$imagesource}\" alt=\"{$value2}\"/><br/>image: {$value2}<br/>uploaded: {$key2}<br/><a href=\"remove.php?key={$key2}&value={$value2}\" title=\"remove this image\">remove this image</a><br/><br/>";}

  14. About the tutorial:

    At W3Schools you will find complete references of all PHP functions:
    That's not entirely true. Compare the list of function categories at w3schools here (there are 12 categories) with the list at php.net (there are 177 categories).
×
×
  • Create New...