-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
What is the HTML for the CSS ? Are you accidentally not referencing dev.domain.com?
- 1 reply
-
- virtualhost
- apache
-
(and 1 more)
Tagged with:
-
Sorting multi-dimensional arrays of different length
requinix replied to Big_Pat's topic in PHP Coding Help
Since we both agree the problem is you're storing times as strings, how about converting them into something that isn't a string? Like a number of seconds. -
That point needs emphasis: it contains exactly everything in the URL starting with the path. That means it includes the path, "filename", and the query string. And whatever else I may decide to type in there. What you're looking for is REQUEST_FILENAME or SCRIPT_FILENAME. That's an actual file. [edit] Are you copy/pasting this code in all the files? Use the __FILE__ constant instead. $last_modified = filemtime(__FILE__);
-
You have to bind to every column returned. So perhaps you're saying you don't actually want all the columns returned?
-
Those leading characters are the UTF-8 BOM. How is this file created? Making sure that doesn't include the BOM is the easiest way to fix this.
-
E_Warning and paths revealed...
requinix replied to robertboyl's topic in PHP Installation and Configuration
The relevant setting is display_errors. That should most definitely be off. Opinions on error_reporting vary (I believe you should include all errors). Development environments can do whatever they want: show errors on the page, log to a file, doesn't really matter so long as the developers can still get their work done. Production environments should not display them but log errors someplace, like a log file (as happens by default) or some reporting service. Because you should know when errors occur. -
Sorting multi-dimensional arrays of different length
requinix replied to Big_Pat's topic in PHP Coding Help
Sounds like your database is set up in a weird way. You're not putting times on the individual tracks? I don't know your needs but that's probably the best place to put them (if you do record tracks, otherwise albums are the next step up). If you want to get the total time for a thing then you do a query that totals it up for you. As for the totaling I'd store the times in seconds. Fractions of a second, if you want that much detail. From there it's very easy to "reformat" the seconds into HH:MM:SS. -
Then you should find yourself a couple PHP+MySQL tutorials. You don't have to get very far: just enough to understand how to get stuff from a table. Do make sure you find something that uses PDO or mysqli - none of the mysql_* functions. Quick question though. Do you want this to be a random quote thing? Or display a specific quote on each day of the year? Random quotes are easy to do and don't restrict how many quotes you can keep (but of course the more quotes you have then the less likely you'll see the same quote twice in a short timespan).
- 3 replies
-
- javascript
- php
-
(and 1 more)
Tagged with:
-
That "date" column is an actual DATE-type column, right?
-
Glad to hear you switched. Do you have a database too? That's the best place to store these quotes.
- 3 replies
-
- javascript
- php
-
(and 1 more)
Tagged with:
-
wsdl2php Where WSDL has elements with '.' in them
requinix replied to mrosenello's topic in PHP Coding Help
I think the WSDL is saying that option.list is an array of elements (the second class), but it does it in a fairly roundabout way so maybe that's why wsdl2php thinks there's two element definitions. Otherwise it really is a set of elements contained within a parent , and you'll just need to create two classes for the two entities (but with different names of course). -
It's okay. I shouldn't be telling you not to use different fonts, actually: they're there to be used after all. I'd take an unusual approach to this: sort the checkbox array, implode() all the values into one string, then look that up in an array. $checkboxes = (array)$_GET['checkbox']; sort($checkboxes, SORT_NUMERIC); $checkboxstr = implode(',', $checkboxes); $ids = array( '1' => 1, '2' => 2, '3' => 3, '1,2' => 4, '1,3' => 5, '2,3' => 6, '1,2,3' => 7 ); if(isset($ids[$checkboxstr])) { $id = $ids[$checkboxstr]; } else { // invalid combination of checkboxes }
-
One = is assignment, two ==s is comparison. if ($checkbox[$i]== '1' && $checkbox[$i]== '2'){ $sql="SELECT * FROM result WHERE result.result_id = 4";} elseif ($checkbox[$i]== '1' && $checkbox[$i]== '3'){ $sql="SELECT * FROM result WHERE result.result_id = 5";}Next time, don't fiddle with the formatting of your post. Makes quoting awkward. Do use [code] tags around your code. [edit] Other things: 1. header() will not stop your script. If you use it to redirect, exit; or die; immediately after. 2. else blocks are optional. If you don't need one then just leave it out. 3. You have an extra pair of {}s around your loop. It's not bad per se, just unusual and potentially confusing. 4. Only the last checkbox[$i] (with a value 1-4) will matter. Everything before it will be overwritten each time through the loop. Code that does this probably has some fundamental problem, like there only being one actual item or not putting something important, like output, inside the loop as well. 5. What happens if none of the checkboxes (I presume they were) were checked? Or something not 1-4? Even if it's not supposed to happen you should try to account for it. If you're not sure what to do you can redirect to the previous page. 6. Your HTML is very invalid.
-
[function.getimagesize]: failed to open stream error
requinix replied to Q695's topic in PHP Coding Help
Where's the third print_r() coming from? It's the second time it dumps out $_FILES but you only do it once in that code.- 7 replies
-
- getimagesize
- image handeling
-
(and 2 more)
Tagged with:
-
The paths shouldn't have a leading slash. They should always be absolute. If you want something relative to the root web directory (E:\xampplite\htdocs in this case) then use paths like include $_SERVER["DOCUMENT_ROOT"] . "/includes/footer.php";
-
wsdl2php Where WSDL has elements with '.' in them
requinix replied to mrosenello's topic in PHP Coding Help
The class names themselves don't matter so you can rename them to whatever you want (as long as you get all the references). Multiple classes? Delete the extras. Kinda sounds like wsdl2php isn't smart enough to do what you want it to do out of the box. But you're only generating these classes once, right? Generate them and tweak the results. -
[function.getimagesize]: failed to open stream error
requinix replied to Q695's topic in PHP Coding Help
Then I'll go with the reply I was going to make before I saw the repeated print_r(): There's no way you're getting that error and the code is working. If that error occurs then getimagesize() will completely fail. There's something else going on.- 7 replies
-
- getimagesize
- image handeling
-
(and 2 more)
Tagged with:
-
[function.getimagesize]: failed to open stream error
requinix replied to Q695's topic in PHP Coding Help
The first print_r() is happening twice. There's some code you haven't shown us. A loop, perhaps? [edit] Cut to the chase. Did you move_uploaded_file()? That moves the file. It's not there anymore.- 7 replies
-
- getimagesize
- image handeling
-
(and 2 more)
Tagged with:
-
bind_param() needs a variable reference for the second argument. It's not as simple as just using an array. Example: $arr = array(''); $arr[0] .= 's'; $arr[] =& $strId; $arr[0] .= 'i'; $arr[] =& $intFoo; $arr[0] .= 's'; $arr[] =& $strBar; call_user_func_array(array($stmt, 'bind_param'), $arr); // the magic happens here call_user_func_array
-
In every call to fwrite().
-
Don't remember if it matters. Sure, try it. $info = $soapClient->__call("SubmitMinimalFullSellerLead", array('UserID' => 'UserID', 'Password' => 'Password', 'LeadData_Required' => (object)$array, 'LeadData_Optional' => new stdClass()));
-
What is an example string (preferably one with unusual characters) and the bin2hex($str) of it?
-
Hashes are not random. If you want an actual random string of letters and numbers then do like Joshua F showed and actually make a random string.
-
And your code would be what?
-
Is this possible? [ Javascript quote of the day - 365 days ]
requinix replied to JesseToxik's topic in Javascript Help
Actually yes. I take it you don't have PHP or some other server-side programming language?- 2 replies
-
- javascript
- days
-
(and 2 more)
Tagged with: