Anybody need a little bit of quick php done?

lszanto

New Member
Messages
23
Reaction score
0
Points
0
I'm rather bored right now and just wanted to know if anybody needs anything quick/simple done in php cause i'm up for a bit of a challenge and am in a programming mood.
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
* Moved to the Marketplace, because that is where you should offer services. If you want to help people with programming, then watch the programming help forums and help anyone that posts for help.

Thank you for offering help though, there are plenty of people that need it. :biggrin:
 
Last edited:

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
what are you asking in return?
i might want some work done, i need a login form created.
 

lszanto

New Member
Messages
23
Reaction score
0
Points
0
what are you asking in return?
i might want some work done, i need a login form created.

Nothing really, if you want to give something in return that is also fine. And I can help witih a login form, do you need it to be connected to a user database? What page will it need to rediect your site to once logged in? And lastly i'm assuming you would like this done in php, are you going to use a flatfile(text based) or a mysql type of database?
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
this is actually for a friend of mine, so let me ask him about the specifics and i'll get back to you, ok.
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
Hi,
I would like a PHP page that is used with an HTML form which will...
Email Form Results to 1 email address
Save Form Results into a MySQL Database

I just want the page so it is compatible with HTML form post.
If you are interested please let me know.
Thanks.
:)
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
sending the data to an email is easy. it would be something like this:

form.php
Code:
<form action="post.php" method="post">
<p>Full Name: &nbsp;&nbsp; <input name="fullname" type="text" value="" /></p>
<p>Email Address: &nbsp;&nbsp; <input name="email" type="text" value="" /></p>
<p>Subject: &nbsp;&nbsp; <input name="subject" type="text" value="" /></p>
<p>Message: &nbsp;&nbsp; <textarea name="message"  value="" width="300" height="200"></textarea></p>
<input type="submit" value="Submit" />
</form>

post.php
PHP:
<?php
$name = $_REQUEST['fullname'] ;
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;

$msg = "from: $name
$message"

if(mail(name@host.com, $subject, $msg, $email))
{
echo "/*PLACE HTML IF SEND IS SUCCESSFUL*/";
}
else
{
echo "/*PLACE HTML IF SEND IS UNSUCCESSFUL*/";
}
?>

i don't know about sending it to a database.
 
Last edited:

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
Do you think you could add a few things to my PHP script?

<?php
if(isset($_POST['submit'])) {
$to = "sohail@sohailtech.com";
$subject = "New Game Request";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$gametitle = $_POST['gametitle'];
$smallimg = $_POST['smallimg'];
$bigimg = $_POST['bigimg'];
$swflink = $_POST['swflink'];
$copyright = $_POST['copyright'];
$others = $_POST['others'];

$body = "From: $name_field\n E-Mail: $email_field\n Game Title: $gametitle\n Small Image: $smallimg\n Large Image: $bigimg\n Game Link: $swflink\n Copyright Evidence: $copyright\n Anything Else: $others";
?>

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Submit Game</title>
<link href="/games/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="banner"></div>
<div align="center">
<div id="navigation"><a href="http://sohailtech.com/">HOME</a> • <a href="http://tutorials.sohailtech.com/content/blogsection/4/26/">FLASH TUTORIALS</a> • <a href="http://tutorials.sohailtech.com/content/blogsection/5/29/">PHOTOSHOP TUTORIALS</a> • <a href="http://tutorials.sohailtech.com">BLOG</a> • <a href="http://forums.sohailtech.com/">FORUMS</a> </div>
</div>
<div align="center"><br>
<?php
echo "Thanks for your request, it will be reviewed shortly!";
mail($to, $subject, $body);
} else {
echo "You have submitted an invalid form, please try again.";
}
?>
</div>
</body>
</html>

I don't want a small and large image part of my form anymore for http://sohailtech.com/contact.html. I will an image box that will make two resized images from the link, upload it to my server, and send the image through HTML in a message... Do you think you could do that, i am willing to pay you 200 credits for this... By the way, i want it to send it in HTML (with all the simple tags like body, and header...).
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
i'll see what i can do, this doesn't seem like it should be too hard.
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
How long will it take you? I haven't seen a reply in over 3 days... :(
 

VPmase

New Member
Messages
914
Reaction score
1
Points
0
For you sohailamir52 its easy:

PHP:
<?php
if(isset($_POST['submit'])) {
$to = "sohail@sohailtech.com";
$subject = "New Game Request";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$gametitle = $_POST['gametitle'];
$swflink = $_POST['swflink'];
$copyright = $_POST['copyright'];
$others = $_POST['others'];

$body = "From: $name_field\n E-Mail: $email_field\n Game Title: $gametitle\n  Game Link: $swflink\n Copyright Evidence: $copyright\n Anything Else: $others";
?>

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Submit Game</title>
<link href="/games/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="banner"></div>
<div align="center">
<div id="navigation"><a href="http://sohailtech.com/">HOME</a> • <a href="http://tutorials.sohailtech.com/content/blogsection/4/26/">FLASH TUTORIALS</a> • <a href="http://tutorials.sohailtech.com/content/blogsection/5/29/">PHOTOSHOP TUTORIALS</a> • <a href="http://tutorials.sohailtech.com">BLOG</a> • <a href="http://forums.sohailtech.com/">FORUMS</a> </div>
</div>
<div align="center"><br>
<?php
echo "Thanks for your request, it will be reviewed shortly!";
mail($to, $subject, $body);
} else {
echo "You have submitted an invalid form, please try again.";
}
?>
</div>
</body>
</html>

Then just remove the form fields in the HTML page.
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
No i'm not that much of a noob! :p You know the image part of the form, instead of having a small image link and a big image link i want to have one image form there instead and it would make two resized images of the "imagelink", one that is 129*101px and one that is 620*400px, once it has resized both images, it would upload them to the server. Is that possible?
 

kbjradmin

New Member
Messages
512
Reaction score
2
Points
0
sorry, for taking so long. i think that its possible, but i'm not sure. if you give me more time i can look some stuff up and see if i can figure it out, but no promises.
 

DarkDragonLord

New Member
Messages
782
Reaction score
0
Points
0
post.php
PHP:
<?php
$name = $_REQUEST['fullname'] ;
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;

$msg = "from: $name
$message"

if(mail(name@host.com, $subject, $msg, $email))
{
echo "/*PLACE HTML IF SEND IS SUCCESSFUL*/";
}
else
{
echo "/*PLACE HTML IF SEND IS UNSUCCESSFUL*/";
}
?>
i don't know about sending it to a database.

add this after $message

PHP:
$gomysql = "Insert Into table_name(table_row_name_for_name,table_row_name_for_subject,table_row_name_for_message,table_row_name_for_email) Values('" .$name."', '" .$subject."', '" .$message."', '" .$email."')";

sending to database is in the place of /*PLACE HTML IF SEND IS SUCCESSFUL*/
so, might be something like
PHP:
mysql_query ($gomysql);
and it will add to DB.
 
Last edited:

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
I don't want it to be in a db, is it possible to upload it to the server in a certain folder with FTP or something?
 

DeadBattery

Community Support Team
Community Support
Messages
4,018
Reaction score
120
Points
0
Sohail, DarkDragonLord was helping me with a form post.php page.
He/She was indirectly helping me. =P
I'll test it out and see what happens. But won't I have to tell it my MySQL Username and Pass?
 

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
Oh okay, i'm still waiting for my script and i am willing to pay upto 200 credits for this.
 

DarkDragonLord

New Member
Messages
782
Reaction score
0
Points
0
I don't want it to be in a db, is it possible to upload it to the server in a certain folder with FTP or something?
You want to Write the form info in a .TXT for example?



Sohail, DarkDragonLord was helping me with a form post.php page.
He/She was indirectly helping me. =P
I'll test it out and see what happens. But won't I have to tell it my MySQL Username and Pass?

he.
And ya, im helping you :p

And ya again, make a connection file (or just copy paste the code below if you think you will not use this DB for anything else)
CONN.PHP
PHP:
  <?php
$connmysql = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$connmysql) {
    die('Could not connect: ' . mysql_error());
}
?>

and then add after the <?php of main script

PHP:
 include "conn.php"


and then, BEFORE the ending ?> of the main script, add
PHP:
mysql_close($connmysql);
to close mysql connection





Here its the FULL file (single one)
PHP:
<?php
$name = $_REQUEST['fullname'] ;
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;

//Here: Connection to DB.
$connmysql = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$connmysql) {
    die('Could not connect: ' . mysql_error());
}

//Here: add 2 DB string
$gomysql = "Insert Into table_name(table_row_name_for_name,table_row_name_for_subject,table_row_name_for_message,table_row_name_for_email) Values('" .$name."', '" .$subject."', '" .$message."', '" .$email."')";  



$msg = "from: $name
$message"

if(mail(name@host.com, $subject, $msg, $email))
{
echo "/*PLACE HTML IF SEND IS SUCCESSFUL*/";

//Here: Adding stuff to DB
mysql_query ($gomysql);
}
else
{
echo "/*PLACE HTML IF SEND IS UNSUCCESSFUL*/";
}

//Here: Closing Connection to DB
mysql_close($connmysql);
?>
 
Last edited:

Sohail

Active Member
Messages
3,055
Reaction score
0
Points
36
Was that for me? When you do mine, don't forget about the resizing image thing, i know PHP can do it for sure :).
 
Top