fugix
Members-
Posts
1,483 -
Joined
-
Last visited
Everything posted by fugix
-
problems with carriage returns, tabs (I think).
fugix replied to memoryproblems's topic in Regex Help
first, you need to escape the special characters $regex = '/title\=\"Ruler\: (.+?)\"><\/a>.*<\/td>/s'; Edit: as for matching new lines, i have edited the reg ex a little -
that's what i mean, if the he has sessions stored for lets say his login credentials the user will be logged out if his login is based off of sessions
-
just re-read the OP, are you trying to actually use session_destroy() on the variable that holds your $_SESSION value? if so, that wont work...you will need to do something like <?php session_start(); session_destroy($_SESSION['id']); ?> where your index "id" would be whatever you named your session, also, if you wanted to destroy every session you have created you can use redixx method, however be careful, because it will destroy EVERY session that is initialized
-
make sure you have session_start() at the top of the [age you are using to destroy your session..if you do, please show us your code
-
Can someone explain how the -> operator in PHP works?
fugix replied to buildakicker's topic in PHP Coding Help
firstly, where is you "act" index coming from in your $_GET['act'] declaration. The error states that it is not finding anything with a name of "act" -
Can someone explain how the -> operator in PHP works?
fugix replied to buildakicker's topic in PHP Coding Help
do you actually have an issue with your code? my first impression was that this was an informative question only. If you are having an issue with something related to this subject, please post your code and we will be glad to help you -
can you show a bigger chunk of the code surrounding the second query, e.x where you actually execute the query and echo the results etc.. much appreciated
-
Can someone explain how the -> operator in PHP works?
fugix replied to buildakicker's topic in PHP Coding Help
if foo is not returning any data, either something is wrong with your class declaration or your class-method declaration/coding inside of the method -
how to echo out posted variables that increment by a number
fugix replied to jeff5656's topic in PHP Coding Help
basically the same thing i had wrote for you, glad you got it working though -
yes, but the majority of people on here dont bother opening attachments, so he has a better chance of getting his question answered if the script is directly on the thread.
-
Can someone explain how the -> operator in PHP works?
fugix replied to buildakicker's topic in PHP Coding Help
gizmola did a nice ob of explaining, just to simply give it a name, this is one of the two "object operators" along with :: -
would you mind posting the code to this thread please
-
That's how you had time for your 9200 posts. You needed something to do while things were compiling haha, classic
-
Validation works, Ajax works, but they won't work together?
fugix replied to PhilipK's topic in Javascript Help
sidenote, I never encourage from validation using javascript, as the user can disable this in their browser settings, which in turn disables your form validation and can lead to unwanted results in your db. I encourage using PHP to validate forms. -
how to echo out posted variables that increment by a number
fugix replied to jeff5656's topic in PHP Coding Help
As you stated, it depends on how much information is being sent to the $_POST array, you would most likely get unwanted values that would need to be filtered out, causing more work, however this could be a feasible solution as well -
how to echo out posted variables that increment by a number
fugix replied to jeff5656's topic in PHP Coding Help
for this you would want to use a for loop $i = 0; for ($i = 0;$i < $_POST['num_variables']; $i++) { echo {$_POST['variable']}{$i} -
as further information, your script was not working because you were trying to address a string as an array. When using the array syntax on a string, it breaks down each character of a string as values...example $string = "Hello World"; echo $string[0];//outputs H echo $string[3];//outputs l etc. What was happening were there were times when your script would produce use the maximun strlen of your $characters var, so you would have 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY[61]; which would put your pointer one character after the full string, which cant be done, thus the error is triggered for invalid offset
-
what is the exact error that you receive when using $charinfo="SELECT name from `user_stats` WHERE User='$sname'"; $char=mysql_result(mysql_query($charinfo),0) or die(mysql_error());
-
try this approach instead mysql_connect("localhost", "username", "pass") or die(mysql_error()); mysql_select_db("database") or die (mysql_error()); $AddNewPlayer = $_POST["PHPnewPlayer"]; $AddNewScore = $_POST["PHPnewScore"]; $fetch = "SELECT * FROM highscores WHERE player = '$AddNewPlayer'"; $result = mysql_query($fetch) or die (mysql_error()); $num_rows = mysql_num_rows($result); if($num_rows > 0){ echo "Profile already in use"; } else{ if($AddNewPlayer == ''){ echo "Please enter a profile name"; } else { mysql_query("INSERT INTO highscores (player, score) VALUES('".$AddNewPlayer."', '".$AddNewScore."') ") or die (mysql_error()); echo "Profile Added -".$AddNewPlayer; } }
-
links have absolutely nothing to do with file system paths, using $_SERVER['DOCUMENT_ROOT'] as PFM said should be sufficient
-
where is the file that you are including your require_once() located?
-
what are the results that you are receiving now?
-
bottom left hand of this page, its a grayish button