Jump to content

skym

Members
  • Posts

    253
  • Joined

  • Last visited

Posts 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. 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.

  4. 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..." />

  5. <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.

  6. 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.

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

  8. :) 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 :)
  9. 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...