Jump to content

batwimp

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by batwimp

  1. The most important problem you have there is that the javascript function is called getElementById, not ElementyById, though this doesn't solve everything. In troubleshooting javascript, you need to mess around with things like code placement (where in the script your code is), single quotes vs. double quotes vs. no quotes at all, etc. After playing around with this stuff, I got this code to work. Note the placement of the script tags and quotes: <script type='text/javascript'> function toggle(id) { document.getElementById(id).style.visibility = "hidden"; } </script> <body> <p> </p> <div id="2" > hello </div> <div id="abc" > Fellow </div> <SCRIPT type='text/javascript'>toggle(2);</SCRIPT> </body>
  2. Calculate the md5 has of both files and compare them: http://us3.php.net/manual/en/function.md5-file.php Read the comments on that page for more efficient ways to compare large files.
  3. From php.net:
  4. is there anything in markdown.php that could be destroying or resetting the session?
  5. There are a couple of problems with the last bit of code you posted. First, you really should close your <script> tags after the actual javascript and not the entire page. Second, when calling the javascript function from a PHP print command, use the full javascript syntax: echo "<SCRIPT type='text/javascript'>jsfunc();</SCRIPT>"; Third, notice that I changed your code from SCRIPT LANGUAGE='text/javascript' to SCRIPT type='text/javascript'. Fourth, you weren't calling the same function as the one you defined. You were still using mysuperawesomefunction but the code in the script tags were calling jsfunc(). Here is your code with the modifications made, and it works on my system: <script type='text/javascript'> function jsfunc(){ alert('Yay, this works!'); } </script> <?php //initialize the session if (!isset($_SESSION)) { session_start(); } if (isset($_SESSION['MM_Username'])) { echo "hi"; echo "<SCRIPT type='text/javascript'>jsfunc();</SCRIPT>"; } else { echo "<SCRIPT type='text/javascript'>jsfunc();</SCRIPT>"; echo "cool"; } ?>
  6. http://us3.php.net/manual/en/function.sleep.php
  7. Are you sure this line is actually populating the session variable: $_SESSION["user_firstname"] = $data["Firstname"]; What happens if, right after this line, you do this: echo $_SESSION['user_firstname'];
  8. Action is the name of the file where the form is sent. So right now it is being sent to a file named "URL". Is this the behavior you wanted? Is your web server (apache, etc) set up to process files that don't have an extension?
  9. You can offset your cron jobs by adding a delay to one of them: 00-59 * * * * root sh /home/me/myscript.sh 00-59 * * * * root sleep 30 && sh /home/me/myscript.sh The 'sleep 30' is the offset, 30 seconds. But if you were worried about delaying a job by 1-10 random seconds, this may not be your best choice. I just figured since you were running cron jobs every minute anyway, offsetting one of them wouldn't hurt.
  10. There is no m-p index in your POST. There is the equivalent to this: $_POST[1] == "m-p" Perhaps you have an error in your variable assignment. In the form where this is populated, is the 'name' field set to "m-p"?
  11. That's the problem with using IP addresses to keep track of user information. IP addresses can change for a number of reasons. Using IP addresses to store unique user information isn't reliable. The best way to keep track of individual user stuff is to have login functionality.
  12. Mu suggestion was just a starting point. It would be difficult to keep troubleshooting until fundamental issues are fixed.
  13. But X out any sensitive information first...
  14. You shouldn't have both a constructor function: __construct() and a method with the name of the class: function getData() in the same class. Naming a function with the name of a class is a PHP 4 thing, and was used as a constructor. Due to backward-compatibility issues, you might have problems with that. Gurus, please tell me if I'm wrong. Also, when you define a variable and set it to an instance of a class, you should also use this to send parameters, like so: $data = new getData($name, $email, $text);
  15. Where are you redirecting to the help page? I can't see that part in your code. I see headers to other pages, but not the help page.
  16. Right. Copy the code it dumped to the screen and post it here.
  17. Try using single quotes for your array indexes: $_SESSION["user_firstname"] = $data["Firstname"]; becomes: $_SESSION['user_firstname'] = $data['Firstname'];
  18. Your question is fairly vague. What exactly are you trying to use this for?
  19. You also need to run session_start() on the original page where you set your session variables.
  20. var_dump($_POST); Put it right at the top, the line after <?php
  21. You will need to be able to write their information to a database. Store the video information, a user ID, the date they paid, and any other relevant information in a database table and query that table for the date of purchase and compare to the current date. If they are within the date range, output the link via an echo command. But to make sure they don't cheat and copy the link and paste it later, you may need to store the information into a session variable to check against on the video delivery page. I'm not sure of your level of PHP expertise, so I don't know how much of that you understand.
  22. is the video a product? So, the customers pays via Paypal, then they have access to a video for three days?
  23. if(isset($_POST['textfield'])){ $inputName = mysql_real_escape_string($_POST['textfield']); }else{ $inputName=''; } $sql = sprintf("select * from memberdetails where username = '%s' ",$inputName);
  24. Do a var_dump($_POST) and see if the values are getting into your POST.
  25. Do a var_dump($_POST) and see if the values are getting into your POST.
×
×
  • 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.