-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
what does $downloadtimer equal?
-
just put it in your body tags
-
[code]
<?php
$top = rand(1,100);
$left = rand(1,100);
echo "<div style=position:absolute; top:$top; left:$left;>";
?>
[/code] -
The profile.php
-
It sure would be helpful if you posted your code.
-
do
[code]
<?php
$userid = $_POST['userid'];
$cookie = setcookie("BMLID",$userid,time()+3600);
if(!$cookie){
echo "cookie not set";
}else {
echo "cookie set";
setcookie("BMLID",$userid,time()+3600);
}
?>
[/code] -
Try:
[code]
<?php ob_start();
header("location...");
ob_end_flush();
?>
[/code] -
You can do a session and have a value to it.
[code]
<?php
session_start();
if(isset($_SESSION['counted'])){
$new = $_SESSION['counted'] + 1;
$_SESSION['counted'] = $new;
echo $_SESSION['counted'];
}else {
$_SESSION['counted'] = 1;
}
?>
[/code]
-
Works perfect thanks!
-
And for showing a members list you can do:
[code]
<?php
$sql = "SELECT * FROM `users`";
$res = mysql_query($sql) or die(mysql_error());
$num = mysql_numrows($res);
if($num == 0){
echo "no users";
}else {
while($row = mysql_fetch_assoc($res)){
echo "<a href=profile.php?id=$row['id']>$row['username']</a>\n";
}
mysql_free_result($res);
}
?>
[/code] -
Could this be done with str_replace? If ($a <$a being str_replace($swears,"",$message)){ echo "bad word" }
?? -
You can do this easily with some mysql queries.
[code]
<?php
$id = $_GET['id'];
if(isset($id)){
$sql = "SELECT * FROM `users` WHERE id =$id";
$res = mysql_query($sql) or die(mysql_error());
$num = mysql_numrows($res);
$row = mysql_fetch_assoc($res);
if($num > 0){
echo "Welcome to $row['username']'s profile!<br><br>\n";
echo "Name: $row['name']<br>\n";
echo "Email: $row['email']<br>\n";
echo "Picture: <img src='".$row['image']."'><br>\n";
//and whatever is in your database
}else {
echo "That user does not exist!\n";
}
}else {
echo "You have no user id specified!";
}
?>
[/code] -
[code] if(!substr($cont,"http://") && !substr($cont,"www")) { [/code]
-
I am trying to make a contact thing, that just simply puts a row in a database, but how would I go upon checking if the message included swears?
Say if I had an array of words that I didn't want the person to send and check if the message included any of those -
You shouldn't have any problems with redirecting them.
[code]
<?php
if(!isset($_SESSION['logged'])){
header("Location: login.php");
}else {
echo "hi";
}
?>
[/code] -
Yeah, you can use captcha for the security code. And to block http:// and www
You can do:
[code]
<?php
$message = $_POST['message'];
$message = str_replace("http://","",$message);
$message = str_replace("www","",$message);
?>
[/code] -
You dont echo functions.
Just do
<?php
eitan(thenyourcasenumberhere);
?> -
Like, if the four values present are the same value, it would echo off like values are alike.
-
Is it possible to check if the same value of the submitted field are the same values?
[code]
<?php
$str = $_POST['num'];
if(strlen($str) > 0 && strlen($str) < 5){
//then check if the field is the same value (like 4444,3333,1111)
}
?>
[/code] -
Could you share you code?
-
Just add in your php.ini
max_execution_time = 1200 < which would set the max exec time to 20 minutes -
You could do:
[code]
$sql = "SELECT * FROM `friends` WHERE id =$id LIMIT 12";
$res = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_assoc($res)){
echo "<a href=profile.php?id=$row[friendowner]>$row[friendname]</a>|\n";
}
mysql_free_result($res);
[/code]
Then you could easily just make a new page like friends.php and use a get to show all the friends
[code]
$sql = "SELECT * FROM `friends` WHERE id =$_GET['id']";
$res = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_assoc($res)){
echo "<a href=profile.php?id=$row[friendowner]>$row[friendname]</a>|\n";
}
mysql_free_result($res);
[/code] -
As seen in Daniel's post, $filename = explode(etc...)
You can easily set:
[code]
$fn = $filename[0];
[/code]
then echo off $fn -
basically put it before the while
[code]
<?php
if(mysql_num_rows($result) == 0){
echo "error";
}else {
while....etc...
?>
[/code]
PHP.net Firefox Quick Search Plugin
in Miscellaneous
Posted
This works for Mozilla Firefox only.
file directory: c:\documents and settings\USER\Application Date\Mozilla\Firefox\Profiles\PROFILENAME\searchplugins\
You can manually add the file by creating a new document called php.net.xml
and the file contents should be as followed:
[code]
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>php.net</ShortName>
<Description>Search php.net function list</Description>
<InputEncoding>utf-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAADEDgAAx
A4AAAAAAAAAAAAAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAw
ICAwICAwICAwICAwICAwICAwICAwICA19fX19fX19fXwICAwICAwICAwICAwICAwICAwICA19fX19fX19fXwICAwICAwICA19fXAAAA19fXwICAw
ICAwICAwICAwICAwICAwICA19fXAAAA19fXwICAwICAwICA19fXAAAA19fX19fXwICAwICA19fXwICAwICA19fX19fXAAAA19fX19fXwICAwICA1
9fXAAAAAAAAAAAA19fX19fXAAAA19fX19fXAAAA19fXAAAAAAAAAAAA19fX19fX19fXAAAA19fX19fXAAAA19fXAAAA19fX19fXAAAA19fXAAAA1
9fX19fXAAAA19fX19fXAAAA19fX19fXAAAA19fXAAAA19fX19fXAAAA19fXAAAA19fX19fXAAAA19fX19fXAAAA19fX19fXAAAA19fXAAAA19fX1
9fXAAAA19fXAAAA19fX19fXAAAA19fX19fXAAAAAAAAAAAA19fX19fXAAAAAAAAAAAA19fX19fXAAAAAAAAAAAA19fX19fXwICA19fX19fX19fXw
ICA19fXAAAA19fX19fXwICAwICA19fX19fX19fXwICAwICAwICAwICAwICAwICAwICA19fXAAAA19fXwICAwICAwICAwICAwICAwICAwICAwICAw
ICAwICAwICAwICAwICA19fX19fX19fXwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAw
ICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwICAwI
CAwICAwICAwICAwICAwICAwICAwICA</Image>
<Url type="text/html" method="GET" template="http://www.php.net/manual-lookup.php">
<Param name="pattern" value="{searchTerms}"/>
<Param name="sourceid" value="Mozilla-search"/>
</Url>
<SearchForm>http://www.php.net/manual-lookup.php</SearchForm>
</SearchPlugin>
[/code]
or you can take the quick way and just manually download it of the attached file.
[attachment deleted by admin]