Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Posts posted by PC Nerd

  1. I'm not sure if the same name will cause the issue, because they are techincally in both forms.  that would be like having two forms on a page, one for users to sign in ( name=username) and one to signup (name=username) etc...

     

    It might be to do with the fact you're not closing hte <input>'s and thus its thinking that the second form is like a subform to the first, and thus getting rather confused.  Indenting code and html can often help with noticing when you've placed something in the wrong spot etc..

     

    Also - it might help to add an onClick event to the buttons so you can alert() out where it's submitting to, that might help also.

     

    Good luck.

  2. Hi,

     

    You might want to try looking at exploding on the new line, so using  "\r\n" or something.  i'm not sure if its 100% what you're looking for but it should work.

     

    If you're entering smaller amounts of data like that it might make sense to have a "add new field" button and jsut have a table of text fields.  if you name them: username[1], username[2] etc, then you will be able to access them in php using an array and thus use the same code as you would resulting from the explode().

     

    Good luck!

     

  3. Hi,

     

    It's hard to say what your rtel.build() function does, but you might want to check that its building the hidden field containing the value you want.

     

    The only way to send a javascript variable to php is to have a hidden text field -->  <input type="hidden" name="rtel" value="whatever" />

    So when you have finished your javascript ( pressumably somewhere around the build(), depending on what it does) you will want to do something like:

     

    document.forms[0].rtel.value=retl;

     

    this makes a few assumptions that a) you have only one form ( perhaps add a name="myform" attroibute to the form and access it that way), and that you have already created the empty hidden field.

     

    When you get to php, you will have the hidden field jsut like any other text field, in $_REQUEST or $_POST etc.

     

    Good luck!

     

    P.S. - It usually doesnt help to post "urgent" etc. in the thread topic.

  4. Hi,

    I've written this small __autoload for my page, and it's echoing the correct file out, however I get the "Class blah not defined" in my script.  I've root (/) in the filenames is the root of the installation, and htdocs i the only web accessable folder.

     

    From the echo below, I get: "../system/classes/UI.class.php", which definately exists.  I'm stumped.

     

    Thanks for any help.

    PC_Nerd

     

    /htdocs/index.php

    <?php
    function __autoload ($className) {
        $filename =$className.'.class.php';
        $filename = str_replace('\\', "/", $filename);
        if ( preg_match( '/[\w\d\.]+\.php$/', $filename, $matches) ) {
            $filename=SYSTEM_DIR."classes/".$matches[0];
            if(file_exists($filename)) {
                require_once $filename;
                return;
            }
            else {
                echo "The file: ".$filename." -> was not found.\n";
            }
        }
        throw new Exception("Required file was not found: ".$filename." - Class not loaded");
    }
    ?>
    

     

    /system/classes/UI.class.php

    <?php
    
    namespace framework\ui;
    class UI extends framework\system\Singleton {
    }
    
    ?>
    

  5. Hi,

     

    I like the style of iteration over a MySQLi_Result object such as:

    while($row=$result->fetch_assoc()) {/* do stuff */}

    As oposed to something like a for loop with $result->num_rows etc...

     

    However how would I code such a function.. I'm not sure what the function ( such as in my case $reportData->fetch_row() ) would need to throw, return or otherwise "do" to quit the while loop and not cause infinite iterations.

     

    Thanks,

    PC_Nerd

  6. Hi,

     

    Just a quick message to anyone that added me on MSN over the last day.  When I loaded it up this evening it crashed and rendered your "invites" as accepted but seems not to have submitted them.  Could you send me an email at jack@battleages.com and I'll try and search for your addresses / sort something out to get talking. Sorry for the inconvenience.

     

    Thanks,

    Jack

  7. Hi!

     

    I'm looking for smaller jobs to work on.  I've recently been working a lot with AJAX and jQuery.  If anyone needs work done or help in AJAX/JavaScript related scripts or PHP as always, just send me an email at jack@battleages.com or add me on msn at Gimli_legs@msn.com (but please no emails to the msn address as I do not check them regularly enough - I check my main email there many times a day so you can be guaranteed a reply.

     

    Thanks!

  8. groups

    --------

    group_id int PK

    group_name varchar

    upper_limit int

    lower_limit int

     

    sports

    -------

    sport_id int PK

    name varchar

     

     

    data:

     

    groups

    -------

    1, "Jnr", 12,15

    2, "Snr", 16, 19

     

    sports

    --------

    1,"High Jump"

    2, "Long Jump"

     

     

    so that my resulting table would be:

     

    events

    __________

    1, 1( sport_id), 1 (group  id)

    2, 1, 2

    3, 2,1

    4,2,2

     

     

    At the moment I can acheive a similar thing in a view - however the events table cannot have the primary key .... can I get a primary key in there somewhere?

  9. Good point....

     

    two tables, I need to have a third with all of the other two table's worth of data init - linked with a Primary key....  eg:  in the new table, for each record in the groups table I would have every record from the sports table...  At the moment I can get the data like I want into a view - but those dont allow primary keys ( and understandably)..... At the moment I'm having to "start" the system by using PHP to generate each record into the new table - and then essentially lock access to the other two tables - because changing them could change the new table's data ( which is the "mission critical" thing in the system....

     

    Is there an alternative method to this scripting?

  10. Hi,

     

    At the moment I've got two tables: "Sports" and "Groups"  - and I've got a PHP script editing another table which is like a "sports by group" (or "events") eg. seperating different groups of competitors (ages, disabilities... whatever the group is)...  I need the table to have a static ID for each row/"event" generated.... so I cant use a view because it cant have a primary key.

     

    Is there an SQL based alternative, that will allow the same final queryable table/view but that will remove the language side of it (like creating a view with primary keys?)

     

    Thanks,

    PC_Nerd

  11. Hi,

     

    I'm thinking or writing a generic plugin based framework to utilise PHP as a pure GUI end of a server application... So not somethign like Joomla but not so "already built" etc.

     

    I havent been able to find any good articles/tutorials/references etc on building a plugin based php system and was wondering if anyone here would be able to link me to some tutorials or better still: any open source libraries/projects that I have missed.

     

    Thanks,

    PC_Nerd

  12. alternatively  - seeing as you appear to be only starting with php ... it might be easiest to look into setting an array with your field as the date, and the value as a date, and the value as the starsign ( of course you would have to parse the field as you loop through and check) but it'll save you the hastle of files and mysql if you are only just getting started with it.

    gdlk

  13. Hi,

     

    I'm writing a sort of plugin system, and my Page ( as in the page specific class that handles that pages content) is telling me that it cannot find the interface which i included on the first line of index.php... any suggestions?

     

    Thanks in advace - heres my code.

    PC_Nerd

     

     

    Error

    Interface 'Page' not found in ******/cp/pages/Home.class.php on line 2

     

    index.php:

    <?php
    include_once "classes/Page.ifc.php"; // Extension page interface
    include_once "classes/Factory.class.php"; // Component Factory
    include_once "classes/Filesystem.class.php"; //Filesystem management
    $f= new Factory();
    
    ..... Other code that parses $_GET and $_POST... no implementation/use of any included files classes or anything etc.
    
    $loaded = $f->loadClass("Home");
    if($loaded==False) {
        die("Could not load Home");
    }
    
    $HomePage = new Home();
    
    echo $HomePage->getPage();
    ?>
    

     

    I wont post all my classes - they sort of "embed" each other inside the factory class - but essentially it searches subdireectoriese for teh named class - and then require_once's it.

     

    Home.class.php

    <?php 
    class Home implements Page { 
        private $title = "Test page"; 
        private $content = "This is some test content.  Later it will be returned through the getPage() method";
    ......... *other methods based in the Page interface
    }
    ?>
    

     

     

  14. Hi!

     

    I'm available for more work at the moment.  I'd like to upgrade the above list of experience to:

     

    4 years- Python

    4 years- HTML/CSS (Can and will code for (X)HTML standards compliance).

    3 years- PHP/SQL/MySQL

    2 years- JavaScript (and AJAX 1.5 years)

     

    PHP/MySQL if by far my strongest language/database.  I've experience writing webbots, and am available for writing smaller bots if needed.

     

    In adition to the languages listed in my first post, I can help debug some TCL code if anyone needs help there - though I am not freelancing in it.  I also have a limited experience in GIMP, and a years animation and modeling in Blender3D should anyone need help in those.

     

    As always, Im available through MSN and email (above), and if those dont suit you, then I'm more than happy to find somethign that works for you.

×
×
  • 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.