Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. Solved (myself) Somehow its started working. I looked into how the names were getting passed and I think its to do with this being the second __autorun call, based on another dependency... I had named namespaces without the leading \ and thus I was attempting to access \framework\system\framwork\ui\UI etc.... just like a filysystem only crunchy! Thanks
  2. 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.
  3. 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!
  4. 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.
  5. 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 { } ?>
  6. 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
  7. I'm not sure what you mean by the "INSERT INTO... SELECT...". (as in I know the SQL.. but not what its talkign about table wise)..... the events table/view/whatever needs to have a static id to each group/sport id combination ( as I showed in the example events table).... thanks
  8. events is the resulting table.. I'm trying to join the groups and sports together, so that the event table contains every sport for every group - with a uid so that I can reference it with point counts etc.... ?
  9. 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?
  10. 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?
  11. 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
  12. 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
  13. 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
  14. 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 } ?>
  15. well you can always find the file (and thus what directory its in): sudo find / -name "*smtpd.conf" That will print out all the *smtpd.conf files on your system (assuming you did run it with sudo).
  16. Of course... I looked up the not operator in regex and came up with the following $id = ereg_replace("^[0-9]", "", $file); Thanks
  17. Hi, How can I return the digit from the string "file10.gif" ? I have a directory listing of files, and I need to get the digit from the file in order to place it in a database. Thanks.
  18. Ok thanks, So how do I then use that matched pattern? I want to be able to parse only the url into a function, and then replace the function returned value, back into the original string that was matched. Thanks
  19. Hi, Firstly - I know the most basic of regex, and thats it. Im looking to match the pattern: src="[A-Za-z0-9]" * well at least, thats roughly it. How can I store the patern matched by [A-Za-z0-9], but only in teh context of src="pattern" ? * Im attempting to parse urls on a page, and make them absolute, so i wil be adapting the same code to href etc. Thanks!
  20. Ahh ok, is there any other library in php that does support modifying animated gifs? Thanks
  21. Hi, I'm trying to place an animated gif ( a small pet icon) into a larger image using GD... and although it works ( the output is visually correct), the gif isn't animated. Is there a way to create animated gifs through PHP? I've read GD doesn't support animated gifs ( well creating them), and that the only method might be to disassemble each from in the gif, and then reassemble it... but then how? Thanks
  22. <?php if($condition) { echo "string";}?> Ok, well I selected some code from here ( that displayed correctly) by using the select link and pasted it into a new field. then placed code tags around it... pressed preview .. it worked. Then I tried to write my own code... and It ented up like above
  23. Thats what im saying. Even if ive manually entered it into this field ( like I just did now) - its stripping and/or ignoring newlines. how then can I post the newlines with code? Thanks *edit: jsut reviewed the png, and thats a screenshot of "preview" on the code. if you want Ill screenshot how i enter the code.
×
×
  • 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.