Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Posts posted by ober

  1. The changes you made were very good and very much to the point of what I was getting at.

    Still a few things:

    1) You need to wrap your news output with the nl2br() function.
    2) When saving the main config options, it wouldn't hurt to show the form again after the success message.
    3) The re-ordering of the pages still doesn't work at all. I got one page to re-order, then I couldn't even repeat that operation. Buuuuugggggggggy.

    And I would be fine using htaccess for one or even a few people to edit with.
  2. No offense, but I don't think anyone on here is going to (or at least they shouldn't) just show you their MySQL database. That's a security risk. If you can't figure out the problem, then leave it for someone else to answer or ask the poster to provide more information that they're comfortable sharing.
  3. Norman,

    Normally, we'd like to keep these discussions online so that other people searching through the forums can find answers as well. I obviously can't stop either of you from proceding, but I also think it should be the origional poster's position to ask about taking it offline.
  4. It's looking REALLY good.

    A few things I noticed:

    1) Reordering the pages doesn't seem to work (down works, up doesn't.. and you should disable the up for the top row and down for the bottom row).
    2) The main text box for the page when editing a page is sooooo tiny.
    3) Main Config page: all those boxes should be the same width and I wouldn't really make the user put a <hr> in to seperate the items. I'd simply limit them to 3 or 4 news items (provide them with 3 or 4 text boxes) and seperate them automatically. Website Title and Heading should be text boxes, not textareas... and you should really limit the length of those items.
    4) Website traffic: I get a "forbidden".

    And I notice I didn't have to enter any login info... I assume you haven't setup the htaccess file yet?
  5. I haven't dealt with extending, so you might just have to ignore my answer (and maybe explain your class a little better)... but why wouldn't you just create a new instance of the class for a new account?
  6. No... you cannot run an "or die()" on a regular function. You just have to know what the output is supposed to be and if it isn't in that "range", you have to deal with it accordingly. Like I said, if you're processing before any output is created, you can redirect to another page and show some sort of error. If the processing or the running of the function is AFTER some output has been created, you'll just have to create your error message right there.
  7. How is your list of words setup? Is it an array? Is it all in a string? I'd use the substr() function to look at the words and determine if it matches your pattern.

    I would use fopen() for that, but I'm going to guess that you're not allowed to use that function either... but maybe.
  8. That depends on how you use the form and what you want to do with it. If you just want to come back to the page and have the user selected again, you can set it from the $_POST/$_GET array, or you could set a cookie and pull it from that.

    Once you have the value in a cookie or in the POST/GET super global array, all you have to do is create an option like this:

    <option value="harry" selected="selected">harry</option>

    Then just create your other options normally.
  9. I would imagine you could use ODBC or some sort of COM object to talk to it. I've never tried it, however.

    [a href=\"http://us2.php.net/manual/en/function.dbase-open.php\" target=\"_blank\"]http://us2.php.net/manual/en/function.dbase-open.php[/a]

    You might want to read the comment at the bottom of that page.
  10. Error suppression. If the function errors out, it won't display anything to the user.

    The best way to use that is to set the function output equal to something and if it's not what you expect, you can append the error to a log file or email yourself and the user will never know the difference. You can also use it to display a "nice" error message to the user instead of the script spitting out what line the error came from and what the name of your file was, etc, etc.
  11. You're going to have to use the COM object: [a href=\"http://us2.php.net/manual/en/class.com.php\" target=\"_blank\"]http://us2.php.net/manual/en/class.com.php[/a]

    And keep in mind that any Excel file you edit MUST be on the server, not on the client machine!

    Code from that page:
    [code]<?PHP
    $filename = "c:/spreadhseet/test.xls";
    $sheet1 = 1;
    $sheet2 = "sheet2";
    $excel_app = new COM("Excel.application") or Die ("Did not connect");
    print "Application name: {$excel_app->Application->value}\n";
    print "Loaded version: {$excel_app->Application->version}\n";
    $Workbook = $excel_app->Workbooks->Open("$filename") or Die("Did not open $filename $Workbook");
    $Worksheet = $Workbook->Worksheets($sheet1);
    $Worksheet->activate;
    $excel_cell = $Worksheet->Range("C4");
    $excel_cell->activate;
    $excel_result = $excel_cell->value;
    print "$excel_result\n";
    $Worksheet = $Workbook->Worksheets($sheet2);
    $Worksheet->activate;
    $excel_cell = $Worksheet->Range("C4");
    $excel_cell->activate;
    $excel_result = $excel_cell->value;
    print "$excel_result\n";
    #To close all instances of excel:
    $Workbook->Close;
    unset($Worksheet);
    unset($Workbook);
    $excel_app->Workbooks->Close();
    $excel_app->Quit();
    unset($excel_app);
    ?>[/code]

    And here's another function that I have, but have never used:
    [code]<?php

    /***************************/
       function WriteExcel($strPath,$astrSheetName,$astrSQL){
    /* This function takes a file save path, and array of sheet names and a corresponding array */
    /* of SQL queries for each sheet and created a multi-worksheet excel spreadsheet*/
       $C_NAME=__CLASS__."::".__FUNCTION__;
           $dbs=new clsDB;
           $exapp = new COM("Excel.Application") or Die ("Did not connect");
           $intSheetCount=count($astrSheetName);
           $wkb=$exapp->Workbooks->Add();    
               $exapp->Application->Visible = 1;
           for ($int=0;$int<$intSheetCount;$int++){
               $sheet=$wkb->Worksheets($int+1);
               $sheet->activate;
               $sheet->Name=$astrSheetName[$int];
               $intRow=1;
               $qrySQL=$dbs->GetQry($astrSQL[$int],$C_NAME,__LINE__);
               $rstSQL=$qrySQL->fetchRow(DB_FETCHMODE_ASSOC);
               $astrKeyNames=array_keys($rstSQL);
               $intCols=count($astrKeyNames);
               $qrySQL=$dbs->GetQry($astrSQL[$int],$C_NAME,__LINE__);
               while($rstSQL=$qrySQL->fetchRow(DB_FETCHMODE_ASSOC)){
                   $strOut="";//initialize the output string
                   for ($int2=0;$int2<$intCols;$int2++){//we start at 1 because don't want to output the table's index
                       if($intRow==1){
                           $strOut=$astrKeyNames[$int2];
                       }else{
                           $strOut=$rstSQL[$astrKeyNames[$int2]];
                       }
                           $sheet->activate;
                           $cell=$sheet->Cells($intRow,($int2+1));//->activate;
                           $cell->Activate;
                             $cell->value = $strOut;
                       }//end of colcount for loop
                   $intRow++;
               }//end while loop
           }//end sheetcount for loop
           if (file_exists($strPath)) {unlink($strPath);}
           $wkb->SaveAs($strPath);
           $wkb->Close(false);
           unset($sheet);
           $exapp->Workbooks->Close(false);
           unset($wkb);
           $exapp->Quit;
           unset($exapp);
           unset($dbs);
       }//function WriteExcel
    ?>[/code]
  12. Right, but you're missing thorpe's point. A session is specific to each user, not ALL users on your site. You will have to use a flat file or a database to see if any user is logged in.

    Think of sessions as bank accounts and your website as a bank. Everyone putting money into your bank has their own account. If you wanted to see what the balance was for ALL the users, you'd go to the bank's register, not someone's specific account.
  13. I could repeat what Mark said, but he's pretty spot-on with everything. There's too much white space, you don't really have containment on the elements, and using that bright of a green on a white background is a bit shocking. I thought I was momentarily blinded when I first opened the site.

    Tone it down with some darker colors and try to give your areas a little better definition. It wouldn't hurt to narrow the focus as well and split the different areas up a little better. It looks like a big pile of mush at the moment.
  14. I know you're going to hate me even saying this, but this is why a lot of places like that require that you copy and paste the information into their own forms and then they can store it and allow you to edit it that way. There aren't many good editors that will work nicely with all the file formats that you're going to come in contact with.

    However in most cases, if I wanted to edit a document that I had on your server, I'd just pull out my old copy, edit it, and upload it again, replacing the current one.
  15. I'd do some work on the nav... drop the images and use more CSS. Or at least pad the top a little so the words are centered vertically.

    I also would move the left picture down a line or two. It looks off a little when you only have one line above it.

    And lastly, the whole site is kinda bland as far as color. You need something that stands out.
  16. I'm definately more into video games, but my wife and I play bored (haha) games from time to time. We're not so much into the heavy strategy games, but we play Scrabble, Chess, and Cranium. We also got into a DVD movie game for a while.

    I personally like Chess, but she's not a huge fan.
×
×
  • 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.