phant0m
-
Posts
164 -
Joined
-
Last visited
Never
Posts posted by phant0m
-
-
?> html <?php
-
assuming these "Ids" are strings, just use integers instead. This should improve the performance.
and use an MySQL's index feature
also, you could use a separate table for the refDomain, and use a foreign key instead. This should improve the performance as well.
-
$ signifies the end of the string(or line, if the "m" modifier is set)
No idea how the notepad++ regex syntax works, but try this:
,\s*}
-
well, you need to print the text at some time. "return" will not print your html.
Also, you can close you PHP area with ?>, then write some html, and reopen PHP.
This also works with if, while etc.
-
you could use mysql_error() to get an error message
-
what's wrong with array_unique?
if you want to reindex the array, use array_values
-
bascially, it is an answer to this question:
Ok if theres 10 ppl and 7 say yes and 3 say no - what percentage says yes
Answer : 23%
But what if theres 1230 ppl and 14 say yes and 1216 say no , what percentage says yes. This is what im after
-
what about something like this
function get_percentage($val1, $val2, $precision=0){ $total = $val1 + $val2; $result = array(); $result[] = round($val1 / $total * 100, $precision); $result[] = 100 - $result[0]; return $result; }
get_percentage(2, 4, 2); would return an array:
Array ( [0] => 33.33 [1] => 66.67 )
-
what information do you have in that table?
-
you need to close the if statement with a "}"
Just insert this at the very end of your code.
-
With explode, you can split a string into an array, by specifying a delimiter(" ", in your case)
<?php $results = explode(" ", $str); ?>
-
<?php $url=array("scheme"=>array("host"=>"www.dontmatter.com") ,"path"=>array("/index.php"),"query"=>array("limitstart=3")); ?>
This is not, what parse_url returns.
It returns a (one-dimensional) associative.
"scheme" is the key, which contains the protocol(eg.g http, https), it is not an array
-
if($counter=0)
this will always evaluate to false, because:
this is an assignment, and every assignment itself evalutaes always the value which is being assigned(0)
Because 0 is assigned to $counter, the entire assignment represents 0, which evaluates false.
To compare, you have to use ==
Note: if you put the immediate first, (0 = $counter) it will result in a PHP error
0 == $counter and $counter == 0 however, are equivalent
-
It depends...
Do you want the result to match the search string entered exactly?
Or does the search string have to be somewhere in the result?
This would return all results where $search is somewhere in coln
SELECT * FROM table WHERE coln LIKE '%$search%'
Make sure to escape $search properly before putting it into a query
-
yes, it is easy
<?php
$host = parse_url($url);
$host = $host['host'];
header("Location: $host");
?>
I suggest you to do some reading about arrays
-
I think it should be like this:
<option selected="selected" value="<?php echo date(Y); ?>"><?php echo date(Y); ?></option>
-
ooops sorry
just replace $email with $email_from and it should work
-
I seem to have found the problem: register_globals is set to "On"
Thanks a lot for the help anyway.
-
Errors shouldn't happen randomly...
As I understand it, you were not able to reproduce the error, right?
here's what comes to my mind:
1) There is an unexpected, let's call it "situation" where your scripts somehow fails
2) An attacker is involded(your login script seems prone to mysql injection)
3) The feedback was just a hoax
-
I think I now understand what you mean...
Do you know how it is supposed to load that tooltip?
I think a little more information is needed to solve your problem.
-
As I understand it, $AdditionalComments=nl2br($AdditionalComments); is run before the information is inserted into the database.
I suggest you not to process the text in no way before inserting it into the database but rather process it, before displaying it on your homepage.
-
You cannot format the title-tooltip using HTML!
You have to create your own tooltip using a div.
When hovering above the image, call some JS function in order to display the tooltip-div
-
<img class="avatar hasTip" src="http://******/images/avatar/thumb_38d030efce631817589108e7.jpg" title="Reece::Welcome to my Profile!<br/><hr noshade="noshade" height="1"/><img style="vertical-align:middle;padding: 0px 4px;" src="http://v3.coldcast.co.uk/components/com_community/assets/status_offline.png" />Offline | <img style="vertical-align:middle;padding: 0px 4px;" src="http://******/components/com_community/assets/default-favicon.png" />3 friends" width="45" height="45" />
As you can see, the title attribute contains a lot of wrong info. I think something is messed up in the template.
-
Sessions shouldn't get mixed up - but it could be that different users are using the same session, although this usually only happens when one of the two is an "attacker".
Perhaps there's an error in your scripts which messes things up?
[SOLVED] Javscript error in my php
in PHP Coding Help
Posted
Try this:
If you enclose your string in single quotes, you need to escape all single quotes inside your string with \