kenrbnsn
Staff Alumni-
Posts
8,234 -
Joined
-
Last visited
Everything posted by kenrbnsn
-
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
-
Look at the strtotime() function. Ken
-
When posting code on this forum, please put it between tags. Ken
-
Please post your code between tags. Ken
-
Look at stripslashes() & mysql_real_escape_string() (if you're using mysql). Ken
-
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
-
Trouble WITH fucTions //PLEASE HELP ME!!!!?? :)
kenrbnsn replied to phpJoeMo's topic in PHP Coding Help
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 -
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
kenrbnsn replied to cactus's topic in PHP Coding Help
What is line 58? Ken -
Trouble WITH fucTions //PLEASE HELP ME!!!!?? :)
kenrbnsn replied to phpJoeMo's topic in PHP Coding Help
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 -
That is not enough code. The while block isn't closed and we can't see what else the script does. Ken
-
Move to a better host. That's a stupid way of being "secure". Ken
-
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
kenrbnsn replied to cactus's topic in PHP Coding Help
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 -
If you echo your query before the error message, the error message becomes much clearer. Ken
-
converting Microsoft Excel formatted text file as an excel file
kenrbnsn replied to lakshmiramya's topic in PHP Coding Help
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 -
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
-
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
-
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
kenrbnsn replied to cactus's topic in PHP Coding Help
You need to have <?php session_start(); ?> at the very beginning of each script where you use the $_SESSION array. Ken -
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
-
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
-
Page B should never be seen unless it's doing output. Can you post the code of each script between tags? Ken
-
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
-
How are you invoking the script on you local machine? It needs to be http://localhost/path/to/yourscript.php. Ken
-
You forgot a concatenation operator <?php $stringData = '$' . $newcolumn . '= $info[' . $newcolumn . ']'; ?> Or, try it this way <?php $stringData = "\${$newcolumn} = \$info['{$newcolumn}']"; ?> Ken
-
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