-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Not quite sure what you're asking there, but you should always leave an alternative for users with JS disabled. On the form tag you can use the onsubmit attribute to call a function that will return true (and submit the form normally), or false (and the form won't be submitted): <form (...) onsubmit="return submitUsingAjax();"> That way if the user doesn't have JS enabled, the form will submit like normal. If JS is enabled the submitUsingAjax() function will be called and the result determines whether or not the form should be submitted.
-
You can do that using the SimpleXML extension: $url = 'http://mobsters-fb-apache-dynamic-lb.playdom.com/mob_fb/get_hit_list?user_id=100000952273457&target_id=100000556624340&level=300&auth_key=cb07c7575b38df48d82dd53619385faa884db5a2'; $xml = new SimpleXMLElement($url, null, true); foreach ($xml->xpath('/outer/xml/entry') as $entry) { if ($entry->amount > 4100000000) { echo 'Targeted user: ' . $entry->target_user->user_id . '<br />'; } }
-
You'll need to use a third-party payment gateway to process the transactions, which will cost. To make the payment secure you'll need to use SSL, and the certificate for that will also cost I'm afraid.
-
How did you solve this? I'm not sure if you know but "=" in JavaScript means 'takes the value of', "==" means 'equal to'. Unless this is fixed your IF expressions won't evaluate the way you think.
-
Did you try searching on Google..? http://www.google.co.uk/search?q=javascript+confirm+leave+page
-
count the number of multiple showing variable in a column
Adam replied to Ryflex's topic in PHP Coding Help
You don't have to assign it an alias. By fetching the data with mysql_fetch_array you could have used either $count_array[0] or $count_array['count(upgrading)'] to access the value. -
count the number of multiple showing variable in a column
Adam replied to Ryflex's topic in PHP Coding Help
Have a read up on how to use mysql_query right - you need to use it in conjunction with mysql_fetch_array. -
count the number of multiple showing variable in a column
Adam replied to Ryflex's topic in PHP Coding Help
select count(upgrading) from table_name where upgrading = 1 -
count the number of multiple showing variable in a column
Adam replied to Ryflex's topic in PHP Coding Help
Just run a query like: select count(column_name) from table_name where column_name = 1 -
count the number of multiple showing variable in a column
Adam replied to Ryflex's topic in PHP Coding Help
'Column' can have several meanings, can you be more specific? -
Oh right, sounds like you don't want to encode the hash then. You should be able to just use the example in the other post, but replace .search for .hash.
-
I imagine you don't want the hash value to be "schedule&class=history" though..? If you want 'node' to equal "home#schedule" you'll need to encode the hash: index.php?node=home%23schedule&class=history Now you're able to return the query string as you expect it with window.location.search. This post contains an example of how you can return a specific parameter from that.
-
preg_replace problems - trying to convert parts of submitted text to URLs
Adam replied to Flipperbw's topic in Regex Help
Have you tried Google..? http://www.google.co.uk/search?q=php+regex+turn+urls+into+links -
You mean at the beginning of the file name you're inserting? That won't work; mysql_insert_id is only available after the query has been executed.
-
Just last night - she was great. But no matter what opinions ppl have, i want younger guys to know that there IS an alternative, you dont have to be someone your not to impress trashy girls in your school/office, you can have the best looking girls anytime you want and i must emphasize THE BEST LOOKING GIRLS.....its the upper class way, look at American psyco movie - upper class guy with good looks gets the girls he wants (and does the things he wants) Ive converted many a unhappy man in relationships over to brothel shagging, cause NOTHING competes with it Ha, eh? American Psycho? The plot thickens, I thought date rape was bad. There's a few things wrong with your motto. As CV says, what did you even get out of it? Surely the novelty's worn off. You sound like an old perv "i want younger guys to know" - sounds like you're filling a void of depression if I'm honest! Who even has to try for trashy girls anyway? I'm all for the banter between mates when you're single, but it is between mates and not a PHP community on the internet? As CV says as well, when you are in a relationship it's good. What you're talking about just sounds desperate.
-
He's just living the dreamwest.
-
First up, NEVER rely on a cookie for user authentication. It'd take a user a few seconds to modify the cookie to be any user they want. Not only that, but not every user has JavaScript enabled. You need to look server-side for a secure login. I'd read up on a few PHP user login tutorials to familiarise yourself with the logic behind it. Then I'd also have a good read up on security (to ensure your system has no vulnerabilities), PHPFreaks have a good tutorial on security. Then I'd scrap the tutorials you read and write your own from scratch, then have someone look over it; to ensure you understand the concept and are following the best practises. JavaScript though is certainly not the way to go.
-
My first javascript function (pllease don't laugh ;)
Adam replied to fortnox007's topic in Javascript Help
If called in-line, it will just write the string where it's called. Behaviour varies when called from an event though. It doesn't actually refresh the page, it just overwrites the content. -
My first javascript function (pllease don't laugh ;)
Adam replied to fortnox007's topic in Javascript Help
Not far off.. function my_first_function(){ var text1 = 'monkeys'; if (document.getElementById('input').value != text1){ document.getElementById('p_element').innerHTML = 'wrong text'; }else{ document.getElementById('p_element').innerHTML = 'your correct'; } } -
Think he's down brothel again..
-
Go on dreamwest.. touch it.. you know you want too!
-
HA! So it's actually hookers?? That means you've only put in the derty work to get 5 in the last 6 years.. And did you drug 'em or summit?? Christ I've had more than that and I've not even been sexually active 6 years! Edit.. I'll also add, 100 times each different? That means they don't want seconds pal!
-
That just raped my Friday afternoon mind!
-
They're special place-holders that are replaced by sprintf / printf. In your example they are replaced by the second and third (string) arguments in the call to (s)printf, but in reverse order.