Jump to content

skym

Members
  • Posts

    253
  • Joined

  • Last visited

Everything posted by skym

  1. How would look like PHP in Romanian?First it would be called PPT: PreProcesare de Texte cu legaturi.Second there would be no SQL, but LIS: Limbaj de Interogare Structurata.MySQL would also be then LISalmeu.And <br> would become <ru>. <?pptdefineste("constanta_nume","constanta_valoare");include_o_data("inc.functii.php");$legatura = lisalmeu_conectare('gazdalocala','utilizator','parola') sau mori('Eroare de conectare!');$interogare = "AFISEAZA * DIN tabel";$rezultat = lisalmeu_bd_interogare('baza_de_date',$interogare,$legatura) sau mori('Eroare la interogare: '.lisalmeu_eroare());atata_timp_cat($rand = lisalmeu_stoarce_asoc($rezultat)) { afiseaza $rand['coloana1']."<RU>"; }lisalmeu_inchide($legatura);......?> Could you translate this back into English (or PHP...) ?
  2. It's called 'className'. I found it athttp://www.javascriptkit.com/domref/elementproperties.shtmlWorks in IE/FF/Opera: <html><head><style type="text/css">.class_one { color: #0000FF; font-weight: normal; }.class_two { color: #FF0000; font-weight: bold; }</style><script type="text/javascript"><!--function changeClassOne() { document.getElementById('myDiv').className = 'class_one'; }function changeClassTwo() { document.getElementById('myDiv').className = 'class_two'; }//--></script></head><body><div id="myDiv">HELLO</div><br><input type="button" value="CLASS ONE" onClick="changeClassOne()"><input type="button" value="CLASS TWO" onClick="changeClassTwo()"></body></html>
  3. You can find a lot of scripts which might help you here:http://www.phpclasses.org/
  4. The problem is we don't know without the HTML source what is the upper fragment of that right border. Is it background-image:url('conbg.gif'); ? Then I think (like Dan said) adding the height should help.
  5. It would have been easier to also see the HTML source (idealy online), but try first to add border-right: 1px solid black; to #content
  6. Just put it in the PHP code you have shown us.
  7. Try this: <!-- search //--><tr><td><script type="text/javascript">var toempty = true;function empty(){if (toempty) {document.getElementById('thekeywords').value='';toempty = false;}}</script><?php$info_box_contents = array();$info_box_contents[] = array('text' => BOX_HEADING_SEARCH);new infoBoxHeading($info_box_contents, false, false);$info_box_contents = array();$info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),'align' => 'left','text' => tep_draw_input_field('keywords', '', 'size="10" id="thekeywords" maxlength="30" value="Search..." style="width: ' . (BOX_WIDTH-20) . 'px"') . ' ' . tep_hide_session_id() . tep_image_submit('button_quick_find.gif', BOX_HEADING_SEARCH) . '<br>' . BOX_SEARCH_TEXT . '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>');new infoBox($info_box_contents);?></td></tr><!-- search_eof //--> If it still doesn't work, see the source code of the page (in the browser) and post the HTML code for that particular form field.
  8. In addition to boen_robot's code, you might add a variable so that the field will not empty on a second focus: <script type="text/javascript">var toempty = true;function empty(){if (toempty) { document.getElementById('keywords').value=''; toempty = false; }}</script><input id="keywords" type="text" size="30" name="keywords" onfocus="empty()" value="Enter words to search..." />
  9. For the extra space above the logo use padding: 0px; for the body in CSS. The main contents seem to be ok now?
  10. <html><head><script type="text/javascript">function asignColor(){document.getElementById('txt').style.color="rgb(0,250,0)";}function getColor(){color = document.getElementById('txt').style.color;alert(color);}</script></head><body><div Id="txt" onclick="asignColor()"> This is text </div><br><input type="button" value="GET COLOR" onClick="getColor()"></body></html> But it might not be enough, since it doesn't return anything but only after a value for the color property is already assigned.
  11. Why don't you seek www.hotscripts.com or similar sites for free code?
  12. http://www.w3schools.com/htmldom/dom_obj_form.aspTry the onReset event. Some thing like<form action="..." onreset="yourfunction()">
  13. skym

    Background pictures

    #title { background: #000000 url("img/title.jpg") no-repeat center; color:#000000; height:100px; margin-left:100px; }
  14. I got it how it works (sincerely I never used to insert PHP files like this), the PHP file returns a javascript code, so<script type="text/javascript" src="online.php?so=1"></script>should work.
  15. online.php is really a PHP file?
  16. How about this:<script type="text/php" src="online.php?so=1"></script>
  17. I have the same opinion. I am not a beginner but when I have some trouble with CSS/JS/DOM I usually look into w3schools for references, and I often give links towards w3schools for these references on other forums. Soon it might be also a good place for me to start learning AJAX.
  18. I never had to install PHP5 yet, but it seems that "MySQL is no longer enabled by default":http://www.php.net/manual/en/ref.mysql.php
  19. skym

    Is there a

    I usually use the script found at http://www.dynamicdrive.com/dynamicindex16/requiredcheck.htmIt needs to know which fields are mandatory, but you can get inspired and make your own if there are too many fields in the form.
  20. See if it helps putting the javascript after the div, or make a function of it, something like: <html><head><title>title</title><style type="text/css">#js_enabled { display: none;}</style><script type="text/javascript">function collapse() {document.getElementById('js_enabled').style.display = 'block';}</script></head><body onLoad="collapse();"><div id="js_enabled"> This Content should only be seen whenever javascript is on.</div></body></html>
  21. yes, I knew about short 'if'.And about the value of the input, it does work for the "0" value, but not for the "FALSE" value.This is the output of my script:flag1: FALSEflag2: 0flag1 is a stringflag2 is a stringflag1 is false? noflag2 is false? yesSo "FALSE" is not recognized being FALSE, only "0" is.Ok, it's enough for today... I get back to the work I am paid for
  22. <a href="#nameofanchor">Part 2</a>...<a name="nameofanchor">Part 2...You might have learned this by yourself, just looking at the sources of those pages
  23. Dan> Why not? It does actually, I just tested.umekille78> You might also addini_set('display_errors', 1);error_reporting(E_ALL);at the begninning of your script, if it still doesn't show any warning.
  24. Made some testing: <?phpif (!isset($_GET['flag1'])) {?><html><head><title>title</title></head><body><form action="?" method="get"><input type="hidden" name="flag1" value="FALSE"><input type="hidden" name="flag2" value="0"><br><input type="submit" value=" SUBMIT "></form></body></html><?php} else { $flag1 = $_GET['flag1']; $flag2 = $_GET['flag2']; echo "flag1: ".$flag1."<br>"; echo "flag2: ".$flag2."<br><br>"; echo "flag1 is a ".gettype($flag1)."<br>"; echo "flag2 is a ".gettype($flag2)."<br>"; echo "<br>flag1 is false? "; if ($flag1 == FALSE) echo "yes"; else echo "no"; echo "<br>flag2 is false? "; if ($flag2 == FALSE) echo "yes"; else echo "no"; }?> It seems that:-With or without the quotes, the HTML form still sends a string, not a boolean.-PHP sometimes makes the casting automaticaly (like between strings and integers), but it doesn't cast the string "FALSE" to the boolean FALSE-PHP is casting automaticaly the string "0" to the boolean FALSESo it will work with <input type="hidden" name="flag" value="0">But I would use $flag = (bool) $flag; 'cause I just like it that way... Makes you look smarter
×
×
  • Create New...