I need some help with a few things, firstly I need a submition form like The Web Tower.com has, and second I need a code that has the "waiting for approval" and shows the submitted form for others to see. I'm trying to make an affiliate type of site. like The web tower is, but mine will just be a directory, which is. http://thedirctory.2x.nu
I also need some help with API, but maybe i should post in the API board?
Yes to posting in the API board for API support. And do you want the form to email you or what?
Yeah to email me, and then send them to another page saying that it's going in for approval, and thanks, Also my affiliate banner/code on the same page and what ever else. Then I can add their Affiliate Banner into the Directory. when I get it/approve it.
and ok, also thanks!:)
Ok, well I'll just make it redirect to a set page for you!
What things do you want them to provide when submitting?
Ok and:
User Name:
E-Mail:
Site URL:
Site Banner:
Site Category: e.g. Anime, Computing, etc
<?
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(!isset($_POST['username']) || $_POST['username'] == '')
$error[] = 'Username is required';
if(!isset($_POST['email']) || $_POST['email'] == '')
$error[] = 'Email is required';
if(!isset($_POST['site']) || $_POST['site'] == '')
$error[] = 'Site URL is required';
if(!isset($_POST['banner']) || $_POST['banner'] == '')
$error[] = 'Banner URL is required';
if(!isset($_POST['category']) || $_POST['category'] == '')
$error[] = 'Site Category is required';
if(!isset($error)){
mail("Email Address", "New Site Submission", "Username: " . $_POST['username'] . "\nEmail: " . $_POST['email'] . "\nSite: " . $_POST['site'] . "\nBanner: " . $_POST['banner'] . "\nCategory: " . $_POST['category'], "From: " . $_POST['username'] . " <" . $_POST['email'] . ">");
header("location: ./confirm.html");
}else
echo "-" . implode("<br />-", $error);
}
?>
<form action = 'dm_email.php' method = 'post'>
Username: <input name = 'username' /><br />
Email Address: <input name = 'email' /><br />
Site URL: <input name = 'site' /><br />
Banner URL: <input name = 'banner' /><br />
Site Category: <input name = 'category' /><br />
<input type = 'submit' value = 'submit' />
</form>
That's the code that you need. Simply modify the coloured bits.
Red = Email Address to send them to.
Blue = Confirmation page (saying it's been submitted etc...)
Green = Name of the file that you save that code as. When I was testing I saved the file as 'dm_email.php' you might save it as 'submit.php'
Questions, post them.
Thanks I have uploaded it, Now how do I add the form?
The form is part of that page!
You browse to that page, and the form will appear, and then people can fill it in!
Oh I see. Is there anyway it can be displayed on the main home page?
Because I got this: http://thedirectory.2x.nu/submit.php But I want it on the home page.
Put the code on the home page
Just copy & Paste the code, and remember to change the different parts!
Ok, so the whole code? and nothing detaches from it?
Nope.
Just copy & paste it where you want it.
Ok I did, and this shows up above it:
"); header("location: ./confirm.html"); }else echo "-" . implode("
-", $error); } ?>
http://thedirectory.2x.nu/
That doesn't show up for me....
http://i185.photobucket.com/albums/x20/magedesigns/misc/dire ctory.jpg
It submits just fine though. as you can see in the form. xD
ok put the code:
<?
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(!isset($_POST['username']) || $_POST['username'] == '')
$error[] = 'Username is required';
if(!isset($_POST['email']) || $_POST['email'] == '')
$error[] = 'Email is required';
if(!isset($_POST['site']) || $_POST['site'] == '')
$error[] = 'Site URL is required';
if(!isset($_POST['banner']) || $_POST['banner'] == '')
$error[] = 'Banner URL is required';
if(!isset($_POST['category']) || $_POST['category'] == '')
$error[] = 'Site Category is required';
if(!isset($error)){
mail("Email Address", "New Site Submission", "Username: " . $_POST['username'] . "\nEmail: " . $_POST['email'] . "\nSite: " . $_POST['site'] . "\nBanner: " . $_POST['banner'] . "\nCategory: " . $_POST['category'], "From: " . $_POST['username'] . " <" . $_POST['email'] . ">");
header("location: ./confirm.html");
}else
echo "-" . implode("<br />-", $error);
}else{
echo "Not submitted correctly";
}
?>
in a file called submit.php
then:
<form action = 'submit.php' method = 'post'>
Username: <input name = 'username' /><br />
Email Address: <input name = 'email' /><br />
Site URL: <input name = 'site' /><br />
Banner URL: <input name = 'banner' /><br />
Site Category: <input name = 'category' /><br />
<input type = 'submit' value = 'submit' />
</form>
Place that where you want the form
Thanks that worked.
Now I need a little more help with the css. You see they greyish line running through the middle? well that's actually supposed to be at the top. but when ever I try to put it at the top, it wont.
Code:
- table {background: url('http://i185.photobucket.com/albums/x20/magedesigns/directory/wallpaper1.png') repeat bottom}
- table2 {background: url('http://i185.photobucket.com/albums/x20/magedesigns/directory/wallpaper2.png')repeat bottom}
The reason why it says bottom is because if I put top or middle it falls of the screen, and it's not supposed to do that. I am not sure how, or what to do with this.
Where are you using that?
This: <link rel="stylesheet" type="text/css" href="http://thedirectory.2x.nu/style.css">
It's on all pages of the site.
The background1 image is too tall, it's not just the small gradient... =/
Change the image.
Ahh ok. I think I know what I did. xD I'll download the images, and crop them so that they are correct.
I'll be redesigning it anyways later. But for now, I'll be working with what I got.
Gooood.
Ok, it's not working correctly. I changed the image, but it's still not working properly. I have the tags correctly added in the index.html, The form is what's messing it up for some reason, because if you go to another page, it'll show just fine. Not sure what's going on. But I guess I'll have to start on the redesign soon.
edit: now I'm so confused with this now... On every page it's not working properly.
http://i185.photobucket.com/albums/x20/magedesigns/directory /wallpaper1.png
The image hasn't been changed! =/
Yeah it was changed:
table {background: url('http://i185.photobucket.com/albums/x20/magedesigns/directory/gradbar.png') no-repeat bottom}
table2 {background: url('http://i185.photobucket.com/albums/x20/magedesigns/directory/gradbar.png') no-repeat bottom}
If I type top, it's totally off the page, and if I type middle it's off the page, and if I type bottom it's at the bottom of the page.
Why in the HTML have you given it a height of 400px? O.o
I don't even remember doing that. xD I have taken it out, but nothing has changed.
How do you get it all in div's instead of tables? I know Dwight did it, but I cannot remember how he did it. It'd be allot easier to work with that, then these tables.
It's best you take a look into CSS more in depth, I'm not going to be able to sit and explain the whole thing for you. But just start simple, and work up.
Yep, I got it working now! The site is nearly complete. Try for your self!
I showed him the lovely use of Include functions
and I LOVE IT! ^_^ It's allot easier!