You are here: Re: Form Variable « PHP SQL « IT news, forums, messages
Re: Form Variable

Posted by J.O. Aho on 01/20/06 00:33

Nick Lazar wrote:
> Adam,
>
> Thanks for your response.
>
> Yes, you've got the gist of what I am trying to do.
>
> Basically I'm generating the number using the following script:
>
> //set the random id length
> $random_id_length = 8;
>
> //generate a random id and store it in $rnd_id
> $rnd_id = (uniqid(rand(),1));
>
> //remove any slashes that might have come
> $rnd_id = strip_tags(stripslashes($rnd_id));
>
> //Removing any . or / and reversing the string
> $rnd_id = str_replace(".","",$rnd_id);
> $rnd_id = strrev(str_replace("/","",$rnd_id));
>
> //finally I take the first 10 characters from the $rnd_id
> $rnd_id = substr($rnd_id,0,$random_id_length);
>
> The user then chooses what level of support they want, and a two letter
> option from the drop down needs to go in front of the number, (I'm using the
> switch, case method to drop the right letters in). The entire ID is then
> inserted into MySQL & e-mailed to the user.
>
> It seemed like a good idea until I ran into the problem I have outlined!
>
> I'll experiment with your suggestions.

Why not generate the code in the page that processes the users request and add
the stuff selected

$ID=$firstchar.$secondchar.$rnd_id;

If you want that the user sees the ID while they choose the two letters, then
you need to use javascript to manipulate the HTML page or else you need to
resend the whole form each time you make a change which is a bad idea as it
generates quite a lot of traffic.


//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация