Lumio
Members-
Posts
679 -
Joined
-
Last visited
Never
Everything posted by Lumio
-
You have to escape quotes in quotes. "here is a quote \"" So <?php mysql_db_query("db", "UPDATE post SET pagetext = REPLACE(pagetext,\"<!--QuoteBegin-\",\"[quote]\")", $link); ?>
-
Get all functions, classes and methods, without a selfmade parser?
Lumio replied to Lumio's topic in PHP Coding Help
Hey thank you! -
Yes. I already found out, why it didn't work. I had to add an event with another property. Now this function helped me: function addEvent(el,ev,fn) { if(el.addEventListener) el.addEventListener(ev,fn,false) else el.attachEvent('on'+ev, fn) }
-
Hi! I list the categories of a web-app of mine with many Dropdown-boxes. It works great with Firefox and so on. But not with IE. So I do it like this: <?php //this is javascript function addCatBox(layer, parent) { if (parent == 0 && layer == cat_layer) return false; else if (parent == 0) { for (var i=(layer+1); i<=cat_layer; i++) { var elm_del = document.getElementById('catDropBox'+i); if (typeof elm_del != "undefined" && elm_del != "null") document.getElementById('articlepage_create_cat').removeChild(elm_del); } cat_layer = layer; return false; } if (layer < cat_layer) { for (var i=(layer+1); i<=cat_layer; i++) { var elm_del = document.getElementById('catDropBox'+i); alert(elm_del); if (typeof elm_del != "undefined" && elm_del != "null") document.getElementById('articlepage_create_cat').removeChild(elm_del); } cat_layer = layer; } cat_layer++; makeRequest ('/ajax/article_categories.php?parent='+parent, writeCategories); } function writeCategories() { if (http_request.readyState == 4) { if (http_request.status == 200) { var xmldoc = http_request.responseXML; var cats_node = xmldoc.getElementsByTagName('categories').item(0); var cats_parent = cats_node.attributes[0].nodeValue; var cats = cats_node.childNodes; var elm_cat = document.getElementById('articlepage_create_cat'); //some code... var newSelection = document.createElement('select'); newSelection.setAttribute('name', 'catDropBox'+cat_layer); newSelection.setAttribute('id', 'catDropBox'+cat_layer); //THIS HERE SHOULD CALL THE FUNCTION addCatBox WHEN THE SELECTION //CHANGES. IT WORKS ON FIREFOX AND CAMINO AND SO ON //BUT _NOT_ ON INTERNET EXPLORER 7 newSelection.setAttribute('onchange', "addCatBox("+cat_layer+", this.value);"); //...some code var bol_error = false; for (var i=0; i<cats.length; i++) { if (cats[i].nodeType == 1) { if (cats[i].nodeName == 'cat') { //... some code that defines cat_id and cat_name var newOption = document.createElement('option'); newOption.setAttribute('value', cat_id); var newOptionVal= document.createTextNode(cat_name); newOption.appendChild(newOptionVal); newSelection.appendChild(newOption); }else if (cats[i].nodeName == 'error') { bol_error = true; cat_layer--; break; } } } if (bol_error === false) { elm_cat.appendChild(newSelection); } //... some code } } I don't know, why Internet Explorer does not call addCatBox.
-
for sure...: <?php function encodeDec($s) { $n = ''; //convert every sign into hex. for ($i=0; $i<strlen($s); $i++) $n .= str_pad(dechex(ord(substr($s, $i, 1))), '0', STR_PAD_LEFT); return $n; } function decodeHex($s) { $n = ''; //convert every hex into dec and into a sign. for ($i=0; $i<strlen($s); $i+=2) $n .= chr(hexdec(substr($s, $i, 2))); return $n; } $yourPassword = yourPasswordFunction('hello world'); $yourPassword = encodeDec($yourPassword); echo 'Encrypted+converted in hex: '.$yourPassword; $yourPassword = decodeHex($yourPassword); $yourPassword = yourPasswordDecryptFunction($yourPassword); echo 'Decrypted: '.$youPassword; ?>
-
try to use chmod or something. And also put the Permission of that folder to 777.
-
The ^ sign tells to ignore the following state. But I can't really help you with that
-
Create an extra directory, and for every file you create a txt or something where you write the count of all votes and the actual grade. For example: 10|5.5 That means that there voted 10 persons and all in one the file has the grade 5.5 so 5 stars and a half.
-
Read this: http://www.php.net/set_error_handler That may help you.
-
Hi My problem is, that I don't want to allow to overwrite existing files I solved that with RewriteCond %{REQUEST_FILENAME}\.* -f But now also RewriteRule does not work. My .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME}\.* -f RewriteRule ^(.*)$ index.php RewriteRule ^([\w\d]+)/([\w]+)$ index.php?file=$1&action=$2 When I try to open mydomain.com/test/rewrite (does not exist) it does not work. Why? greetings
-
[SOLVED] start a PHP scroll bar from the bottom when page loads
Lumio replied to allan8904's topic in PHP Coding Help
Javascript. not PHP. Use scrollBy and/or scrollTo -
what is in $_POST['ship_date']? Maybe not that, what you need
-
Did you do some debuging?
-
header('Location: thanks.html'); exit;
-
Do you have access to your php.ini?
-
[SOLVED] Very quick question - opposite of ISSET?
Lumio replied to delphi123's topic in PHP Coding Help
3 posts and all the same. hmm... okay You can also use empty. But empty is a little bit different... var_dump( empty("0") ); var_dump( empty("") ); both are true. -
maybe you directory is not writeable. Try error_reporting(E_ALL);
-
[SOLVED] Very quick question - opposite of ISSET?
Lumio replied to delphi123's topic in PHP Coding Help
You mean, that you want to ask if it is not set? Like that: <?php if (!isset($var) && !isset($var)) { //code... } //or if (isset($var) === false && isset($var) === false) { //your code } ?> -
Please use [.code]Your code[./code] (without dots) for your code. Looks like that <?php echo 'And php'; ?> I don't want to help you with that until you did that Sorry.
-
Maybe it only shows you the cached page.
-
Please use [.code]Here is your code[./code] (without dots) for viewing code. At first... your $post_vars and other variables are not defined. The most functions in php are lowercase... so error_reporting To remove a variable use unset()
-
SSL: As you can see is SSL good for security.
-
use header() for that.
-
If you mean a web-based GUI it is fine