• 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

    • In the boot options in the UEFI is set to legacy or CMS? It needs to be set to UEFI if it's not already.
    • Researchers claim Microsoft's quantum breakthrough is flawed by basic Python errors by Karthik Mudaliar Microsoft's aggressive roadmap to deliver a commercial quantum supercomputer by 2029 has now hit a bit of a snag, and it's not because of a complex sub-zero dilution refrigerator, but rather because of a few lines of basic Python code. A new critique published in the scientific journal Nature argues that simple software errors effectively manufactured the breakthrough that Microsoft's foundational research claimed back in 2025 into Majorana-based topological qubits. Topological quantum computing, the path that Microsoft chose for its research, relies on creating and controlling "Majorana zero modes." These are exotic quasiparticles that theoretically offer vastly superior error resistance compared to the highly sensitive superconducting qubits currently being championed by rivals like Google and IBM. However, physically proving you have created these particles requires sifting through massive amounts of complex electrical conductance data to isolate a specific "topological gap." Because of the sheer volume of data, physicists rely heavily on custom software pipelines to process the results. This is where the Python scripts come in. Now, according to the critique, Microsoft’s data processing software contained fundamental programming errors that ultimately skewed the published results. By mishandling data arrays or deploying incorrect logic within the Python script, the software supposedly discarded "noisy" or contradictory data. Which is why it only highlighted the specific electrical measurements that supported the topological-gap claim. The researchers behind the critique argued that this makes the findings invalid, suggesting the heralded "quantum leap" was actually a false positive generated by bad code and not a product of groundbreaking physics. However, Microsoft is pushing back hard against these allegations. The Redmond giant has formally rejected the criticism, saying that it's just a minor anomaly rather than a fatal flaw. According to the company, while there may have been a minor oversight in the data parsing scripts, it does not alter the fundamental reality of their physical experiment. Just weeks ago, Microsoft unveiled the Majorana 2 quantum processor, a milestone so significant that the company boldly accelerated its timeline for a commercial quantum supercomputer from 2035 down to 2029. But the new software allegations reopen an old wound. Microsoft's quantum division faced a remarkably similar crisis when a landmark 2018 paper on Majorana particles was famously retracted in 2021 after independent physicists discovered the data had been inappropriately cropped. That historical baggage makes the current Python-related allegations particularly sensitive. If the foundational math and data processing for the 2025 breakthrough are genuinely flawed, the highly anticipated 2029 commercial timeline could easily be delayed or, worse, cancelled.
    • Because of what they have done to VMware I will never buy anything Broadcom again.
  • Recent Achievements

    • 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
    • One Year In
      Tom Schmidt earned a badge
      One Year In
  • Popular Contributors

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

    Love Neowin? Tell a friend!