webforms+mydata=html(output)
- Started
- Last post
- 17 Responses
- graham414
Hello, I am somewhat in a dilemma.
I need to hand code some info. Looks a lil like this.
<div id="1">
<div align="center"><span id="span1"><img src="#" width="100"></span>
</div>
<div id="2"><span class="1a">INFO <br>
<a href="#">Info</a><br />
</span> <span class="1b">Info<br />
</span> <span class="1c">Info<br />
</span> <span class="1d">Info</span>
</div>
</div>I'd like to create a page on my server, where I can enter in fields information and have it spit out to that code with my data inside of the HTML.
Anything would help me right now thank you for your time.
- doctor_shim0
You want to make form fields?
- mikotondria30
or you want to semi-automate making some static html ?
- along those lines, the site im working with is in ASP, but I hand code the infograham414
- graham4140
yes sir, but I would like to just put the info in and have the HTML with the info placed inside of the DIVs
- moth0
you've lost me.
- graham4140
^ that makes sense, I just need some links or something maybe, to show me how to make text fields where I insert stuff and when i click the submit, it would output that scheme from the top with whatever info i put into the boxes.
- doctor_shim0
Oh! Let me know if I got it. You want:
(1) A page with form fields. User fills in the form, then is forwarded to (2) a second page which displays the values the user filled out in #1.Right?
- graham4140
Actually I want it for myself, im trying to raise my productivity
- moth0
You need PHP and MySQL then.
- moth0
However. If what you want is a to-do list - there's load of free apps for that shit online.
- doctor_shim0
You want this in ASP, right graham414? (Not ASP .NET, just ASP 3.0; 'classic ASP' as they call it.)
- graham4140
Well, I dont need it in ASP, I could upload it to my personal server and do it with PHP. The site im working on is in ASP and I dont have too much backend access so I mainly hand code special things on the CMS.
I figured something like the web fields and output code would save me a lot of time because i never really go to design view.
- moth0
I'm gonna duck out of this. You're not making enough sense. Sorry..
- doctor_shim0
You seem to be very new to this, so anything we'll say might throw you off. So be patient! Here's what I recommend for PHP. (I hope it's formatted right!)
<form name="contentForm" action="<?php print $_SERVER['PHP_SELF'];?>">
<div id="1">
<div align="center">
<span id="span1"><img src="#" width="100"></span>
</div>
</div>
<div id="2">
<span class="1a">
<input type="text" name="Info1a" value="<?php print $_POST['Info1a']; ?>" /> <br>
<a href="#">Info</a>
<br />
</span>
<span class="1b"><input type="text" name="Info1b" value="<?php print $_POST['Info1b']; ?>" /><br /></span>
<span class="1c"><input type="text" name="Info1c" value="<?php print $_POST['Info1c']; ?>" /><br /></span>
<span class="1d"><input type="text" name="Info1d" value="<?php print $_POST['Info1d']; ?>" /></span>
</div>
<button name="submit" type="submit" value="Go >" />
</form>
- acescence0
so you'd basically be copying and pasting into form fields rather than copying and pasting into an html doc? this is not making much sense to me.
just put placeholder identifiers where you want the info to appear and do search/replace with the text, and save?
- graham4140
^ thanks, so all I would need to do now, is change the div ids and the span classes to my CSS and the outputted data would basically be good enough for cut and paste.
Thats like so cool to me you wouldnt even believe me.
- graham4140
And nothing really would throw me off, I feel very intuitive at times, I take my prior knowledge and apply it to whatever comes to me
- neverblink0
$myData = // array filled with your data (in arrays)
$outputDir = "outputfiles/"if(is_writable($outputdir)){
foreach($myData as $data){
$fileContent = "<div id=\"1\">
<div align=\"center\"><span id=\"span1\"><img src=\"".$data['imgsrc']."\" width=\"100\"></span>
</div>
<div id=\"2\"><span class=\"1a\">".$data['1a']."<br>
<a href=\"".$data['link']."\">".$data['1a']."</a><br />
</span> <span class=\"1b\">".$data['1b']."<br />
</span> <span class=\"1c\">".$data['1c']."<br />
</span> <span class=\"1d\">".$data['1d']."</span>
</div>
</div>";
$filepath = $outpurDir.$data['1a'].".html";
$handle = fopen("$filepath", "w");
$fwrite($handle, $fileContent);
fclose($handle);
}
}- ok imma see how i can manip this code also thanksgraham414
- it creates a new html-file for each array in $myDataneverblink