-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
how to get the array contents and serialize data
requinix replied to new_member's topic in PHP Coding Help
foreach serialize() has a very specific set of purposes. You rarely ever need it. But on that note what you serialized was null, not an array, so there's something wrong there. Blah blah blah post some code. -
set the "images" thing in $entry to an empty array for each thing in $property, using $property_field as the key and $property_field_value as the value { if the value is not empty and it starts with "MEDIA_IMAGE_" and two digits { set $image_path as the "image destination" from $config, plus DS, plus the value if that file exists { add to the "images" thing that particular array of values } } }
-
You're still getting a parse error. Is it still an "unexpected So let's try this over again: 1. What is the exact and entire error message? 2. What is your current code? Don't forget about the tags I mentioned before.
-
When you say "the error" it makes it sound like you're saying you get the exact same error message but on a different line. That is not the case. Unexpected end generally means that you have a { somewhere that isn't closed with a }. Can you find where it is? Does it belong there?
-
Works for me. Why do you say it isn't being caught?
-
Anonymous class RFC is under discussion now
requinix replied to Hall of Famer's topic in Miscellaneous
38. 2/3rds majority for big changes to the language. I'm disappointed too. Noticed a few of the big names were among the opposed Archive -
C++/delphi socket TCP/IP to PHP - memcpy/move function in php
requinix replied to rmartyn's topic in PHP Coding Help
What are the values in the struct and what is the complete value of $message? -
Anonymous class RFC is under discussion now
requinix replied to Hall of Famer's topic in Miscellaneous
Meh. I've never needed anonymous classes. More interested in variadics and unpacking (though I'm not a fan of a couple of the choices made) and keywords as identifiers. There's also talk of automatically session_regenerate_id()ing on IP address change (no RFC for it) and I definitely don't like that. -
Got a <?php at the end there that doesn't belong. Please use tags when posting code.
-
php_network_getaddresses: getaddrinfo failed
requinix replied to KapaGino's topic in PHP Coding Help
What is the URL (the actual value) that you're passing to imagecreatefromjpeg()? -
C++/delphi socket TCP/IP to PHP - memcpy/move function in php
requinix replied to rmartyn's topic in PHP Coding Help
#1 is answered with pack() (which can accept more than one argument - you don't have to call it multiple times). #2 isn't really an issue because memcpy doesn't apply to PHP but it's probably answered, again, with pack(). How does $packed compare with that "UUUU..." binary string? bin2hex can help you read it. -
Are you sure that you passed an array of arrays to truncateWords? And not just, say, one single row?
-
You haven't shown any code since your first post. What do you have now and what is the structure of the file (if it has changed)?
-
$x++ is like saying $x = $x + 1. So $votes[ $vote['type'] ] = $votes[ $vote['type'] ] + 1;Now do you see where the "undefined index" comes from? You're trying to +1 a value in an array that doesn't exist. You need an isset() check to either +1 (if it already exists) or create it (if it doesn't exist yet).
-
Session Variables Being Partially Lost After Redirect
requinix replied to phdphd's topic in PHP Coding Help
Try calling session_write_close before the script exits. -
echo $date % 4;is much simpler than your subtraction and division. You know that's not random, right? It'll just cycle through the links in order. Today (the 23rd) would be the same image as the 19th, 15th, 11th, as well as the 27th and 1st.
-
There's really no sense in storing every single vote like that. Wouldn't it be a lot easier if you stored the type and the number of votes? Can even be an object like {"metallic":2,"pop":1}Oh, and you really should be using a database for this, because otherwise you need to learn about file locking to prevent votes from being lost if they happen simultaneously.
-
0. There's nothing to learn about stdClass. There's stuff to learn about objects in general. 1. Casting an object to an object doesn't change anything. 2. A scalar is a very simple data type; you can use them as array keys and they're easy to store basically anywhere. Numbers and strings. Arrays, objects, and resources are not scalar. 3. $obj->nested is an array. You're doing that in the code because you have some reason for doing that.
-
PHP radio buttons - 2 groups - need to clear both on select
requinix replied to digetydog's topic in Javascript Help
Then 1. Write some PHP (where you process the form) that validates them having only selected ones from the first two or one from the third. 2. Write some Javascript that will automatically deselect all from the first two groups if any from the third group is selected; also deselect all from the third if any in the first two are selected. Moved from Coding Help. Are you using a Javascript framework? Which? [edit] And what does the outputted HTML look like? -
It is not possible to get the results you're getting with what you've shown and described. Something is different. What is the exact code for your Model class and for the code having the problems?
-
You've posted a few snippets but nothing that shows them all together. What's the whole reproduce script? It sounds like you're describing $new_model = new Model; $user_info_select = $new_model->user_info(); $team_selection = $user_info_select['team']; echo $team_selection; // something $check_valid = $new_model->check_invalid_lineup($team_selection); echo $check_valid; // nothing
-
PHP radio buttons - 2 groups - need to clear both on select
requinix replied to digetydog's topic in Javascript Help
So of all those options only one is allowed? Name them all the same - like "educationsessions" instead of "educationsessionsN". -
How do You Echo a Different List Every Day, Automatically?
requinix replied to Fluoresce's topic in PHP Coding Help
0. Assume that your ID numbers in the database are uniformly distributed without many large gaps in the sequence. They very likely are. 1. Determine the highest ID number and subtract one. 2. srand() using today's date as YYYYMMDD. 3. Pick however many random numbers you want between 0 and that ID-1, then SELECT video FROM table WHERE id > the random number LIMIT 1 -
When dealing with URLs in your HTML, the only(ish) thing that matters is what shows up in the address bar of the browser. The easiest way to not care about that is to use absolute URLs: a leading slash. If the image is in the includes/ folder of your website (and your website isn't in a subfolder like http://www.example.com/subfolder) then
-
Phone number UK - Converting string to integer - retain digits.
requinix replied to Love2c0de's topic in PHP Coding Help
Yup.