-
Posts
15,286 -
Joined
-
Last visited
-
Days Won
435
Everything posted by requinix
-
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"?
-
The offset is incorrect: $myoffset will be a page number like 1,2,3 when it needs to be a starting offset like 0,25,50. I suggest putting off building the query, or at least the LIMIT part of it, until after the pagination object is available - then you can use its calculations for the offset (in the offset() method). After you have the query, execute it and display the results however you want. Strictly speaking the pagination work is really just about getting the page number in the URL, getting links to navigate between pages, and adjusting the query's LIMIT accordingly. And you have that part.
-
Makes sense: there isn't actually any code in there to execute the query (which is supposedly contained in the $mysql variable), nor to display the results. Does the tutorial add that code later? And what does it say about the query? Because what you have in $mysql is incorrect.
-
Pulling values from a table using HTML form select option
requinix replied to basil60's topic in PHP Coding Help
It's very much a per-server thing, and you'll find that most servers only allow .php (and occasionally .php5) so that's the most reliable extension to use. However you can often add some configuration, even as just a regular user, that will allow it. -
Pulling values from a table using HTML form select option
requinix replied to basil60's topic in PHP Coding Help
The file is named "reviewparts.html" and that server isn't configured to execute .html files as PHP code. If you look at the source of the page you'll see the full PHP code - as if it weren't even executed at all. Try simply renaming it to "reviewparts.php". -
That would be trying to get the value of a property, such as $variable = $object->property;or $variable = $object->property->another_property;