Jump to content

YigalB

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Everything posted by YigalB

  1. I made a bug which caused endless loop and endless printing. When I noticed that, I closed the browsers tab, fixed the bug, open a new tab and re-run. I was assuming the server would start from the beginning, but instead I noticed that some variables were active and the program continued from where it stopped. How can I make the program to stop when the client tab is terminated?
  2. I have Apache PHP server up and running on Ubuntu. So far I used Geany. I installed NetBeans IDE 6.9, and followed the instructions from http://netbeans.org/kb/docs/php/quickstart.html . But when I try to run from the NetBeans I get 404 on the browser (FireFox). Can someone help me configure the NetBeans? My target is to debug the PHP code (see value of variables, trace the program etc). Thanks
  3. The 2nd part was well known to me. The first part cleared the picture. I am all set - thanks!
  4. What I try to do works well. Actually I am happy i could build a simple working PHP code and install on home Ubuntu server so fast. I am just bothered because it seems I don't understand the way the code works - after the form was submitted. So allow me to ask step by step: if we look at the do_it function mentioned before, which includes an HTML form, does the server ctually continues to execute the code lines after the lines which built the form? Or - should I, as the code writer, add a "terminate the code here" line after the form, because I know that once the code reached here, no point of further executing?
  5. i agree that "In all cases, it's a new copy of the script". i also understand that " There's no persistent MyScript.php process running in the background". perhaps what I miss is what is going on at the server side after the form was displayed at the client. I think I understand now that the PHP code continues running. In that case the picture is getting clear. i think I can change it by changing a SESSION variable after that point, and see the new value when re-entering the PHP code. I will give it a try. Thanks for the answers!
  6. But the script never actually reach the end. Consider the following php line that calls function, such as: .... $b=do_it($a1, $a2, &a3) if ($b==0) ..... ...... The do_it function is supposed to return a value and the PHP code is expected to continue to the following if condition. What will happen if the do-It function will creat a form on the client side and this form calls again the same PHP code? The previous PHP entity is waiting for the do_it function to return a value, yet a new entity of this PHP code starts to run. What did I miss?
  7. i use the session variables. I am just confused about how it works: when exactly are the variables discarded? when the user is pressing the submit button on the client side?
  8. What happen to the previous variables? are they kept? erased? sometimes the call to the HTML form is done from a procedure. There must be a stack that remembers where to return when the return command is executed.
  9. Something bothers me: I am writing a PHP code to implement "step by step" form. In order to do that, I copied a method which looks like: Program name: doit.php : if (!isset($_SESSION['para_stage'])) { ... first time to the code .... initialize variables ...display first form which calls doit.php when submit.....} else {already been to this code, variables are initialized, do what you have to do and recall doit.php ....} It works fine, but: isn't there a problem with calling the same program again and again from itself? isn;t it like a recursive, which means the stack will be used until overflow?
  10. If all form data is string, I understand I must validate at server side. I am not sure though what's the difference between ctype_digit() and is_numeric() and what is better/recommended.
  11. Does it mean there is no way to tell the HTML (without using Javascript) to accept only numeric values? Assuming no such way, I will prefer doing it on the server side. In that case, are there built-in functions that will help me to identify if the value of the field is 100% numeric, or integer etc?
  12. What is the best way to force a user to input numeric value into a form, with the following condition: Either the number is an integer (positive or negative or zero), or non integer but limited to the one digit behind the dot (e.g. 1.2 is valid, but 1.21 is not)? I know I can test it in the server side, but I prefer it to be on the form side. Can it be in the HTML level?
  13. With help I could manage creating separate files for HTML and CSS. Suddenly, I can;t see the CSS formatting any more. I can see the HTML text, but lost all effects of CSS. The files remained the same, so I have no idea how to debug it. Is there a way to debug such problem? How can I tell is the link to the CSS file works well? I use Geany as editor under Ubuntu - and compilation goes well. Does it mean the compilation is also looking into the CSS file, or is this link done only when the client is reading the HTML code?
  14. YigalB

    Error with CSS

    thanks, issue solved.
  15. YigalB

    Error with CSS

    I am trying to learn CSS, so I tool example from the web. It's easy because of the cut & paste, and all went well, untill I tried to move from CSS + HTMl in one file to seperate files. here is the code, and below the working. What is this warning about? I marked the relevant line with green color The code: !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>My first styled page</title> <link rel="stylesheet" href="mystyle.css"> </head> <body> <!-- Site navigation menu --> <ul class="navbar"> <li><a href="index.html">Home page</a> <li><a href="musings.html">Musings</a> <li><a href="town.html">My town</a> <li><a href="links.html">Links</a> </ul> <!-- Main content --> <h1>My first styled page</h1> <p>Welcome to my styled page! <p>It lacks images, but at least it has style. And it has links, even if they don't go anywhere… <p>There should be more here, but I don't know what yet. <!-- Sign and date the page, it's only polite! --> <address>Made 5 April 2004<br> by myself.</address> </body> </html> the error: line 5 column 3 - Warning: <link> inserting "type" attribute
  16. Thank you! But.... since I am a newbie..and I don;t know yet how to integrate the CSS: do I need a separate file for CSS? can you show me a one file solution?
  17. I would like to create HTML page with 10 buttons. Each button, when pressed, should execute a pre-defined PHP function. I know how to do it with forms, but I don't need any user input - just the button. I also need each button to have a pre-defined text on it, color and size. Some of them need to be grayed, until I finish the whole design - I plan to release the page with partial ability at first. I would appreciate simple example.
  18. The word "diode' should have been "side". I overlooked the speller. I think that XDebug looks good for me, I will install and see how it goes. Any advice which of these would be better for a newbie to debug PHP code?
  19. I am using 2 computers to develop my web site: Linux Ubuntu with PHP server on one computer, and XP machine as the client side. Basically things are OK, but it's not always easy to debug using printing messages. Is there a way to trace step by step and see the progress of the code, maybe even with visibility on the variables on the server diode?
  20. I was sure it's not allowed, because as far as I knew, PHP cares only of code between the PHP tags, so it would pass the HTML code as is because it's on the top of the file. I guess I needed confirmation. I am still learning the logic of the language. Sorry.
  21. If my functions are defined at the top of the file, wouldn't it cause their lines to appear on the web page, just because the PHP parser ignored them? Does it mean that the PHP knows to use the HTML lines inside the functions only when the functions are called by the main program?
  22. Can I combine also HTML code in PHP function? For example, can a PHP function include HTML form and the PHP code to handle this form? If yes, this will make my main code much more smaller and readable. If not, is there a way to define an "external macro" like, which allow me to replace pre-defined lines of code with short alias?
  23. At this stage - no, mainly because I don;t know yet how to handle the data base of the log in. At first stage, I will just ask user to fill name, and the data will be emailed to me for analysis. Later on, I will have to handle the login as well. As newbie, the site content is a big challenge already... Why does it matter?
×
×
  • 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.