Jump to content

Recommended Posts

storing the information into a database is as simple as inserting the contnents of the variables that you are using to build the mail.  once you have the information then you can use it as many times for as many functions as you like.

$to = "recipient@their.net";
$from = "sender@your.net";
$subject = "This Is an Email";
$body = <<<BODY
This is your message body.

You can store all this into a database either before or after it is sent.
BODY;
$query = "INSERT INTO myMailTable (m_to, m_from, m_subject, m_body) VALUES ('$to', '$from', '$subject', '$body')";
$insert = mysql_query($query) or die ("$query<br><SPAN STYLE=\"color:red;\">Caused The following error:</SPAN><BR><BR>".mysql_error());

$header_array = array( 'From: '.$from, 'Reply-To: replyAddress@optional.setting',...);
$headers  = implode ('\n\r', $header_array);
$send_it = mail($to, $subject, $body, $headers);

echo $send_it;

Link to comment
https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1328958
Share on other sites

only have fun learning lol i am stuck tryin 2 use mysql and php and yes other threads are close to same problems i am getting and know replys on existing posts are better as emails go out to experts like yourself to help but if that fails i could make a new thread but dint want multiples of threads tbh i doubt the moderators do either, but not 100% sure on that, all i know is im stuck lol

Link to comment
https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329034
Share on other sites

it wont let me comment or reply on my own thread so il have to ask where i can and also more subscribers to the thread is faster response time

 

 

<?php error_reporting (E_ALL ^ E_NOTICE); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Members Upload Page</title>

<link href="/css/loginmodule.css" rel="stylesheet" type="text/css" />

</head>

<body>

<body style="background:#000000">

<link rel="shortcut icon" href="/favicon.ico">

<style type="text/css">

    A{font:18px/20px Verdana;color:#33CC66;margin-left:10px;}

    #Header{font:18px Verdana;font-weight:bold;text-align:center;color:#000000;}

    .TableHeader{font:18px Verdana;font-weight:bold;color:#000000;padding-left:15px;}

    .BodyCaption{font:18px/20px Verdana;font-weight:bold;color:#000000;}

    .BodyText{font:11px/20px Verdana;color:#000000;margin-left:20px;}

  </style>

<a style="#00FF80">

<h1>Welcome <?php echo $_SESSION['SESS_FIRST_NAME'];?></h1>

<a href="/">Back To Home Page</a> | <a href="/">Back</a>

<p>

<center>

 

<p>Profile Picture Uploader </p>

 

 

<tr>

        <td colspan="3">

            <h1>J~Net</h1>

 

 

 

<form enctype="multipart/form-data" action="up2.php" method="POST">

Please choose a file: <input name="uploaded" type="file" /><br />

<input type="submit" value="Upload" /pics>

</form>

<?php

$target = "/pics";

$target = $target . basename( $_FILES['uploaded']['name']) ;

$filename = $target . basename( $_FILES['uploaded']['name']) ;

$path = $target = "/pics";

$mysql_path = $path."/".$filename;

$ok=1;

if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))

{

echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";

}

 

 

else {

echo "Please Browse For The File You Wish To Upload.";

}

 

 

?>

        </td>

<P>You Are Authorised To View The Following Pages...

</p>

<center>

<a href="/developer/jay/uploads/">View Uploaded Files</a></p>

<a href="/apps/time_clock/timeclock.php">Clock In</a></p>

Default password is "password" and should be changed!<p>

 

 

 

 

</p>

</p>

<a href="http://www.box.net/shared/a6ztyzdodn">J~Webs Start Page Update File (From Box.net)!</a></p>

 

<?php

include("connect.inc.php");

 

//sql query to be executed.

$sql = "INSERT INTO `users`(`filename`,`path`) VALUES ('$filename','$mysql_path')";

?>

 

 

 

</a><br><br><form action="http://google.com/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%> </td><td align=center nowrap><input name=hl type=hidden value=en><input maxlength=2048 name=q size=55 title="Google Search" value=""><br><input name=btnG type=submit value="Google Search"><input name=btnI type=submit value="I'm Feeling Lucky"></td><td nowrap width=25%><font size=-2>  <a href=http://google.com/advanced_search?hl=en>Advanced Search</a><br>  <a href=http://google.com/preferences?hl=en>Preferences</a><br>  <a href=http://google.com/language_tools?hl=en>Language Tools</a></font></td></tr><tr><td align=center colspan=3><font size=-1><span style="text-align:left">Search: <input id=all type=radio name=meta value="" checked><label for=all> the web </label><input id=cty type=radio name=meta value="cr=countryUK|countryGB"><label for=cty> pages from the UK

<p><a href="/"><img src="input.gif"

</a>

<center>

<?php include "/css/footer.php"; ?>

</body>

</html>

 

 

page shows but no file is uploaded and no database updates happen any ideas please?

Link to comment
https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329095
Share on other sites

reading and adhearing to the rules, as well as not behaving like an ass on too many espresso's will get you far more productive responses than hijacking a thread.  There is nothing wrong with your currently open thred, I could post a reply there if I wanted to.

 

and before you even think about starting, this IS me helping you.

Link to comment
https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329105
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.