-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Looks an awful lot like http://superglossary.com/ !
-
Yeah it's pretty straight forward. First define a variable you can switch between odd/even (true/false): $alt = 0; Within the loop echo the right class name: <tr class="<?php echo ($alt) ? 'staff_o' : 'staff_e'; ?>"> Then before you close the loop switch the variable: $alt = ($alt) ? 0 : 1;
-
Hi guys. I was just wondering what your thoughts are on PHPTAL? I'm considering using it for a new project. Adam
-
I'll be honest, it sounds like there should be a better way to do it. Perhaps you'd need to use the DOM for more advanced functionality? How did you solve it?
-
Why don't you just pass the item ID and remove the node using SimpleXML?
-
I'm not sure to be honest. ->asXML() doesn't have any formatting options so I'm not sure you'll be able to. They do mean the same thing though, why do you need it changing?
-
2 problems, why won't alert box work and why won't image change?
Adam replied to heldenbrau's topic in Javascript Help
It didn't work before because the value of the .style.background property varies between browsers; so you can't do a straight comparison. The indexOf() method looks for the "minus.png" string within the backgroundImage property. If it's found you know the current image is the minus, so you can set it to the plus - else set it to the minus. Creating a variable for the object just makes it easier to read. -
I think you need to uncomment the drop down and pass an actual font name..?
-
2 problems, why won't alert box work and why won't image change?
Adam replied to heldenbrau's topic in Javascript Help
Try this: function toggleBg(obj_id) { var obj = document.getElementById(obj_id); if (obj.style.backgroundImage.indexOf('minus.png') != -1) { obj.style.backgroundImage="url('/images/plus.png')"; } else { obj.style.backgroundImage="url('/images/minus.png')"; } } -
That's because the browser's trying to render it as HTML, view the source.
-
2 problems, why won't alert box work and why won't image change?
Adam replied to heldenbrau's topic in Javascript Help
That will break in almost every other browser than Firefox though, as different browsers will add their own default values. You need to use .style.backgroundImage to only return the URL of the image. -
I'm sorry but your description is a little confusing, could you give an example of the text files before and after?
-
2 problems, why won't alert box work and why won't image change?
Adam replied to heldenbrau's topic in Javascript Help
Okay, what's the remaining problem? -
I think it's just .execCommand('fontName', false, null) ..?
-
2 problems, why won't alert box work and why won't image change?
Adam replied to heldenbrau's topic in Javascript Help
.. And the alert is never shown? That suggests the function is never actually being called; which after looking appears to be a syntax error. You're missing a closing bracket: -
What have you tried so far, and why does it need to use exec()?
-
I know, I'm thinking though something that $FechaMin echoes out could be the problem.
-
2 problems, why won't alert box work and why won't image change?
Adam replied to heldenbrau's topic in Javascript Help
Can you show the code were trying with the alert in the toggleBg() function? -
As I touched on before, the source of the PHP is never shown to the user. When the user requests a PHP page, it's parsed by the PHP engine and the resulting HTML passed back; not the PHP code itself. No problem
-
I wouldn't recommend following just a single tutorial for something like this. If security is your main concern, then you should read up on on it separately. Once you have a good understanding of it in web applications, start following a tutorial on how to create a login system, adding in your own security. Don't just follow that one tutorial though, for each part of the process look up alternative methods, because the tutorial's way isn't necessarily the best way (in-fact 90% of the time it probably isn't). The problem with tutorials like that is they often teach you bad habits, by using outdated or deprecated code. I'd also advise you to look up any functions you've not encountered before in the PHP manual, you'll probably learn a lot more doing that.
-
$str = '<?xml version="1.0" encoding="utf-8"?> <data> <item ID="30001"> <Company>Navarro Corp.</Company> </item> <item ID="30002"> <Company>Performant Systems</Company> </item> <item ID="30003"> <Company>Digital Showcase</Company> </item> </data>'; $xml = new SimpleXMLElement($str); foreach ($xml->children() as $node) { // right now $node contains the SimpleXMLElement // but you can return it as a string with ->asXML() echo $node->asXML(); }
-
Do you want to return the XML as a SimpleXMLElement object, or just as a string?
-
Yeah that's right. So the image is broken? That'll explain why file_exists() was returning false..
-
Yeah there's no problem with having those details in your code; the PHP source isn't displayed to the user. Just be careful of who you give access to your file system. Also a good security measure though is to store them in a file outside of the publicly accessible directory, i.e. not within htdocs / public_html / www - which ever name for it your web server is using.
-
That function simply disables a button, changes the value, then reverts it back after 1.75 seconds (just 'oneTime'). Do you want it to do that 15 times? :s