• 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

jpgodlew :

You're missing the .htaccess file that tells the server to excute .jpg as php if you have'nt noticed if you rename what you have to a .php it will be processed by the server, assuming you have PHP and GD installed.

On an apache webserver make a file called .htaccess put this into it :

<Files *.jpg>
ForceType application/x-httpd-php
</Files>

Edited by mooodi
  • 0

I placed that .htaccess file in the directory and it still is showing errors. I also uploaded a php file http://www.jpgodlew.com/siggy/dynamic.php and that doesn't display the image either. I am almost positive I have GD installed.

Thanks for your help mooodi!

Edited by jpgodlew
  • 0

One more thing...I want to have a list of messages that visitors can choose, much like timdorr's sig. Is this possible using this script? I have tried replacing the text form with this

echo "<form action=$thisfile><input type=hidden name=go value=gochange>";
echo "<select name="select"><option value="Testing Test">Testing Test</option>";
echo "<option value="Hope this works">Hope this works</option></select>";
echo "<input type="submit" name="Submit" value="Change it!">";
echo "</form></html>";

and I got this.

Also, how would you go about adding some things to the generated image like a background picture or different colored text?

  • 0

when output things via echo you need to escape the " like:

echo "<form action=$thisfile><input type=hidden name=go value=gochange>";
echo "<select name=\"select\"><option value=\"Testing Test\">Testing Test</option>";
echo "<option value=\"Hope this works\">Hope this works</option></select>";
echo "<input type=\"submit\" name=\"Submit\" value=\"Change it!\">";
echo "</form></html>";

  • 0
Ok...I have the list working...but there is a way for people to type in their own messages.  How can I check for swear words and such before the image is updated?

585716604[/snapback]

Here is a php script that does that.

<?php
function lanchk($string) {
    $obscenities = array("****"," ass ","damn","****","\$hit","bitch","######"," \@ss ");
    foreach ($obscenities as $curse_word) {
        if (stristr(trim($string),$curse_word)) {
            $length = strlen($curse_word);
            for ($i = 1; $i <= $length; $i++) {
                $stars .= "*";
            }
            $string = eregi_replace($curse_word,$stars,trim($string));
            $stars = "";
        }
    }
    return $string;
}
?>

replace the $obscenities array with your bad words. be careful though, if you put "ass" in the list, "assorted" will be turned to "***sorted".

Hope that helps!

edit:

Looks like Neowin blocked some of the curse words in my array. You should replace that array with your own words. You get the idea.

  • 0

This is a better (best?) way. In fact, it's Kingpuka's script I modified and optimized:

<?
function lanchk( $string )
{
   // '$', '\' must be escaped twice because there are used in regular expressions

   $obscenities = array( "ass", "damn", "\\\$hit", "bitch", "######", "@ss" );

   foreach ( $obscenities as $curse_word )
      $string = eregi_replace( $curse_word,
                               str_repeat( '*', strlen( $curse_word ) ),
                               $string   // trim( ) is useless
                             );
   return $string;
}

echo lanchk( "Kiss my @ss, ######!" );   // Will output 'Kiss my ***, ******!'
?>

But there's something wrong, a word like "assembly" will be replaced with "***embly"...

I'm not a regular expressions expert but it's the origin of the problem.

Somebody has an idea?

Edited by Sphinx Myth
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I doubt that Google will keep the same price... it may go up from that list published.
    • Sennheiser's audiophile grade HD 600 hits lowest ever price on Amazon Prime Day 2026 by Sayan Sen If you are in the market for high-quality audiophile-grade over-ear headphones then Sennheiser's HD 600 are a great choice for sure, especially today on Prime Day 2026 as the product has hit its lowest ever price (purchase link under the specs table down below). The Sennheiser HD 600 has long been regarded as a reference headphone for listeners seeking a detailed and natural listening experience. It is an open-back design that is built around the idea of acoustic transparency which is essentially said to allow sound waves to move freely for a more spacious and accurate presentation by reducing turbulence and the type of distortion that can result from it. At the heart of the product is Sennheiser’s proprietary driver system featuring a 42 mm driver paired with a lightweight diaphragm and aluminum voice coils. The company says this design helps deliver fast response times and better articulate sound across the audible frequency range. Comfort and durability are also key aspects of the HD 600 as the headphones feature soft velour ear pads designed for extended listening sessions. The HD 600 comes with a detachable 3-meter cable, a 6.3 mm stereo connector, and a 3.5 mm adapter for compatibility with a wide range of audio equipment. The technical specs of the Sennheiser HD 600 are given in the table below: Specification Value Transducer Principle Dynamic, Open-Back Ear Coupling Circumaural (Over-Ear) Frequency Response 12 Hz – 40,500 Hz Sound Pressure Level (SPL) 97 dB (1 V) Impedance 300 Ω Total Harmonic Distortion (THD) < 0.1% (1 kHz, 1 V) Cable Length 3 m (9.8 ft) Connector 3.5 mm Stereo Jack Plug Included Adapter 6.3 mm (1/4") Stereo Jack Adapter Weight 260 g Magnetic Field Strength 1.8 mT Driver Size 42 mm Dynamic Driver Diaphragm Size 38 mm Get it at the link below: Sennheiser HD 600: $237.00 (Sold by Electronics Expo, Shipped by Amazon US) (Was: $449.95) 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
    • So the card is targeted at headphone users - so the review should be from someone that uses this - maybe I can review a card next time.
    • I have a older F4-210 NAS, it is pretty basic, the CPU is not the fastest by a long way and only 1GB of ram, but it works fine. I don't understand the need for A.I in a NAS. It seems like A.i is being shoved into everything, if we like it or not. i will stick to my old Terramsater NAS, thankfully the OS is not being updated. Also, got myself a small NAs built using a Raspberry Pi 5. iy usesd less energy, so stays on all the time. As for the unit above, if it is as reliable as my old Terramaster Nas, then it will be a good unit.
  • Recent Achievements

    • One Month Later
      timbobit earned a badge
      One Month Later
    • One Month Later
      nates earned a badge
      One Month Later
    • Week One Done
      Almohandis earned a badge
      Week One Done
    • Rookie
      dorf went up a rank
      Rookie
    • First Post
      mike_rumble earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      476
    2. 2
      +Edouard
      170
    3. 3
      PsYcHoKiLLa
      104
    4. 4
      Michael Scrip
      88
    5. 5
      Steven P.
      70
  • Tell a friend

    Love Neowin? Tell a friend!