Jump to content

kenrbnsn

Staff Alumni
  • Posts

    8,234
  • Joined

  • Last visited

Everything posted by kenrbnsn

  1. That error is telling you that either the username is incorrect or the password is. Make doubly sure that the case of the strings are correct, since everything is case sensitive. I've been using MySql with cPanel for years and I never have a problem with it. Ken
  2. Look at the strtotime() function. Ken
  3. When posting code on this forum, please put it between tags. Ken
  4. Please post your code between tags. Ken
  5. Look at stripslashes() & mysql_real_escape_string() (if you're using mysql). Ken
  6. You're storing the error conditions in the $_SESSION array which is a super global (i.e. it's global with declaring it as such), so just used the session values in your other function. Ken
  7. I think what you're looking for is something like <?php if (!isset($b)) { $b = $a; } ?> Ken
  8. Don't use globals, pass the variables the function needs. Functions should be programmed as generic as possible, using a global in a function restricts where you can use it. Ken
  9. The array $userID is not defined inside the function timeOutAct. You need to pass it in as a parameter, just like you do in the function dbDelete: <?php $userID = array('scott'); function dbDelete($param){ $conDelete = mysql_connect($url,'myusername','mypassword',true); mysql_select_db('mydatabase',$conDelete); mysql_query($param,$conDelete); mysql_close(); if(isset($conDelete)){ mysql_close($conDelete); } } function timeOutAct($user){ dbDelete("DELETE FROM acctussessi WHERE acctussessi_usid = '$user'"); $_SESSION = array(); setcookie(session_name(),'',time()-4200); session_destroy(); } timeOutAct($userID[0]); ?> In the future when you post code to this forum, please put it between tags. Ken
  10. That is not enough code. The while block isn't closed and we can't see what else the script does. Ken
  11. Move to a better host. That's a stupid way of being "secure". Ken
  12. That is telling me that you don't have a form field with the name of "username". What does your form look like. Please post code between tags. Ken
  13. If you echo your query before the error message, the error message becomes much clearer. Ken
  14. The file you're retrieving is a tab delimited csv file. It is not a excel formated file. Copy it to a file with the extension ".csv", then you can import it into Excel. Ken
  15. When you get that error, it means that your query has invalid syntax and is failing. On your query do something like: <?php $q = "your query here"; $rs = mysql_query($q) or die("Problem with the query $q<br>" . mysql_error()); ?> This will tell you what the problem is. Ken
  16. You're already inside a block of PHP code started be "<?php", so you don't need the second "<?php". The correct way of doing what you want is <?php $login_form = " <form name='login_form' method='post' action='{$_SERVER['PHP_SELF']}?action=process'> Username: <input type='text'>"; ?> But you don't even need "{$_SERVER['PHP_SELF']}", since an empty action makes the form get processed by the same script: <?php $login_form = " <form name='login_form' method='post' action='?action=process'> Username: <input type='text'>"; ?> I'm not sure what you're trying to do with this line <?php if ($rm_field_un) { echo "Username is wrong"; } ?> since it's meaningless in the context of the function. Ken
  17. You need to have <?php session_start(); ?> at the very beginning of each script where you use the $_SESSION array. Ken
  18. If you tell us what you want to do, we might be able to suggest how you can to it. You're going to have to use AJAX to do it, since PHP executes and exits before the Javascript is run by the browser. Ken
  19. There are plenty of examples of this found via google. One example is http://www.w3schools.com/media/media_browservideos.asp But it's not really a PHP question, since it's all done with HTML. Ken
  20. Page B should never be seen unless it's doing output. Can you post the code of each script between tags? Ken
  21. Anchor tags are not passed to the server. Only the browser sees them and can act on them. If you want PHP to see an anchor tag, you would have to capture it with Javascript and send the value to PHP via AJAX. See http://www.w3schools.com/jsref/prop_loc_hash.asp for how to capture the hash via Javascript. Ken
  22. How are you invoking the script on you local machine? It needs to be http://localhost/path/to/yourscript.php. Ken
  23. You forgot a concatenation operator <?php $stringData = '$' . $newcolumn . '= $info[' . $newcolumn . ']'; ?> Or, try it this way <?php $stringData = "\${$newcolumn} = \$info['{$newcolumn}']"; ?> Ken
  24. The show source output show that the eventid is being added: <form action="editevent.php?eventid=3" method="link"><INPUT TYPE="submit" VALUE="Edit"></form> <form action="delete_ac.php?eventid=3" method="link"><INPUT TYPE="submit" VALUE="Delete"></form> Why do you think it's not working? Ken
×
×
  • 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.