HOME       >>       Programming

Need Some Code, Dont Know Where To Get It


Bkag

Ok on my rc forum for the track directory what i would like is a code to take the post and transfer it to this page http://forums.xisto.com/no_longer_exists/ that is not possable i would like to make a code similar to trap17s code for free webhosting request form, but i have no idea on how to do this, are there and mods or addons already able to do this?


lemonwonder

I dont really understand on what u are askingBTW: That is really wide, its double the width of my screen! Change the width man lol


gaea

Could you please be a little more specific?

What I *think* you mean (and I could be wrong, if so please correct me) is that you want the contents of http://forums.xisto.com/no_longer_exists/ to show up on http://forums.xisto.com/no_longer_exists/. If this is the case why don't you just use a script to foward portal.php to the other page? There are a bunch of ways to do this (javascript, php, etc). The method I'd recomend is the php version (as not everyone has javascript enabled, and php is serverside). It is really simple. Just make the page a php file, and use this code:

<?phpheader( 'Location: http://http://ww38.yoursite.com/new_page.html&%2339; );?>

Alternatively you could use an Iframe of the origonal page inside the portal.php page.

As far as the Xisto free hosting request form goes, do you mean the one that appears when you click the "Let's Get Started" button on http://ww2.forum500.com/?folio=9POR7JU99 ? If so, that's quite simple to make. If you give me the info you want collected, and the way you want it to be formatted I'd be happy to help you write it.

Bkag

Ok here is what i want, i want it to take the posts off of http://forums.xisto.com/no_longer_exists/ then take that information and put it on http://forums.xisto.com/no_longer_exists/ in alphibetical order with just the title of the post which is a link to the text ripped off the post on http://forums.xisto.com/no_longer_exists/

Eg.

 

http://forums.xisto.com/no_longer_exists/

 

Title of post = Example city, Example track title

 

Content of post = This is description Blah blah blah blah

 

-----------------------------------------------------------------------------------------------


http://forums.xisto.com/no_longer_exists/

Search box

 

Example city, example track title

 

-----------------------------------------------------------------------------------------------

(Clicking Example city, example track title takes us to the following)

 

This is description Blah blah blah blah

 

 

 

-----------------------------------------------------------------------------------------------

Does that explain things more clearly?

hype

He's saying that he wanted the lastest post in that particular forum to show up in his portal homepage with the topic title and post... You got get some portal addons from the phpBB mods & hacks page, which could work well with your board...


Bkag

Well not realy basicly i want it to convert posts and add it to the "track directory" which i named portal.php


Bkag

Well i have kindof diched the elaborite idea of moving the posts to a directory but i would like to do a form similar to trap17s free web hosting application form, could somone guide me on how to go about this?


farsiscript

hi dear Bkag plz change your sig image , you posting very large i think you want show your post in forum at your portal ?if you want do that you must make one portal and login at forum database and then read post info and echo at your portal


Bkag

Ok i did that with my signature by accident fixed now Anyway what i wanted to do is for the posts to be taken to what used to be portal.php and now is http://forums.xisto.com/no_longer_exists/ but i have diched that idea now and what i want now is to make a form similar to the trap 17 free webhosting request form but i dont know how to go about it. Is there a generator or somthing because i realy dont know how to code it.


shadowx

Hi, Do you mean you want a form like the hosting application with different text boxes eg:

Name [________]Location [_________]
etc
etc
etc


And you want that to automatically be converted into something like:

My name is "shadow-x"I live in "England"

is that what you want?

Bkag

Basicaly that us correct, what i want is a form saying

 

Name of track (____)

 

Address of track

 

Street address (____)

 

Town (____)

 

County (____)

 

Post code (____)

 

 

Track website (______)

 

Track Email address (_____)

 

Track description (_____)

 

 

Obviousily i want the boxes much bigger than i implicated, and the description box to be multi line.

 

Then what i want it to do is take that information and put it all in the description box

 

And i want the title box like this Town, county, name of track

 

Any idea how to code that anybody? Im lost


shadowx

I had a free hour so i decided to make this to see if it is basically what you are looking for. There is no colour scheme its just black text on a white background and the alignment and formatting is nil also but it should work perfectly. I just want to know if that is basically what you are after. Ive hosted it at my site and the URL is http://forums.xisto.com/no_longer_exists/

Just put in some test details like the ones you would expect real users to input and see if you like what it gives as ouput. If you do then i might be able to spare some time to put some colours on it and make any changes you want and then you can use it on your site. If its no good then just let me know!

Ill include the source code for anyone to improve on. Ill put it in hide tags so it doesnt take up too much room

[hide=code]
RCform.htm:

<HTML>
<HEAD>

<TITLE>
RC Track Information Form
</TITLE>
</HEAD>
<BODY>


<!-- This is very plain and boring but you can easilly change the layout and colours, if you need help im sure I can give it and so can many other people at Xisto :-) -->

<TR><TD><BR></td></tr>

<form action=submit.php method=POST> <!-- submit.php can be changed to a different name if you need to. -->

<table border=0 cellpadding=0 rows=35%> <!-- for alignment purposes-->
<TR><TD><BR></td></tr>
<TR><TD>Name of Track:</td><td> <input type=text size=70 name=trackname align=center></td>
<TR><TD><BR></td></tr>
<TR><TD><b><u> Track Address </u></b></TR></TD>
<TR><TD><BR></td></tr>
<TR><TD>Street Address (First line only):</td><td> <input type=text size=100 name=streetaddr></td></tr>
<TR><TD><BR></td></tr>
<TR><TD>Town:</td><TD> <input type=text size=40 name=town></td><tr>
<TR><TD><BR></td></tr>
<TR><TD>Country:</td><td><input type=text size=40 name=country></td></tr>
<TR><TD><BR></td></tr>
<TR><TD>Postal/ZIP Code:</td><TD><input type=text size=15 name=postal></td></tr>
<TR><TD><BR></td></tr>
<TR><TD><BR><B><U>Contact Details</b></u></td></tr>
<TR><TD><BR></td></tr>
<TR><TD>Track Email address:</td><td><input type=text size=40 name=email></td></tr>
<TR><TD><BR></td></tr>
<TR><TD>Track Website:</td><td><input type=text size=40 name=website></td></tr>
<TR><TD><BR></td></tr>
<TR><TD><B><U>Track Description</B></U></td></tr>
<TR><TD><BR></td></tr>
<TR><TD>Description:</td><TD><textarea rows=10 cols=60 name="description"></textarea></tr>
</table>
<BR><BR>
<p align=center><input type=submit value="Submit"></form></p>

________________________________________________________________________________________
________________________________________________________________________________________

submit.php:

<?

// this page proccesses the information from the information form and gives an output which the user will see.

//first get and set variables from POST

$streetaddr = stripslashes($_POST['streetaddr']);
$trackname = stripslashes($_POST['trackname']);
$town = stripslashes($_POST['town']);
$country = stripslashes($_POST['country']);
$postal = stripslashes($_POST['postal']);
$preemail = stripslashes($_POST['email']);
$email= str_replace('@', '@', $preemail);
//stops spambots finding email address and spamming the address
$website = $_POST['website'];
$description = $_POST['description'];

// got variables so do something with them. make an output for the user as a html document

//but first check if there is a website for this track
if($website == NULL) {
$web = "There is no official website for this track at the moment.";
} else {
$web="This track also has an official website located at:";
}
//Now we can tell the user if the website exsists before we try to give them a URL

$html = "<HTML><HEAD><TITLE>RC Track Information For $trackname</TITLE></HEAD>
<BODY>
<!-- again colours and layout can be easilly changed! -->
<BR><p align=center><h4><U>Information for $trackname</h4></u></p>
<BR>
<B><U>Track location details</B></U>
<BR>
<p align=left>
This track is located at $streetaddr in $town, $country, $postal.<BR><BR>
<B><U>Track contact details</B></U><BR><BR>
The track email address for primary contact is: $email<BR><BR>
$web <a href=$website target=new_window>$website</a>
<BR><BR>
<B><U>Track description</B></U><BR><BR>
<HR>
<PRE>
$description
</PRE>
<HR>
</p>
</body>
</HTML>
";

echo $html;

?>

_________________________________________________________________________________________
_________________________________________________________________________________________

[/hide]

I know the code isnt w3 standard and has no meta tags etc... but its only a skeleton to show the workings of the pages and it does work, atleast it does for me! the asthetics and finalities can be adjusted if Bkag wants the code. Please edit it and improve it and then post what you get here and then Bkag can get a variety of choices that hopefully will help!

Bkag, if you do want this its free and open source so you can change it or just do anything with it really!

and if you want i can edit it so that it will save the output as a HTML file on your website for others to see.


Bkag

That is very very good shadow and very very nice of you to do that, the only think that needs modifieng is what it outputs the title as since we have to have it by town first so when people are looking through the posts alpibeticaly (how it is going to be) they can find their towns track. thank you very much your help is greatly appriciated.P.S. as an added not realy neccesary perk is there a way that i could add in the code so that it would automaticaly copy and paste what comes out of the form into a post on the forum?


shadowx

I can modify the design easily and sort that out for you. But i dont know how to do that, i know what you mean but not how to do it. Maybe an admin here will know as its the same proccess as used in the application for hosting. Admins?

Ill just go and update the script and edit this post to let you know when, shouldnt be long

***EDIT***

Swapped things around and now have the title as the town the track is located in. While we wait for someone who does know about automatically creating a post from this information ive downloaded a phbb forum which i belive is what you are using, correct me im wrong. And im going to mess about with my version on my local machine and see if i can find a way to do this, i have a few ideas of how to send the information to the post new topic page.

the url is the same: http://forums.xisto.com/no_longer_exists/


CrazyRob

Right all you need to do is set up a rss feed from your forums to your portal to display what you want to display.i can also help you with the form shadowx created i know most form functions and how they work so what is it exactly you want with this form as your last post i didnt quite get. do you mean that the form remembers there town?


shadowx

I think what bkag means is a form that does the same as the webhosting application form, you can see that by looking in the application forum. Basically it is a form like i have created but instead of creating an ouput like it does at the moment it should redirect the user to the forum and to a page where a new topic is being made. The php should automatically create the topic title as the track location and then the message body will be the rest of the information entered on the form. then all the user has to do is double check everything and click on the button to post the topic. Correct me if im wrong bkag!I havent foubd a way of doing this, i tries using post variables but it didnt work, there might be an addon that you can install to do it for you though.


Bkag

Shadow you understand completely that is exactely what i want, i havve also been looking for a way on google but i cant seem to find one but im sure there is a way to do it and somone on here knows i am sure


Bkag

I have realised how bad i am at php all i tryed to do was add a county line and it doesnt work!

Here is the code:

.Htm<HTML><HEAD><TITLE>RC Track Information Form</TITLE></HEAD><BODY><!-- This is very plain and boring but you can easilly change the layout and colours, if you need help im sure I can give it and so can many other people at Xisto :-) --><TR><TD><BR></td></tr><form action=submittrackdirectory.php method=POST> <!-- submit.php can be changed to a different name if you need to. --><table border=0 cellpadding=0 rows=35%> <!-- for alignment purposes--><TR><TD><BR></td></tr><TR><TD>Name of Track:</td><td> <input type=text size=70 name=trackname align=center></td><TR><TD><BR></td></tr><TR><TD><b><u> Track Address </u></b></TR></TD><TR><TD><BR></td></tr><TR><TD>Street Address (First line only):</td><td> <input type=text size=100 name=streetaddr></td></tr><TR><TD><BR></td></tr><TR><TD>Town:</td><TD> <input type=text size=40 name=town></td><tr><TR><TD><BR></td></tr><TR><TD>County:</td><td><input type=text size=40 name=county></td><tr><TR><TD><BR></td></tr><TR><TD>Country:</td><td><input type=text size=40 name=country></td></tr><TR><TD><BR></td></tr><TR><TD>Postal/ZIP Code:</td><TD><input type=text size=15 name=postal></td></tr><TR><TD><BR></td></tr><TR><TD><BR><B><U>Contact Details</b></u></td></tr><TR><TD><BR></td></tr><TR><TD>Track Email address:</td><td><input type=text size=40 name=email></td></tr><TR><TD><BR></td></tr><TR><TD>Track Website:</td><td><input type=text size=40 name=website></td></tr><TR><TD><BR></td></tr><TR><TD><B><U>Track Description</B></U></td></tr><TR><TD><BR></td></tr><TR><TD>Description:</td><TD><textarea rows=10 cols=60 name="description"></textarea></tr></table><BR><BR><p align=center><input type=submit value="Submit"></form></p>[.php]<?// this page proccesses the information from the information form and gives an output which the user will see.//first get and set variables from POST$streetaddr = stripslashes($_POST['streetaddr']);$trackname = stripslashes($_POST['trackname']);$town = stripslashes($_POST['town']);$county = stripslashes($_POST['county']);$country = stripslashes($_POST['country']);$postal = stripslashes($_POST['postal']);$preemail = stripslashes($_POST['email']);$email= str_replace('@', '@', $preemail);//stops spambots finding email address and spamming the address$website = $_POST['website'];$description = $_POST['description'];// got variables so do something with them. make an output for the user as a html document//but first check if there is a website for this trackif($website == NULL) {$web = "There is no official website for this track at the moment.";} else {$web="This track also has an official website located at:";}//Now we can tell the user if the website exsists before we try to give them a URL$html = "<HTML><HEAD><TITLE>RC Track Information For $trackname</TITLE></HEAD><BODY><!-- again colours and layout can be easilly changed! --><BR><p align=center><h4><U>$town, $county, $trackname</h4></u></p><BR><B><U>Track location details</B></U><BR><p align=left>This track is located at $streetaddr in $town, $county, $country, $postal.<BR><BR><B><U>Track contact details</B></U><BR><BR>The track email address for primary contact is: $email<BR><BR>$web <a href=$website target=new_window>$website</a><BR><BR><B><U>Track description</B></U><BR><BR><HR><PRE>$description</PRE><HR></p></body></HTML>";echo $html;?>

But it seems as though it doesnt understand the new field and gets it confused with the town field/variable.

What have i done wrong?

shadowx

Strange i ran the code you had, both the html and php and it worked fine, are you sure you didnt accidentally put the COUNTY value into the COUNTRY box and thats what made it look weird? Thats what i done the first time.

 

after running it i noticed one problem with the website address, unless it was something like "http://site.com" the link made would act like a directory. So if someone put the website as "https://www.website.com/; the link created would be "http://forums.xisto.com/no_longer_exists/; and obviously that wouldnt work so ive added a little bit of code to look for "http://forums.xisto.com/; and insert it if its not already there.

 

try this code it should work, it did for me

 

[b]PHP[/b]<?// this page proccesses the information from the information form and gives an output which the user will see.//first get and set variables from POST$streetaddr = stripslashes($_POST['streetaddr']);$trackname = stripslashes($_POST['trackname']);$town = stripslashes($_POST['town']);$county = stripslashes($_POST['county']);$country = stripslashes($_POST['country']);$postal = stripslashes($_POST['postal']);$preemail = stripslashes($_POST['email']);$email= str_replace('@', '@', $preemail);//stops spambots finding email address and spamming the address$website = $_POST['website'];$description = $_POST['description'];// got variables so do something with them. make an output for the user as a html document//but first check if there is a website for this trackif($website == NULL || $website == "http://") {$web = "There is no official website for this track at the moment.";} else {$web="This track also has an official website located at:";}//Now we can tell the user if the website exsists before we try to give them a URL/////////////////////////////////////////////////////////////////////////////////////////////////////////// /////got to check for propper URL or it could find an invalid page or link back into our own directories!///$http = strpos($website, "http://");if($http == NULL) { //dodgy wedsite URL, We gotta fix it. $website = "http://$website";};//now the url is good so we can carry on ///// ////////////////////////////////////////////////////////////////////////////////////////////////////////////$html = "<HTML><HEAD><TITLE>RC Track Information For $trackname</TITLE></HEAD><BODY><!-- again colours and layout can be easilly changed! --><BR><p align=center><h4><U>$town, $county, $trackname</h4></u></p><BR><B><U>Track location details</B></U><BR><p align=left>This track is located at $streetaddr in $town, $county, $country, $postal.<BR><BR><B><U>Track contact details</B></U><BR><BR>The track email address for primary contact is: $email<BR><BR>$web <a href=$website target=new_window>$website</a><BR><BR><B><U>Track description</B></U><BR><BR><HR><PRE>$description</PRE><HR></p></body></HTML>";echo $html;?>[b]HTML[/b]<HTML><HEAD><TITLE>RC Track Information Form</TITLE></HEAD><BODY><!-- This is very plain and boring but you can easilly change the layout and colours, if you need help im sure I can give it and so can many other people at Xisto :-) --><TR><TD><BR></td></tr><form action=submittrackdirectory.php method=POST> <!-- submit.php can be changed to a different name if you need to. --><table border=0 cellpadding=0 rows=35%> <!-- for alignment purposes--><TR><TD><BR></td></tr><TR><TD>Name of Track:</td><td> <input type=text size=70 name=trackname align=center></td><TR><TD><BR></td></tr><TR><TD><b><u> Track Address </u></b></TR></TD><TR><TD><BR></td></tr><TR><TD>Street Address (First line only):</td><td> <input type=text size=100 name=streetaddr></td></tr><TR><TD><BR></td></tr><TR><TD>Town:</td><TD> <input type=text size=40 name=town></td><tr><TR><TD><BR></td></tr><TR><TD>County:</td><td><input type=text size=40 name=county></td><tr><TR><TD><BR></td></tr><TR><TD>Country:</td><td><input type=text size=40 name=country></td></tr><TR><TD><BR></td></tr><TR><TD>Postal/ZIP Code:</td><TD><input type=text size=15 name=postal></td></tr><TR><TD><BR></td></tr><TR><TD><BR><B><U>Contact Details</b></u></td></tr><TR><TD><BR></td></tr><TR><TD>Track Email address:</td><td><input type=text size=40 name=email></td></tr><TR><TD><BR></td></tr><TR><TD>Track Website:</td><td><input type=text size=40 name=website value="http://"></td></tr><TR><TD><BR></td></tr><TR><TD><B><U>Track Description</B></U></td></tr><TR><TD><BR></td></tr><TR><TD>Description:</td><TD><textarea rows=10 cols=60 name="description"></textarea></tr></table><BR><BR><p align=center><input type=submit value="Submit"></form></p>

The php and HTML you added seems fine to me!

Bkag

Thank you shadow so much you can see it implemented at http://forums.xisto.com/no_longer_exists/ it turned out great, now i need to find a way to have it go into a post!



Pages :-

Page 1Page 2


VIEW ORIGINAL REGISTER GET FREE HOSTING

Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.