-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Understanding oci_bind_by_name() and how array elements can be trusted
Adam replied to AFTNHombre's topic in PHP Coding Help
Oracle doesn't support "?" parameters -
You're syntax is wrong, remove the semi-colon in the options object. Should be: {content: "testcontent"}
-
If you're not easily finding a way, I would say it's because FB don't want you to. Branding will be a big thing for them.. Edit Just to add to that, by "finding a way" I meant through their API. If you're using the iframe widgets then you won't be able to access them with JS, because that would be cross-site scripting. I know they have a more scripted alternative (or something) but I don't know how they work, I've never really had to use them.
-
Understanding oci_bind_by_name() and how array elements can be trusted
Adam replied to AFTNHombre's topic in PHP Coding Help
In answer to your first question, it's because $val will only reference one variable at the point you execute the statement. That kind of answers you second question too, it would use "something else" in the statement. You're not binding to memory, you're binding to the variable. -
No it won't be fraud, although the access log would still have the request in it, even if they didn't hang around long enough for it to be sent to GA. I can't confirm this either way, but it's possible if the server's are intermittently not responding, that the request isn't being logged at all. I'm not too sure what to suggest kuvopolis, I would send FB the stats from your logs and keep a watchful eye for any issues.
-
Did you check the documentation? You can pass a "content" option to provide the content when you bind. The tool tip text is taken from the title, otherwise. You don't want to be putting HTML within a HTML attribute.
-
Yeah it only did it to me once. Other web sites were working fine whilst I waited as well, so it wasn't down to my network.
-
Actually, is the website you're talking about mediashindig.com? The first request took about a minute to load for me, but fter that it seemed fine cached or not. I'm guessing you're having intermittent lag problems..? Would explain the difference.
-
I guess it's possible that people are accidentally clicking the advert and then quickly closing it, before the request is sent to GA? Does your website ever hang while loading, again meaning the request never reached GA? Do you have any JS syntax errors in older/different browsers that could be breaking the site for a majority of users? I'm more inclined to trust FB's results over GA's, simply because GA is reliant on client-side scripting. I may not be right, but there's just a lot of different possibilities to check out before thinking FB are trying to defraud you. I would import a day's Apache access logs into a tool like AWStats and check for yourself.
-
Perhaps you had unknowingly white-listed the previous mail server or something? If you allow the user to provide the "From" header, then it's never going to match your mail server's domain (or your website's domain if they're different and you have a DKIM pass), and of course it wouldn't pass the SPF check. I'm no expert here though so someone else may say I'm wrong..?
-
Allowing the user to specify an "amount" of times to send the email is insane an idea. You're also opening yourself up to the possibility of being black listed. I can't think of any constructive reason to allow that anyway? To answer your original question, the "From" header can contain a name with an email in chevrons, just like your example: $headers = "From: Website name etc.. <" . $from . ">"; Obviously you could insert the user's name or whatever in there instead of a static string. Although you should know that the "on behalf of" text is added in because, basically, the email is claiming to be from somewhere it's not. You won't be able to get rid of it dynamically inserting emails into the from address. Edit The "Reply-To" header may be more what you're after?
-
You need to use AJAX to poll the server every x amount of seconds for new messages, then update the value of the JavaScript document.title property. The jQuery documentation has plenty of AJAX examples, but if you get stuck post your progress and we'll give you a hand. Edit I'm not too sure what you were referring to with the access across different files, but you shouldn't be refreshing the page. That will annoy your users immensely! As I said, use a client-side scripting (JS) to poll the server for the updated number and dynamically change it.
-
The next time you get this issue the circumstances will be different. It's not a magic fix, you need to understand the logic behind why it's not working. We've explained that, but you need to do a bit of research on multi-dimensional arrays.
-
I don't follow how this is supposed to work. When you say "directed", are you talking redirecting users to another site after they have hit yours?
-
Personally I don't see any reason to restrict your usernames so heavily. Sure I can see the point on systems like Linux where a space in a username would cause all kind of nightmares, but not for a PHP application where they will always be enclosed in quotes. Although I would always trim() the string first, to ensure the user doesn't register with a space by accident.
-
foreach requires an argument that can be iterated through, like an array or object. I'm guessing $_SESSION['cart'] is not being set as you're expecting. Try passing the $_SESSION array into var_dump to see what the cart key is.
-
getElementsByTagName('img') INSIDE a specific DIV
Adam replied to sblake161189's topic in PHP Coding Help
Really? That shouldn't happen. What mark-up are you using for the meta tag? <?php $html = '<html> <head> <meta name="description" value="foo" /> </head> <body> <div id="description">bar</div> </body> </html>'; $dom = new DOMDocument(); $dom->loadHTML($html); $description = $dom->getElementById('description'); echo $dom->saveXML($description); This echoes "bar". -
getElementsByTagName('img') INSIDE a specific DIV
Adam replied to sblake161189's topic in PHP Coding Help
I was going to suggest that actually, but I thought programming the traversal manually could be more beneficial to someone learning. Edit For reference, Xpath essentially just translates a query-like string into what you're trying to do now. Would be as simple as: //div[@id=description]//img which would return the same node list. -
getElementsByTagName('img') INSIDE a specific DIV
Adam replied to sblake161189's topic in PHP Coding Help
getElementsByTagName() returns a node list, which is why you're able to iterate through it with a foreach. getElementById() returns a single element. You need to call getElementsByTagName() on that element to get a node list of child image elements. -
We need a better understanding of what's happening currently. Can your server handle serving the results filtered and paginated already, or are you just working from some static HTML? I.e. have you already programmed the search engine in PHP or are you asking literally what needs to be done to have filters?
-
I literally had the 'not plugged in' thing happen to me once. My Nan called and asked me to come find out why the printer had "died"; "it was working yesterday". So after work I took quite a detour to go and have a look, and sure enough it wasn't flicked on at the switch - "uses electricity just like your hair dryer, Nan!" Get these kind of call outs every couple of weeks or so these days. Don't mind for my Nan of course, but she's started telling her friends now! I got a call the other day of her asking me to go round and take a look at Margaret's spreadsheet?
-
Get value from newly inserted row through form?
Adam replied to xwishmasterx's topic in PHP Coding Help
You can only have one auto incrementing column in a table, so mysql_insert_id will always return the right value. If it's not the auto incremented column you want, then you should already have the data available from when you built up the insert SQL. -
You're trying to get the number of affected rows before you execute the query...
-
Just above the IF add: var_dump(mysql_affected_rows()); Could be updating multiple rows.
-
Muddy_Funster where have you got the 'or die' from? Are we all looking at different code or something here? The last time I saw the insert query, it was being executing with: if (!mysql_query($insert_query, $connection)) { echo "Query failed: $query<br />" . mysql_error(); } Have things changed? blepblep you need to start providing the full code you're using when you get an error (not the HTML, just relevant to the query). When you're trying to debug something like this, the code is often changed and experimented with, so when you get an error we're assuming the code is what it was 10 posts ago, when it's possibly now different and the cause of the error.