Jump to content

darksniperx

Members
  • Posts

    113
  • Joined

  • Last visited

    Never

Everything posted by darksniperx

  1. k, i'll try again Edit: I have removed the spaces before END; and it worked.
  2. I should have 4.3.9 or something higher, I worked when I tested it out.
  3. interesting, havent thought about it this way, I guess php is very robust. Just hope it will work with php 4, I'll work with both of them, each one has a very unique use for me.
  4. I did check php.net, I guess I have missread. Anyways, thx, everething works now.
  5. nice!!!!, I have one ,more question, it is possible to pass a parameter with call_user_func('show' . $name); to be something like this showEntry($value); or I have to hard code to pass a parameter?
  6. <?php $name = 'Entry'; include 'test.php';-> I would like to change it to-> include '$name.php'; show.$name.(); ?> I would like to automate my php code and reduce at the same time. I pass one variable that contains text value, so that php would use that variable name inside include and function name. It should be possible?
  7. echo <<<END END: I dont think it is supported in php4, anyways I got around it by using \n, works good for me.
  8. ho here is the structure that I have been using. index.php page: <?php include ("fusion.php"); include ("forms.php"); $webForm = "Entry"; //specify which form you want to work with $form = new forms; // create an instance of selected class $form->setFormData($webForm); // populate class variables selected form ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <meta http-equiv="Content-Script-Type" content="text/javascript; charset=UTF-8;" /> <title>Index Page!</title> <?php $form->outputHeaderData(); // echo any content in the head section ?> </head> <body <?php $form->ouputBodyAttributeData(); // echo any content that is suppose to be in body tag ?>> <?php $form->outputForm($webForm); // echo any content in the body section ?> </body> </html> forms.php contains functions that echo html data ex:"outputForm($webForm); " , but since the page started to get too big 1.5 k of lines an growing, I started to separate it, so the first thing I did was take out all js scripts and put forms.php into separate files. Which gave me the following error of php no working in js. So as the person said earlier to one of my post, put it into a separate php file which echoes the content. I though then, thats a good idea, I will make a separate php page for every form content and make form content call them and out put them where user wants to. But then if I use include on every single php file and not use them, i will just waste memory. Is there any way around it.
  9. I am creating mini feed, for computer science department withing my school as a project, I use php+mysql to to store and retirieve data and atom syndicate to create xml feeds. Which means that most of my js is to make things look more dynamic, and more or less pass data from php to js so that I could use it the data I have retrived from db later on any times I wanted. My php also generates a unique id based on urn:uuid scheme. Question, can I load data from external files without using include. Because if I will have 50 includes or something like that, but I will use 2 or 3 at the time, they will be different based on the form which is going to be loaded. I will post my file structure, and you might give me suggestion on how can I improve it. thx
  10. ok, thx, I will check it out tomorrow morning, its 11:30 pm for me, but thx.
  11. anyway to confirm it, I can try renaming the file, I dont think that will do much of a difference.
  12. the following code is inside external js file. function showYear() { document.getElementById("pub_year_id").value = '<?php print date('Y'); ?>'; } the following code is inside html file ... <script type='text/javascript' src='scripts/entry_js_script.js'></script> ... <body onload="showYear();"> ... I get blank value, if I was to put the whole code inside html file it would work, but as soon as I put inside external js file, it just does not want to work. The following code I have used as an example, and I cant use pure js, since alot of my js script is mixed with php and it just got too big and hard to maintain when it is inside html file, so I put it into an external file. Am I doing something wrong or there is another way to get php and js to work inside an external file.
×
×
  • 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.