• 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

    • Age of Empires Mobile comes to PC, here's how to carry over progress from your phone by Ivan Jenic Image: YouTube/Microsoft Microsoft just released Age of Empires Mobile for PC. The game, officially called Age of Empires Mobile: PC Edition, is available for free on Steam and Microsoft Store, almost two years after its initial release for handheld devices. Age of Empires is one of those franchises that entire generations grew up with. The original came out in 1997, and immediately got people hooked to building civilizations and crushing their enemies on the battlefield. However, the franchise today is a far cry from its roots, as Age of Empires Mobile is, well, a game optimized for handheld devices, and not a classic RTS title we’ve all loved for years. And, of course, it includes in-game purchases. The PC version is still a mobile game at its core, but it’s been optimized for desktop play. There’s mouse control, full keyboard compatibility, and a refined UI. Microsoft also refreshed the visuals with some 4k textures, so the game should look better on larger screens. The game supports Crossplay, so you can switch between your phone, tablet, and PC without losing anything. But linked progress doesn’t come out of the box, as you have to enable it first. Here’s how to link your progress: On your mobile device, open Age of Empires Mobile. Go to Settings (Gear icon) > Account. Select Bind Account and choose a sign-in option. Once you enable account binding, sign in on PC using the same method, and your progress will be accessible across all your devices. Xbox Game Pass subscribers also get a bonus reward pack on PC, which includes: 1 Monthly Pass Token 1 Custom Resource Chest 10 Universal 60-Minute Speed-Ups 1,000 Empire Coins Exclusive Player Portrait Frame You can find more info about Age of Empires Mobile: PC Edition, as well as download links, on the Age of Empires official website.
    • Apple Watch Series 11 GPS just crashed to 30% off in this fast-moving Prime Day deal by Karthik Mudaliar The Apple Watch Series 11 is available for $279, down from its $399 list price, saving buyers $120, or 30%. Amazon labels the offer as selling fast, so the current price may not remain available for long. This GPS model features a 42mm aluminum case, an Always-On Retina LTPO3 OLED display capable of reaching up to 2,000 nits, and an Ion-X glass surface with improved scratch resistance. Apple rates Series 11 for up to 24 hours of normal use or up to 38 hours in Low Power Mode, with fast charging providing up to eight hours of use from a 15-minute charge. Health and fitness tools include sleep scoring, temperature sensing, ECG support, heart-rate alerts, workout tracking, sleep apnea notifications, and hypertension notifications, where available. The watch also carries IP6X dust resistance and 50-meter water resistance. This configuration is best suited to iPhone owners who want comprehensive health tracking, notifications, contactless payments, and workout data without stepping up to a larger or cellular-equipped model. The smaller case should also appeal to buyers who prefer a lighter watch, while the S/M band fits wrists measuring 130mm to 180mm. With the current generation now significantly below its usual retail price, this is a strong time to replace an aging Apple Watch or buy a first model without compromising on Apple’s newest health and display features. Grab the discounted Apple Watch Series 11 (sold and shipped by Amazon) Good to know This Amazon deal is U.S. specific, and not available in other regions unless specified. We only use first-party seller links (at the time of article publishing); ensure that you purchase from a first-party seller link only. Check out Today's Deals on Amazon | or our recent tech deals. Become a Prime member (for Students or SNAP) via Neowin Get Prime Access - Prime for half price (for qualifying Medicaid, EBT, SNAP) Subscribe to Prime Video, Audible Plus, Music Unlimited or Kindle Unlimited via Neowin As an Amazon Associate, we earn from qualifying purchases.
    • The laptop in the bedroom is an Acer with i7-10510U CPU. Acer's website states they will not be upgrading it so I had little choice other than disable secure boot. I know next to nothing on these matters so hopefully it will be fine.
    • GitHub removes manual model selection from Copilot free and student plans by Karthik Mudaliar GitHub is removing the ability to manually select an AI model from its Copilot Free and Student plans, making its automatic routing system the default and only way to choose a model. This means users on these tiers will no longer be able to deliberately select a particular OpenAI, Anthropic, Google, or Microsoft model for a task. In its announcement, GitHub said Copilot Auto will dynamically choose what it considers the best model for each request. Free and Student accounts will retain access to models from multiple families, although the available selection will continue to depend on the restrictions attached to each plan. GitHub did not identify a fixed pool of models that Auto will always use, and its documentation warns that model availability can change over time. GitHub describes Auto as more than a random fallback system. On supported surfaces, its task-optimization technology evaluates the complexity of a request alongside real-time information about model health and availability. Straightforward prompts can be routed to faster and less expensive models, while more demanding coding tasks may be sent to higher-cost reasoning models. The company says this approach should reduce rate limiting, latency, and failed requests. Auto generally selects one model along natural prompt-caching boundaries rather than repeatedly switching models during a session, as GitHub found that mid-session changes increased costs without producing sufficient improvements in output quality. Users can still check which model generated a response. In Copilot Chat, the information appears when hovering over an answer, while Copilot CLI and the Copilot cloud agent display the selected model alongside their output. Auto is available in Copilot Chat, Copilot CLI, and the cloud agent, with the exact implementation and release status varying between supported development environments. The latest restriction follows several months of adjustments to Copilot’s individual plans. GitHub temporarily halted new Pro, Pro+, and Student subscriptions in April as it sought to manage demand and service reliability. It later introduced token-based billing and began gradually reopening individual-plan registrations on June 17. Alongside the picker change, GitHub is retiring the “Preview” label from Microsoft-developed models. It argues that the label is no longer necessary because Auto handles model routing and models are continuously updated behind the scenes.
  • Recent Achievements

    • One Year In
      Philsl earned a badge
      One Year In
    • Dedicated
      Scoobystu earned a badge
      Dedicated
    • 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
  • Popular Contributors

    1. 1
      +primortal
      460
    2. 2
      +Edouard
      177
    3. 3
      PsYcHoKiLLa
      124
    4. 4
      Michael Scrip
      79
    5. 5
      Xenon
      76
  • Tell a friend

    Love Neowin? Tell a friend!