Jump to content

Form Data to html, or varables


Sandcrawler

Recommended Posts

Well...I have hit a dead end in making a script for my clan website work, I want people to be able to add their own stuff to my website, and so I made up a form, and ran it into a php script, but I can't get it to write either html, or another varable out to the file.

 

The form can be found here:

http://sandcrawler.net/builds/

 

And here is the code of the build submit that the form sends out to:

 

<?php
$build=fopen("build-$Name.php","w+");

$data="<b> $Name </b><br>
<b>Professions:</b><br>
Primary: $Primary <br>
Secondary: $Secondary <br><br>
<b>Build Attributes:</b><br>
$Attribute1 : $Value1 <br>
$Attribute2 : $Value2 <br>
$Attribute3 : $Value3 <br>
$Attribute4 : $Value4 <br>
<br>
<b>Skill Bar:</b><br>
<b>Equipment:</b><br>
$Equipment

<br><b>Usage:</b><br>
$Usage
";

fwrite($build,$data);
fclose($build);

$index=fopen("builds.txt","a+");
fwrite($index,$Name);
fclose($index);
?>

 

The stuff in data is wrong, I just wanted to make sure it was writing out to the file. It was.

The builds.txt file I need it to write the links to the file created, I didn't even mess with it, and right now it just writes the name.

 

The html found here would be what I would prefure it to write out to, but even if it wrote out the varables it would work.

http://sandcrawler.net/builds/build.html

 

Thanks for any help you can offer on this...or at least tell me if what I want to do is impossible...

 

I'm still new to php, so if there is some really simple solution to this...I wouldn't know.

Link to comment
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.