Click to See Complete Forum and Search --> : Simple Auto Cite script
lybrian1
02-04-2008, 04:36 PM
hi i need a bit of help making a simple script
i would like a simple auto-cite script that allows visitors to enter the nescessary information then it will be arrange in the MLA format much like easybib when it was free. this is for students like myself to easily create work Cited for a bibliography
here is an example:
Lynch, Tim. "DSN Trials and Tribble-ations Review." Psi Phi: Bradley's
Science Fiction Club. 1996. Bradley University. 8 Oct. 1997 <http://
www.bradley.edu/campusorg/psiphi/DS9/ep/503r.html>.
can any one help me i just need the code for the php part.
adeang_1
02-04-2008, 08:35 PM
I know what your talking about and I am willing to help [email address removed by bathurst_guy - please keep contact in the thread so others can participate]
lybrian1
02-04-2008, 09:01 PM
thanks for your quick reply and i appreciate your help but i guess contacting eachother outside this forum is difficult. i would like your help very much if only there was a way for use to communicate privately but the moderators of this forum would not liek that i hopethey understand that i need to discuss this privately
but nontheless i have successfully written the php codes. it is very simple php form.
now my problem is that i would like some of the fields to be optional but when some of the fields are left blank i am still left with the periods and commas.
{Form.name3}, {Form.name1} {Form.name2}. " {Form.title}."
Results:
, . "."
how do i fix this
adeang_1
02-05-2008, 08:16 PM
I think i know what you mean, but I am not sure exactly how to do it, but you could use like a string counter, and if equal to 0 or whatever replace with the character you want. I search around or make a script to show you If is possible
EDIT:
Can you post what you have so far, so I can see exactly what you are doing. I was re-reading and I think I miss understood you so can you explain more. This is what I think you said. That you want to have optional form areas, and if left blank you don't want it to print out the "." or something.
lybrian1
02-05-2008, 10:42 PM
yes know what i am talking about
ok so far this is wat i have
html page
<p>Page Title:
<input type="text" name="title" />
</p>
<p>Name of Web Site:
<input type="text" name="name" />
</p>
<p>Author's First Name:
<input type="text" name="name1" />
</p>
<p>Author's Middle Initials:
<input type="text" name="name2" />
php page:
<?php echo $_POST["name3"]; ?>, <?php echo $_POST["name1"]; ?> <?php echo $_POST["name2"]; ?>. " <?php echo $_POST["title"]; ?>." <?php echo $_POST["name"]; ?>.
as you can see when some of the fields are left blank it will still show the periods commas and quotations. but i still would like a simple script. sorry i cannot explain much further i am teaching myself as i am going along this is actually my first php script
thanks alot buddy
adeang_1
02-06-2008, 06:39 PM
This is what I have so far it doesn't check anything yet, but I will edit this later I justed wanted you to know Im still here, but anyway I will edit when I have the complete option. I think what I am going to do it check string length and strip tags, then if equal to zero do what?
<?php
/**
* @author lybrian1 & Adeang
* @copyright 2008
*/
$title = $_POST["title"];
$name = $_POST["name"];
$name1 = $_POST["name1"];
$name2 = $_POST["name2"];
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>
<form method="post" action="<?php echo $PHP_SELF;?>">
<p>Page Title:
<input type="text" name="title" />
</p>
<p>Name of Web Site:
<input type="text" name="name" />
</p>
<p>Author's First Name:
<input type="text" name="name1" />
</p>
<p>Author's Middle Initials:
<input type="text" name="name2" />
<input type="submit" value="submit" name="submit">
</form>
<?php
} else {
$title2 = $title;
$nameA = $name;
$nameB = $name1;
$nameC = $name2;
echo $title2;
}
?>
lybrian1
02-06-2008, 08:30 PM
tahnks here is another minor problem
index.html
/**
* @author lybrian1 & Adeang
* @copyright 2008
brian@simplebib.com
*/
<form action="results.php" method="post" class="style1">
<p>Book Title:
<input type="text" name="title" />
</p>
<p>Author's First Name:
<input type="text" name="name1" />
</p>
<p>Author's Middle Initials:
<input type="text" name="name2" />
</p>
<p>Author's Last Name:
<input type="text" name="name3" />
</p>
<p>Publisher:
<input type="text" name="pub" /></p>
<p>City Published:
<input type="text" name="city" /></p>
<p>Year Published:
<input name="year" type="text" size="6" maxlength="4" />
<p>Below: Leave blank if unavailable<br>
<p>Page Numbers:
<span class="style3">from:</span>
<input name="page1" type="text" size="6" maxlength="4" />
<span class="style3">to:</span>
<input name="page2" type="text" size="6" maxlength="4" />
</p>
<p>Edition:
<input name="edition" type="text" value="" size="6" />
</p>
<p>Volume:
<input name="vol" type="text" size="6" maxlength="4" />
<BR>
</p>
<TD><p>
<input name="Go" type="submit" id="Go" value="Next" />
</p>
</form>
in results.php i need it to show in this order:
Last, First M. Title. 3rd ed. Vol. 4. City Published: Publisher, 1958. 154-254.
also the "3rd ed." seems to bring me trouble and the "Vol. 4" beacuse those are optional fields.
i would prefer to talk in private seeing how you are the only one helping me
adeang_1
02-07-2008, 05:14 PM
Yo I have emailed you, and so now we can get started email me with your specific problem.