• 0

Dynamic Signatures


Question

How would I make a signature that allows users to put a piece of text into my signature? I know you can use PHP, but I don't have the slightest clue about PHP

(Apart from Cutenews stuff)

Could someone make me a saple signature, very plain, and show me how to allow users to imput text into it thru my website?

Edited by TimRogers
Link to comment
https://www.neowin.net/forum/topic/301987-dynamic-signatures/
Share on other sites

Recommended Posts

  • 0
lol, Question: Is there a way to convert John's script so people dont choose their own, but have a choice of a few in a Drop Down box?

Thanks,

Pete

585764286[/snapback]

Use something like that (raw idea):

<html>
<body>
   <form action="post.php" method="POST" enctype...> <!-- Too lazy -->
   <select name="choice">
   <?
   $content = @file_get_contents( "/path/to/file.txt" );
   $choices = explode( "\n", $content );   // UN*X format, perhaps "\r\n" for Windows and "\r" for MacOS
   foreach( $choices as $key => $value )
   {
   ?>
      <option name="<?=$key;>" value="<?=htmlentities( $value );?>"><?=htmlentities( $value );?></option>
   <?
   }
   ?>
   </select>
   <input type="submit" name="ok" value="ok" />
   </form>
</body>
</html>

You know what to do next...

  • 0

Nope :( Didnt work? I get a parse error with this line:

<option name="<?=$key;>" value="<?=htmlentities( $value );?>"><?=htmlentities( $value );?></option>

Parse error: parse error, unexpected '>' in /home2/mak0sch/public_html/externals/sig/sig_index.php on line 11

:(

  • 0

lol, okay, thats all good, but i have another embarassing problem :p

http://www.wizzyworld.com/externals/sig/sig_index.php and it displays me thing nice and well (i'll figure out how to do it when i get it working :p)

BUT, change it to any of them, and then see what happens :/

Hmm, help?

I know, the file is struggling to make an image because i havent told it what to do, but, yea, what do i have to do next?

EDIT: Okay, my "post" code isnt right, but i have no idea what to do with it. It's just this:

$text = $_POST["text"]; // Or use $_GET["text"] but I really don't recommend doing so!
if ($text == "") { $text = " "; } 
$filename = "text.txt"; 
$file = fopen($filename, "w");
fwrite($file,  $text);
fclose($file);

BUT i have just seen that places what someone puts in a box in the text file. How do I make my sig_index.php file output my image?

Thanks,

Pete

Edited by TheTrainMan
  • 0

i checked that page for you and by the looks of things you havnt put your code in the php tags <?php ?>

so the code above should look like:

&lt;?php
$text = $_POST["text"]; // Or use $_GET["text"] but I really don't recommend doing so!
if ($text == "") { $text = " "; }
$filename = "text.txt";
$file = fopen($filename, "w");
fwrite($file,  $text);
fclose($file);
?&gt;

  • 0

Don't worry about it mate!

Thanks for the fix - no error's now, but no message either :p

Lol, this is soo confusing. My "post.php" file doesnt say a message to show or picture to put the message on, so it doesnt show it, just goes to a blank page - rather funny, but a bit of a b.....

http://www.wizzyworld.com/externals/sig/

&lt;?php
$text = $_POST["text"]; // Or use $_GET["text"] but I really don't recommend doing so!
if ($text == "") { $text = " "; }
$filename = "text.txt";
$file = fopen($filename, "w");
fwrite($file, ?$text);
fclose($file);
?&gt;

Now, i guess the "w" is the file name, so i shall try making that a picture to see if it works:))

Well, i DID try that but it didnt work:(( It made my index display nothing in the box://

I have figured that each time i click the "Change Signature" button, it clears out everything from the text file so there isnt anything there anymore? :pinch::

Edited by TheTrainMan
  • 0

Don't use the "w" mode with fopen( ) because if a file named "text.txt" ($filename value) already exists, it will be re-initialized: it becomes an empty file.

Moreover, in your page, some (double) quotes are missing, it's surely not the origin of the problem but anyway, it's not correct. Also, check your input names.

But I'm not sure you have understand how to create an image...

I have to go, I'll come back soon.

  • 0

I suggest you use "a" (writing) or "a+" (writing AND reading) instead of "w" and take a look at the PHP documentation about fopen( ). Note that the file pointer is placed at the end of the file.

I'm working on a ready-to-use script (which's based on Moodi's and Axon's ones), more info soon.

Edited by Sphinx Myth
  • 0

lol, okay, seems to be happy, but there is one tiny little thing wrong. . .

. . . erm, where does it display my image? It doesnt know that is it supposed to write an image or anything, its like i am missing the vital part of it.

This is really funny! I know it'll all be worth it when its done, but whats the next step? :laugh:

Pete

  • 0
I have written a sig that you can draw on, but my host dosn't have the GD module for perl installed.

Can someone host it for me?

Perhaps someone could port it to PHP since GD seems to be part of the standard install.

SigScribble

Feel free to modify/make your own :)

585776524[/snapback]

Wow, very impressive.

  • 0

I like that! I'll have a play around :D

Hmm, its a good idea, and i couldnt do anything as good, but after you've drawn on the sig - then what? There is no button saying "Submit" or anything to actually change it? BUT, then reading the instructions might help :p

I still want to crack this writing one. I just need it to actually output the image somewhere! None of the files actually seem to say that bit :s

Edited by TheTrainMan
  • 0
I like that! I'll have a play around :D

Hmm, its a good idea, and i couldnt do anything as good, but after you've drawn on the sig - then what? There is no button saying "Submit" or anything to actually change it? BUT, then reading the instructions might help :p

I still want to crack this writing one. I just need it to actually output the image somewhere! None of the files actually seem to say that bit :s

585779522[/snapback]

There is no submit button because as soon as you release the mouse the line is immediately written to the jpeg. No need to have a submit button, that is until I release the next version which will allow unlimited strokes of the mouse so you can draw a complete picture.

I have added more information on how to get it running on an IIS server. Unix people shouldn't have a problem (that I'm aware of).

I've also added a more detailed explanation of how it works.

I'm still waiting to see someone actually use the sig!! ;) (my host dosn't have the GD perl module installed)

SigScribble

  • 0

As I promised a few days ago, I made a basic "ready to use" script pack for dynamic signatures.

In this version:

_ Users choose the message, they don't send theirs (TrainMaster's request)

_ Users can suggest messages

_ Updatable swear filter (via file)

This version uses files to store data. You can easily adapt (and improve) it to a (My)SQL database use. I'll do it if asked.

Well, go to http://sphinx.myth.free.fr/sphinx/neowin to find it. There's a ZIP archive which contains the scripts + a test picture + a font (gothic.ttf).

Feel free to see it at work and to customize it, it's very basic.

I plan to add some administration functions but, for the moment, I think you're not enough lazy for that ;)

  • 0
SigScribble v1.1 released!

- Now it works with unlimited strokes of the pen!

- Added clear & save buttons

- Demo still dosn't work on my host! (sorry about that)

SigScribble v1.1

585783091[/snapback]

Keep up the good work! But, it's a pity that your script uses GD Perl because almost no host provides it. It's stupid, Perl is as useful as PHP...

  • 0
Keep up the good work! But, it's a pity that your script uses GD Perl because almost no host provides it. It's stupid, Perl is as useful as PHP...

585783177[/snapback]

Ok, I've ported it to PHP and added a load function.

Still looking for someone to host it for me :laugh:

SigScribble v1.1 (PHP)

  • 0
Ok, I've ported it to PHP and added a load function.

Still looking for someone to host it for me  :laugh:

SigScribble v1.1 (PHP)

585784690[/snapback]

OK, I'm hosting it on my personal website.

So now, we can use colors and load function :D, well done! I suggest you allow different line thicknesses and it'll be perfect!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • take your console only release and shove it. i sold my ps5 as my pc wipes the floor with it, at the point of sale i didn't envisage being ignored by one of the biggest and wealthiest developers ever because they simply can't be bothered to support a loyal user base. as i only played the single player versions, i'll be obtaining this "free" when it eventually reaches PC as an afterthought to pay for their christmas party drinks in 2029. screw me, screw you cockstar
    • Apart from Early Hiccups on Windows 11 on first install on October 6th 2021 on my old Intel 10700 daily use Desktop PC at the time, used to have issue with Bluetooth suddenly no longer working and only fix back then was always another clean install--then would work for a while. Transition to 2024 when i decided to finally upgrade that system for better support for Battlefield 2042 and Battlefield 6 later on, opted for next daily use Gaming Desktop AMD Ryzen 7 7700X and Radeon 7800XT OC 16GB. No major problems at all with this desktop, OS was clean installed way back on 10/8/2025 not long after 25H2 released. Overall i've been happy with Windows 11 Pro from the start, even minor little quirks didn't sway me. Heck i even use Windows 8 and upgraded immediately upon release back then on my old HP P6-2133W Desktop, and while the specs of that machine didn't give me top notch performance--i still was able to do what i wanted to, without too many slowdowns. Windows ME i didn't use on any of my personal systems back in the day, kept those systems on 98SE til XP released, and grabbed that immediately on release date. Kept XP til Vista Released then upgraded immediately, kept Vista til Windows 7 released, then updated immediately again
    • Broadcom: dreadful company who is destroying VMware by pricing it out of the market.
    • To be fair, it wasn't going anywhere. Even when Windows Phone could run Android APKs, Google didn't want any of it so it'd never work and the same thing happened with Windows. It was never about the store or it's users, it was always the developers and who they aligned to.
  • Recent Achievements

    • First Post
      Tom Schmidt earned a badge
      First Post
    • One Month Later
      D0nn13 earned a badge
      One Month Later
    • Rookie
      +ChiefOfNeo went up a rank
      Rookie
    • One Year In
      Tom Schmidt earned a badge
      One Year In
    • One Month Later
      Tom Schmidt earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      451
    2. 2
      +Edouard
      177
    3. 3
      PsYcHoKiLLa
      123
    4. 4
      Michael Scrip
      82
    5. 5
      Xenon
      75
  • Tell a friend

    Love Neowin? Tell a friend!