-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
Ok, what I'm trying to do is if a user clicks on a certain part of the image using the ismap then it would echo off something or like set a cookie for authorization or suttin
[code]
<a href=/php>
<img src=image.png ismap border=0>
</a>
<?php
$thing = $_GET['/'];
if($thing == "34,192"){
echo "noob";
};
?>
[/code]
neoblob.com/php
just go there if you dunno what i mean -
[code]
<?php echo date ("F d Y H:i:s", getlastmod()); ?>
[/code] -
Ok, what I'm trying to do is if the user specifies like an answer between 1 - 10, 11 - 20, 21 - 30... etc... that it will echo off something according to the valued answer
[code]
$rounded = round($answer);
if($rounded == 50 - 60){
echo "something here";
};
[/code] -
how is this done?
i know how to use the mail() function, but how can i incorparate images in the email? -
id's are auto increments, they will automatically increase each time you make a new row.
[code]
$query = "INSERT INTO tbl_article (`article_hits` , `article_approved` , `article_image` ) VALUES ('$hits' , '$approved' , '$image');";
$result = mysql_query($query);
$query = "INSERT INTO tbl_links (`genre_id` , `user_id` , `link_headline` , `link_description` , `link_url` , `article_id` , `link_votes` , `link_score` , `link_hits` , `link_date`) VALUES ('$gid' , '$uid' , '$hdln' , '$desc' , '$url' , '$aid', '$votes' , '$score' , '$hits', '$date' );";
$result = mysql_query($query);
[/code] -
[code]
if ($page == false) {
include("home.php");
} else {
include($page.".php");
}
[/code] -
-
[code]
<?
//change this to your email.
$to = "m@maaking.com";
$from = "m2@maaking.com";
$subject = "Hello! This is HTML email";
//begin of HTML message
$message = "<html>
<body bgcolor=\"#DCEEFC\">
<center>
<b>Looool!!! I am reciving HTML email......</b> <br>
<font color=\"red\">Thanks Mohammed!</font> <br>
<a href=\"http://www.maaking.com/\">* maaking.com</a>
</center>
<br><br>*** Now you Can send HTML Email <br> Regards<br>MOhammed Ahmed - Palestine
</body>
</html>";
//end of message
// To send the HTML mail we need to set the Content-type header.
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$headers .= "From: $from\r\n";
//options to send to cc+bcc
//$headers .= "Cc: [email]maa@p-i-s.cXom[/email]";
//$headers .= "Bcc: [email]email@maaking.cXom[/email]";
// now lets send the email.
mail($to, $subject, $message, $headers);
echo "Message has been sent....!";
?>
[/code]
or
[code]
<?
//change this to your email.
$to = "m@maaking.com";
$from = "m2@maaking.com";
$subject = "Hello! This is HTML email";
//begin of HTML message
$message = <<<EOF
<html>
<body bgcolor="#DCEEFC">
<center>
<b>Looool!!! I am reciving HTML email......</b> <br>
<font color="red">Thanks Mohammed!</font> <br>
<a href="http://www.maaking.com/">* maaking.com</a>
</center>
<br><br>*** Now you Can send HTML Email <br> Regards<br>MOhammed Ahmed - Palestine
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
//options to send to cc+bcc
//$headers .= "Cc: [email]maa@p-i-s.cXom[/email]";
//$headers .= "Bcc: [email]email@maaking.cXom[/email]";
// now lets send the email.
mail($to, $subject, $message, $headers);
echo "Message has been sent....!";
?>
[/code] -
what would be a good way to start out a ranking system?
-
[code]
$headers = "From: NAME <send@mail.nl";
[/code] -
it still doesnt save it :(
-
Ok, I'm getting errors with the fread and fclose functions.
[code]
<?php
$loadcontent = "$_GET[page]";
if($save_file) {
$savecontent = stripslashes($savecontent);
$fp = @fopen($loadcontent, "w");
if ($fp) {
fwrite($fp, $savecontent);
fclose($fp);
}
}
$fp = @fopen($loadcontent, "r");
$loadcontent = fread($fp, filesize($loadcontent));
$loadcontent = htmlspecialchars($loadcontent);
fclose($fp);
?>
<form method=post action="<?=$_SERVER[PHP_SELF]?>">
<textarea name="savecontent" cols="70" rows="25"><?=$loadcontent?></textarea>
<br>
<input type="submit" name="save_file" value="Save">
</form>
[/code]
I get the errors:
[code]
Warning: fread(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 12
Warning: fclose(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 14
[/code] -
you literally made a new table for every single user? or did you make a whole new row?
-
in the fields put like
[code]
value='<?=$fieldname?>'
[/code]
which would echo off the data into the input text box and textarea -
ok, here is my code
[code]
<?php
$loadcontent = "$_GET[page]";
if($save_file) {
$savecontent = stripslashes($savecontent);
$fp = @fopen($loadcontent, "w");
if ($fp) {
fwrite($fp, $savecontent);
fclose($fp);
}
}
$fp = @fopen($loadcontent, "r");
$loadcontent = fread($fp, filesize($loadcontent));
$loadcontent = htmlspecialchars($loadcontent);
fclose($fp);
?>
<form method=post action="<?=$_SERVER[PHP_SELF]?>">
<textarea name="savecontent" cols="70" rows="25"><?=$loadcontent?></textarea>
<br>
<input type="submit" name="save_file" value="Save">
</form>
[/code]
and here is the error i get
[code]
Warning: fread(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 12
Warning: fclose(): supplied argument is not a valid stream resource in /home/neoblob/public_html/php/3/edit.php on line 14
[/code] -
no problem
-
but like, so when they answer it, it kind of deletes that row from the database but keeps it on the page with who answered it
-
just lock it
-
[code]
<?php
$home = $_GET[home];
if($home == false){
header ("Location: page.php");
}else if($home == 1){
header ("Location: page1.php");
};
?>
[/code] -
is this like a normal board like smf, ipb, phpbb? or something you made, your own email script?
-
i still dont see what your trying to do
[code]
$frameid = $_GET[frameID];
if($frameid == false){
echo "suttin";
}else if($frameid == 1){
echo "suttin else";
};
[/code]
i still dont see what you're trying to do,
post the full script -
connect like:
[code]
$connection = mysql_connect(host,dbuser,dbpass);
$db = mysql_select_db(dbname,$connection);
//then
$sql = "SELECT * FROM members";
$result = mysql_query($sql);
$result2 = mysql_fetch_assoc($result);
[code]
then whatever you want to echo do
[code]
echo $result2[user];
[/code]
just change user to a field in your database[/code][/code] -
what do you mean?
[code]
if($frameID == false){
$frameID=1;
}else if($frameID == value){
$frameID=2;
};
[/code]
like that? -
Ok, I was going to make a system where it would update the page every 45 mins (via cron) and like, a system where when the user clicks the image and enters the correct info needed it would send it to the database and mark it off as already clicked, but then like the next time the cron goes off it lists more images (different ones)
Question about using "POST" and MySQL in PHP
in PHP Coding Help
Posted
UPDATE `links` SET `name` = '$name', `link`= '$link'
WHERE `key` =$key LIMIT 1 ;
[/code]
also, try connecting to the database before you do queries.