![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
LLLLLLL
-
Posts
306 -
Joined
-
Last visited
Posts posted by LLLLLLL
-
-
No, it was not aimed at you. It was aimed at the idiot who told me there was no passing by reference who made me start the thread. He sent me to a couple sites that made things unclear. I shouldn't have posted.
Also, I disagree with your premise, however. Every language offers this feature and it's there for a reason. There are times when you need to modify a variable in a function.
-
OK. I think maybe some server administrator just doesn't know what he's talking about, then.
I don't have any call-time references (I assume this only means where & is in front of the calling function parameter, rather than only in the function declaration). I think this server admin doesn't know much about PHP.
-
But what if I can't have that function return a variable?
-
If this was covered elsewhere on the forums, I apologize but search isn't working at all. So I'll ask potentially again...
function some_func( &$var ) { $var++; } $var = 1; some_func( $var ); // var is now 2
Now I see that 5.4 has removed passing by reference? This is a little crazy, frankly, since all other languages have this feature and developers need it. Regardless, what is considered the standard way of writing this type of function now that it's no longer possible to use my example code here?
-
I ALREADY PROVIDED THE SOLUTION.
If you want to show me up, that's fine. I'm not following this post. Congrats on your arrogance. Please calm down.
-
I already provided the answer. Don't be surprised that I don't need help when I've already provided the solution.
Please calm down.
-
1064. Anyway, the solution is:
update status as ds join orders_products op on ds.order_prod_id = op.id join orders o on op.order_id = o.id and o.guid = 'someGUID' set ds.status = 99
-
Getting error 1064 on this. I don't really understand why:
update ds set ds.status = 99 from status ds join orders_products op on ds.order_prod_id = op.id join orders o on op.order_id = o.id and o.guid = 'someGUID'
Trying to update fields in the "status" table when I know the GUID of an order.
Relationship:
ORDERS table
ORDERS_PRODUCTS table (fk to ORDERS)
STATUS table (fk to ORDERS_PRODUCTS)
What am I missing?
-
I don't understand. Can you clarify why it works on one site but not mine?
This is all the relevant code:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="stylesheet" type="text/css" media="screen and (max-width: 740px)" href="assets/css/style_m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 741px) and (max-width: 900px)" href="assets/css/style.css" />
-
No, the file path was not wrong.
Looks like the problem was actually and (max-width: 900px) since my screen was wider than that. Confused why the original site works with that same query, however.
-
I'm trying a basic CSS media query. I added these two lines to my file... they are essentially copied from another site, with the href being different and referring to actual files on my server.
<link rel="stylesheet" type="text/css" media="screen and (max-width: 740px)" href="assets/css/style_m.css" />
<link rel="stylesheet" type="text/css" media="screen and (min-width: 741px) and (max-width: 900px)" href="assets/css/style.css" />
But this doesn't work for me at all. The result on my site is that the elements on the page act as if no CSS file is declared at all. Is there something more that I need to do?
-
I need the metadata from the file. That's what this thread is about.
-
Yeah, I saw that. Was hoping for something more built-in.
-
I have found some info on manipulating PDF documents here http://www.php.net/manual/en/ref.pdf.php and elsewhere, but I can't get exactly what I need.
What's the easiest way to get metadata (author, title, keywords, etc.) from a PDF document? Basically I want the opposite of
http://www.php.net/manual/en/function.pdf-set-info.php
Is there an easy "get info" function somewhere?
-
Yes , I thought about that right before going to sleep last night... just set it directly.
Appears to be it.
-
Marking as solved because I have enough info. It does seem like more info is needed in general documentation, and/or testing of the order of events. I don't have time to look into these things right now.
But at least I know that it hits onclick because there's a spec for it.
-
Player is an audio element
var player = document.createElement( 'audio' );
player.setAttribute( 'volume', default_volume );
-
I have an HTML5 audio player that gets created dynamically. Elsewhere the variable is declared:
var default_volume = 0.8;
Then I set the volume for the player ...
player.setAttribute( 'volume', default_volume );
Debugging shows default_volume is 0.8, but once set, "volume" is changed to 1
Why is there rounding? How can I make it maintain the value I chose?
-
Cool, as long as it is documented. I just wanted to know what it was doing it. Clearly "onclick" isn't the way to go.
I wasn't clear from that DOM doc, if both onclick and onsubmit are declared, what gets processed first?
-
Right, like I said, browsers seem to do this. But is it documented somewhere? Is it just our imagination?
-
There are lots of form-validation discussions revolving around onsubmit versus onclick. This is not one of them, but it's related.
I noticed something like this:
<form method="post"> ... <input type="submit" onclick="return validate_form()"> </form>
So there's no "onsubmit" validation for the form, but the button's onclick is calling the function instead. This isn't the recommended way to do this validation, so it is said, because someone can press "enter" in another input field of the form, thus bypassing the "onclick" event of the button.
But that's where my question comes in....
1) I am pressing enter in a text box
2) The "validate_form()" function is getting called anyway!
Why would that be? Is there now built-in logic to some browsers to do this? Any other reason?
Chrome's call stack shows that the onclick handler initiated the call to the function, but I pressed enter in a text box. So why did that handler get called? (Chrome, IE, all the browsers do this.)
-
"Before any output" - very good! That helps me.
So I will pretty much modify my code as I stated; the line won't be the very top of the file, but it will be very close.
Thanks!
-
So, I understand if I add the following, that other domains can use the script via AJAX:
<?php header("Access-Control-Allow-Origin: *"); ... code that does something
My question is: does this line have to be at the top of the file? Does it matter where this line is located?
I was thinking of doing something that lets a user configure their software's "allowed" domains, so, something like this:
<?php $urls = db::some_query_to_see_allowed_origins(); if ( !empty( $urls ) ) header("Access-Control-Allow-Origin: $urls"); ... code that does something
Would something like this work? I don't know at what point the "cross-domain" errors occur, so I don't know where the header line needs to be.
-
I have already corrected the issue by turning off backstretch on the offending page, so i'm not sure how you can reproduce it. At this point it's an issue with backstretch anyway.
I don't see a reason to post a link to my client's working site.
Trying to search returns an error.
in PHPFreaks.com Website Feedback
Posted
Search is not working at all for me. No error.