-
Posts
15,266 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
How to send Mail from Wampserver ( localhost )
requinix replied to cadamuro's topic in PHP Coding Help
OP is advertising demonstrating their video about setting up sendmail on Windows. -
How to send Mail from Wampserver ( localhost )
requinix replied to cadamuro's topic in PHP Coding Help
Why did you delete all the comments in the sendmail.ini!? -
How can I validate a URL to make sure it includes a tld?
requinix replied to MorbidEntree's topic in PHP Coding Help
It's because end() wants to modify internal information about an array, so it needs to be passed a variable and by reference. If the function returned an array by reference, that would work too. A combination of strrpos and substr will work for a one-liner too. -
How can I validate a URL to make sure it includes a tld?
requinix replied to MorbidEntree's topic in PHP Coding Help
ICANN/IANA also maintains a list of literally the top-level domains. Meaning it lists "uk" but not "co.uk". Doesn't include the IDN versions of the xn-- labels but that's not difficult to deal with in code. Keep in mind that "foo.bar" is a valid domain name - a user could put forward even the slightest bit of effort to circumvent any sort of general-purpose domain name verification you may put in place. -
Use radio buttons instead of checkboxes.
-
Your serialize methods aren't doing anything with $regList, so that information will get lost during serialization. Drop the Serializable interface and its two methods and let PHP do what it normally would do. Serializable is only really if you want to change how serialization works.
- 5 replies
-
- serializable
- singleton
-
(and 2 more)
Tagged with:
-
What is the code for RegistryClass::serialize and why aren't you using just serialize()? "__PHP_Incomplete_Class" means PHP couldn't load the class named. Which is SiteNavigation. Are you sure the autoloader is set up properly and gets installed before the call to unserialize()?
- 5 replies
-
- serializable
- singleton
-
(and 2 more)
Tagged with:
-
Solved.
-
I think it's fine: PDO is about databases and this is a database forum. In here or in Coding Help would probably be alright either way.
-
Do you still have the PM I sent you from last time? I did the same thing again.
-
how i can getting xpath address of a string in html code?
requinix replied to mikhak's topic in PHP Coding Help
Okay, so can you at least say the entire element's value is "YES"? //*[.="YES"]You should also consider actually learning XPath. -
how i can getting xpath address of a string in html code?
requinix replied to mikhak's topic in PHP Coding Help
Is it the only in the document whose value is "YES"? Then //p[.="YES"]Which is, conveniently, an XPath "address" to the node. -
how i can getting xpath address of a string in html code?
requinix replied to mikhak's topic in PHP Coding Help
Find the node using whatever you want, then call getNodePath(). Or are you trying to violate causality by using the path to the node to get to the node in the first place? -
What is the code you have for the that does not work?
-
Do not post sensitive things like API keys to a public forum. I've removed it for you this one time as a courtesy so be more careful in the future. 1. I don't know what XML you're looking at, but the one I'm looking at doesn't have things like location/city or current_observation. 2. You must do some work with $city before you stick it in the URL. Do some simple validation and then use rawurlencode() when putting it in the URL. 3. You are using a loop for the current_observation. If there is more than one then your $output will be messed up because you keep overwriting it each time through the loop. 4. json_encode() does not output anything. You have to echo the return value yourself. 5. $output[0] is just the time. Or the first character in the error message. 6. Outputting $output[0] will (likely) not be valid JSON. Use json_encode(), output the return value, and don't output anything else. 7. That HTML string is not valid JSON. Figure out another way to show an error message.
-
So what changed since yesterday? Because if it worked yesterday and not today then something did change.
-
It'll be easier to help you with the code you have than to come up with something from scratch. What's your code so far, and exactly what kind of problem(s) are you having with it?
-
Compare the two: $output['data']['502438129'] $output['data'].$testThey don't look similar, right? You'd expect them to look similar, right? If $test has the value '502438129' then simply replacing the string with the variable leads you to $output['data'][$test]
-
Right. I was thinking more of the exact output. And while I'm at it, can you use var_dump() instead?
-
What does it show if you remove the if?
-
Alright. So what is your question about error handling? What's not working? And can I assume you're aware of the syntax errors in your code? And a few other errors...
-
Your character encoding settings are not consistent. Make sure that - Your HTML pages are using UTF-8 because they do not by default; use a and/or configure your server and PHP code to return the UTF-8 encoding - Your database has utf8 as the default encoding; a SHOW CREATE DATABASE will the encoding - Your table is using the utf8 encoding; a SHOW CREATE TABLE will show the encoding - Your table columns are using the utf8 encoding; if your table is but your columns are not then a SHOW CREATE TABLE will show it - Your database connection is using the utf8 encoding; for MySQL you have to pay attention to both the server and client settings Missing any one of those can cause the problem you're seeing.
-
What is your question about error handling? What's not working? And when you answer, post your code too.
-
Well, you need to decide which of those you want. The first is self-contained to your application, but someone has to go to it before they can see their "bookmarks" - typically called "favorites" instead, to avoid confusion. The second means the user has a link in their browser they can click from anywhere, but if a user has a lot of bookmarks then that could be awkward for them to deal with. Note that this isn't a technical question. It's about what your users need and want to be able to do.
-
Before getting to your problem... which I haven't been able to decipher yet... What is a "bookmark application"?