Jump to content

Scotty2024

Members
  • Posts

    40
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Scotty2024's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Bump again. Sorry I don't know how to put the above into a json array or set up the curl headers.
  2. Could you please show me an example? For example, in the documentations first part, how would you encode the following into a json array? What would the cURL look like with the necessary headers? Thanks.
  3. Does anyone know how to use Google Flight RPC or how to post a json array to it? The only documentation I've found for it is here. It shows the responses and part of the requests. I'm not sure how to build and post a json array using PHP. Any ideas or examples how?
  4. I'm not strong with left/right join. So would it be something like this: select name from table1 left join on table2 on table1.id = table2.userID
  5. Try something like this: <html> <head> <title></title> </head> <body> <?PHP session_start(); $cart = $_SESSION['cart']; $action = $_GET['action']; //test $action echo 'Value of action: ' . $action; switch ($action) { case 'add': if ($cart) { $cart .= ','.$_GET['id']; } else { $cart = $_GET['id']; } break; } ?> <p><?=$fldname;?> <a href="<?=$_SERVER['PHP_SELF'];?>??viewdetail=<?=$nameid;?>&action=add&id=<?=$row['idinfo'];?>">Add to report</a></p> </body> </html>
  6. You could do it with sessions too. To create a cookie use setcookie. For example: setcookie(name, value, expire, path, domain); Then get the cookies data with $_COOKIE[] It can be deleted by setting it to expire. For example setcookie("foo", "", time()-3600); w3schools has a tutorial called What is a cookie?. Both sessions and cookies will only temporarily keep track of the information for you. A database will keep track of it for as long as you want.
  7. If you know the string you want to check for, use a regular expression with preg_match.
  8. Move the add function from the cart.php file to the product file or wherever the Add to report link is. Then on click execute the function when the page reloads. You could also do it with AJAX without a page refresh. Switching to ajax would be more than a small tweak though.
  9. Have a look at fopen, fread, and fclose. These will allow you to read in information from the text file.
  10. You could set a cookie with past video IDs viewed. Or keep track of each video viewed by your users in a database. Do a check against the cookie/database before the video is loaded and if a match is found, send to a new random video.
  11. Hello. I'm trying to create a query to join on two tables. Table1 has id and name. Table2 has userID and itemID. Table1 id and table2 userID are the same. For a specific itemID I want to select all names from table1 where the userID in table2 does not exists. For example, here is some test data. Table1 1 Bill 2 Bob 3 Joe Table2 1 1 2 1 3 2 If I wanted to get all names where the userID wasn't listed for itemID 1, it would return Joe. Similarly if I wanted to get all names where the userID wasn't listed for itemID 2, it would return Bob and Joe. Finally, if I wanted to get all names where the itemID was not equal to 1 or 2, it would return Bill, Bob, and Joe. How do I join the two tables to do this? Thanks.
  12. Hello, Is there a way to track how much each adsense ad is generating. I have someone that helps contribute content to my website. I would like to track all the ads that are clicked in the content that this other person writes. That way, as an incentive, they will get a higher percentage of the revenue from those particular ads. It will give them an incentive to create more/better content also. I know its possible to generate different types of ads but I don't think its possible to see which ad is clicked or to track them. Well, at least I didn't see a way. So that brings me here to ask my question. Thanks for the help.
  13. if(isset($_POST['submit'])) { if(isset($_POST['checkbox'])) { //proceed } else { $checkBoxFlag = true; } } //at your form or wherever if($checkBoxFlag) { ?> <script type="text/javascript"> alert("You must check the checkbox"); </script> <?PHP } //form code here
  14. Would love to change the host but can't. Anyone else have any suggestions. My tip: stay away from 1and1.com
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.