Auto Generator Codes.
I know this is very easy.
what i want is a six codes generator.
Let say i have a button when i press this button it will generate six digit codes.
for example i have this code 543545.
now i wanted also when i use this code it will tell me it's the valid codes.
maybe you have the idea, just want to know the functions that i should use for this.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
PEAR DB_DataObject Auto-generator Multiple Databases
I'm using the DB_DataObject script createTables.php to auto-generate the necessary database schema on two databases. Using the .ini approach (not the in-line PHP approach) to configure DB_DataObject in my script. Everything is by the book, but I'm having a big problem: Here's my main.ini file: [DB_DataObject] database_one = mysql://user:password@localhost/one database_two = mysql://user:password@localhost/one schema_location = /home/user/classes/dataobjects class_location = /home/user/classes/dataobjects require_prefix = /home/user/classes/dataobjects class_prefix = DataObject_ And here's my database connect file: <?php // separate classes for each database class DataObject_one extends DB_DataObject { var $_database = 'one' } class DataObject_two extends DB_DataObject { var $_database = 'two' } $config = parse_ini_file('/home/user/classes/main.ini', TRUE); foreach($config as $class=>$value) { $options = &PEAR::getStaticProperty($class,'options'); $options = $value; } $DB = DataObject_one::factory("tableName"); // etc... ?> The problem is that the auto-generator createTables.php copies everything into one directory, regardless of the number of databases you enter in your .ini file, which means, as is the case for me in this example, if you have two tables with the same name on different databases, it'll keep overwriting the same file, and the resulting class is the LAST one you enter in your .ini file. So my question is this: is there a way to specify different subdirectories for different databases in your initial configuration file? If not, is there no other solution than giving every table a unique name across an entire MySQL server if you don't want to do any coding?
Zip Codes
I have a script that will cross check a form variable against existing variables in a database and redirects visitors based on that, but, I'm also looking to extract the corresponding fields associated with the form variable and inserting that into another form that the visitor may be directed to. I understand this will most likely be an if/else statement, that says something along the lines of PHP Code:
How To Do VB Codes?
i was wondering if there is an easy (ready made) way to implement VB codes or if there is any tutorial available. nor do i need to do my own functions ?
BB Codes
I'm having trouble parsing BB codes to HTML code, I was wondering if someone could help me get started or point me in the direction of a tut, I've been trying to use PEAR but it's not working for me.
Name Generator
I’m going to be creating a username generator that gives you a few usernames you could use, based on the one you asked to have but was taken. For example, when you signup for a hotmail account and the e-mail address you specified is already taken, it gives you a few choices to pick from based on DOB, age, etc., or create your own custom one again. The thing I’m going to be making is very similar. Instead stead of generating some names based on your DOB, age, etc. it will just give some names with numbers added on, or whatever the guy I’m making it for wants it to operate. Like I enter in Epsilon and it is taken, it then gives me something like Epsilon2002 (Based on the current year), Epsilon_, Epsilon- and so on.
PHP Displaying Codes
I installed PHP manually on windows XP (just trying to do things manually) with Apache 2 and Mysql 5. Everything seems working fine. Now i saw very strange problem here, When i write any php code i use <?php ?> and if i dont put PHP after <? then my php code doesnt work.. it displayed code as it is in browser. Even previously i was able to run php without writing PHP after "<?".. can anyone tel me where i am wrong?
With Codes - Need To Resize
Hi, I am having problems resizing a text. What is wrong with the script? <td><size=6>For payment information, please contact us at (021) 221100 or at <a href="mailto:info@altha.com">info@altha.com</a></size></td>
BB-Codes Question
I've made a BB-code script, but I'm wondering about one thing. I want to have a maximum allowed size when using [size='x'][/size]. Here is a sample code snippet of my bbcode script: function format_bbcodes($text) { $text = preg_replace("([size=(.+?)](.+?)[/size])is",'<span style="font-size: $1px">$2</span>',$text); return $text;}
PHP 5 Or PHP 4 Compatible Codes
I haven't yet moved to PHP5. But, interested to know how many of you _really_ started using it or moved? Are you doing any compatible tweaks specifically for PHP 5 (forward compatible) or PHP 4 (backward compatible)?
Echoing Codes
I have a simple script for an IFrame for my forum page... <?php if(!isset($_GET['post'])){ echo '<iframe src="/forum/" name="fleet" width="800" height="auto" scrolling="no" frameborder="no" id="fleet"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>'; }else{ echo '<iframe src="/forum/viewtopic.php?p='.$_GET['post'].'" name="fleet" width="800" height="auto" scrolling="no" frameborder="no" id="fleet"> Your browser does not support inline frames or is currently configured not to display inline frames. </iframe>';} ?> Whenever I open the page, it does not automatically expand to the framed page height, how can I fix this...?
Newsletter Codes
do you happen to know a ready scripts for newsletter sending and can be send to several number of emails taken from the database?
Password Generator ?
I want the password to generate a 8 character long and the password is A-Z, a-z, 0-9.
Looking For A PHP PIN Number Generator
I am looking for a script that generates PIN Numbers. Is there one available somewhere out there? I don't mind algorithms if they will be easy to implement in PHP.
Site Generator
Has anyone got any scripts that will, after a person registers, it will automatically create a directory for them?? Example: User Registers -> Confiration Page -> User may now go to http://mydomain.com/registeredusername with a default index.hml file Also a File Manager. Does anyone know how to do this or where i can find such a script?
Code Generator
Does anyone knows a code generator for Php ? Actions to do: specifiy a mysql table and their fields, and build a default webpage which allows to add,update,delete,search, browse, print the table data.
Site Map Generator
i was just wondering would it be possible to create a site map, where by you enter a URL and then it searches through the site and outputs this on a page. I know I've used a package which does this, but interested to see if it can be done using PHP?
Random Generator
This might seem a stupid question but here goes - I wrote a key generator for one of my programs in Visual Basic, so I recieve sales notification via email and then use my program to generate the key and send it via Email. Well after finding out about PHP, and that my host does PHP, I thought it would be quicker and more reliable to generate the keys on the server and send them out again either vai email or from the sales site. So I wrote the generator in PHP and surprisingly it works, or rather it works in a half assed fashion, I can generate keys, but they are not the same as the ones generated by my VB program. And here is my problem, I suspect its becuase I'm using a randomised Seed, and I'm thinking that VB and PHP Randomisers are not compatable. Am I right in my thoughts and if so, is there a way around it? Is the only answer not to use a randomiser? or how do people generate keys from the server when using other languages ie C++ etc?
Thumbnail Generator
Does anyone have a demo to look at for a very simple thumbnail generator for a jpg image? If a user uploads a jpg, and then a thumbnail is made of it.
Quiz Generator...
I have been doing through the web to search for a test/exam quiz generator that generate quiz, test and provide statistics. Most of them are commerical. Are there open source program for it in php?
Standalone Sig Generator
I currently have my sig generator running, the problme Im facing is that it outputs like this http://mysite.com/image.php?sigimage.png I need to have it out put like this -> http://mysite.com/image.png?sigimage.png or something like it because a lot of sites do not allow image.php. Code:
PHP Screenshot Generator
Does anyone know of any real-time screenshot generator? Where you can give the PHP file a URL and it will convert that URL page into a JPEG image with GD? I have had a look around and only found a few but none seemed to do this job. Anyone?
Table Generator
I have this way of getting a webpage to include a table from a comma separated file. Works well for purpose I have used up to now but wish to extend it to generate a table with a top row of cells of type th. So two questions about this: 1. What exactly should the code be to enable this and 2. How should the csv file be formatted (if different from normal comma...
Blocking Html And Php Codes
I am setting up a simple news submission system at my site and I want to know how to filter out or block people from inputting php or html into the site so as to block malicious posting. How do I get that to work?
2 Adsense Codes But Want To Show Only One
I use only one adsense block on my pages. My pages are usually in wdget.php - widget-blue.php form and there are links on them to some articles. However, when a person clicks on article link they go to widget.php?showfulli_etc. etc. and since I implemented one more adsense code in my script when a person goes to the article page. They see the adsense codes which is the regular one (the first one on wdiget-blue.php and the one in the script which is the second one. What I want is I don't want to show the first adblock when my visitor goes to the article page (widget.php?showfulletc.) instead i want to show the which i implemented into the script. I was wondering if there is any script will disable the first one when a visitr goes to the article page and will show only the one which is implmeneted in the script.
Sending Error Codes
I am having trouble sending error codes to the browser from my php page. I want to send a 401 Unauthorized, and a 404 not found. I have tried these (in seperate documents): header("HTTP/1.0 404 Not Found"); header("Status: 401 Unauthorized"); I put a single header at the top of the page but I received a blank document in return. What else do I have to do send error responses in PHP?
ANSI Character Codes
I looked in the PHP manual and I couldn't find what I was looking for. I need a function that will return the ANSI code value for a character. E.g. "a" should return 97. In ASP the function is Asc() if that helps anyone (I'm switching from ASP to PHP...)
Get Http Response Codes
I have a website in php in which I have some kind of portal to external links that come from a database. When a user clicks on a link, "link.php" is called, does some stuff (e.g. adds 1 to the visit-count of that certain page) and then forwards the user with a location-header to the asked page. Now my question: is it possible to get the response-code of that asked page? E.g. when code 404 is returned, I can put that in the database and then it's easy for me to know when a link is broken.
Sending HTTP Codes
How can i send a http response code 200 to google checkout? Obviously I have the url to send to!
Password Generator- Unique?
I have a script that is supposed to generate unique passwords. Trouble is its producing passwords that already exist in the 'personaldetails' table. i don't think I'm the lucky type that wins the lottery everyday so it its not by chance - there is an error somewhere. (the userid is primary key and is autoincrement, I know thats not a standard way of doing it but that isn't causing this error) The script is: if ("SUBMIT"==$generate){ $String = "This is the text which will be encrypted so that we may create random and secure passwords!"; $Length = 8; // Change this value to indicate how long your passwords should be. 32 character limit. $String = md5($String); $StringLength = strlen($String); srand ((double) microtime() * 1000000); $Begin = rand(0,($StringLength-$Length-1)); // Pick an arbitrary starting point. $password = substr($String, $Begin, $Length); print ("Your recommended password is:<P><BIG>$password</BIG> "); // Add the password to the database. $sql = "INSERT INTO personaldetails SET " . "firstname='$firstname', " . "surname='$surname'," . "password='$password'," . "teacherstatus='$teacherstatus'"; if (mysql_query($sql)) { echo("<P>Your password has been added to the database.</P>"); } else { echo("<P>Error adding password to database: " . mysql_error() . "</P>"); } $Query5="SELECT userid FROM personaldetails WHERE password='$password'"; $result5=mysql_query($Query5) or die ("Can not execute query:" . mysql_error()); print("Your userid is " . mysql_result($result5,0) . ". This has also been added to the database. "); } I don't understand why its not generating unique passwords. As, a consequence I'm bringing back the userid for the password that was already in the table, I end up with 2 people sharing the same password and and the generator reports they have the same userid ( when I look in the table the newest row has been added and has a userid which is different to the userid of the other person in the table who has the first copy of the password. My query to bring back the userid is bringing back the userid of the first row it comes to that has the 'unique' password entry, unfortunately the password is not unique and so I get the wrong persons userid? - can you spot what is wrong with the generator?
Random Number Generator
<?php function get_random_number_between($start, $end) { srand((float)microtime()*1000000); $random_number=rand($start,$end); return $random_number; }; echo get_random_number_between(2, 4); ?> Could anyone suggest how to modify this code to output a float between 2 and 4 with 2 decimal places?
Password Generator- Unique?
I have a script that is supposed to generate unique passwords. Trouble is its producing passwords that already exist in the 'personaldetails' table. i don't think I'm the lucky type that wins the lottery everyday so it its not by chance - there is an error somewhere. (the userid is primary key and is autoincrement, I know thats not a standard way of doing it but that isn't causing this error) The script is: if ("SUBMIT"==$generate){ $String = "This is the text which will be encrypted so that we may create random and secure passwords!"; $Length = 8; // Change this value to indicate how long your passwords should be. 32 character limit. $String = md5($String); $StringLength = strlen($String); srand ((double) microtime() * 1000000); $Begin = rand(0,($StringLength-$Length-1)); // Pick an arbitrary starting point. $password = substr($String, $Begin, $Length); print ("Your recommended password isP><BIG>$password</BIG> "); // Add the password to the database. $sql = "INSERT INTO personaldetails SET " . "firstname='$firstname', " . "surname='$surname'," . "password='$password'," . "teacherstatus='$teacherstatus'"; if (mysql_query($sql)) { echo("<P>Your password has been added to the database.</P>"); } else { echo("<P>Error adding password to database: " . mysql_error() . "</P>"); } $Query5="SELECT userid FROM personaldetails WHERE password='$password'"; $result5=mysql_query($Query5) or die ("Can not execute query:" . mysql_error()); print("Your userid is " . mysql_result($result5,0) . ". This has also been added to the database. "); } I don't understand why its not generating unique passwords. As, a consequence I'm bringing back the userid for the password that was already in the table, I end up with 2 people sharing the same password and and the generator reports they have the same userid ( when I look in the table the newest row has been added and has a userid which is different to the userid of the other person in the table who has the first copy of the password. My query to bring back the userid is bringing back the userid of the first row it comes to that has the 'unique' password entry, unfortunately the password is not unique and so I get the wrong persons userid? - can you spot what is wrong with the generator?
Form Generator Or Class / OSX
i am sure we all know this Problem, u build a website and want to implement a CMS, so that the content can be updated easily. So u spend half a day building Form Sets for Update insert delete etc.. Does anyone here know of a good form generator that will build this forms automaticly? Best would be a Class or something but a desktop version that runs on OSX would be great too.
PHP File Map Generator/editor
Is there some software that can map the file tree (mainly the file includes within the PHP scripts) and create a tree to show where these files are included, and from which files. Rather like UML for c and c++ kind of function?
Database Or File For Name Generator ?
I am making a random name generator, it will pick two or three words from a list and turn them into a name. It seems a database needs to work with name/value pairs, so am I right in thinking for a simple list, seperated by line breaks, a file is the most sensible choice ? If so, what happens if someone else tries to write to the file whilst I am working with it ?
Random Signature Generator
I'm trying to find a script for use on vB that will randomly generate a banner image (from a few images that I select in advance) when it loads in my signature. I've seen them at work, but can't seem to find them on, say, yahoo, or google.
Class Or Function For A Key Generator?
I need to be able to produce a string consisting of uppercase letters and numbers. I would also like it to produce e.g. a string of 6 characters all the time. A given number must allways result in same string such as "AE4YX8". Would also be nice if I could go from the string to the original number as well. Anyone with links to sites with example on how to do this?
Wanted: PHP Site Map Generator!
Having spent my free time over the last few months converting several hundred pages of mainly static (s)html into eight pages of data driven php loveliness and a whopping MySQL database I'm faced with a bit of a dilemma. Will search engines be able to crawl all the index.php?query paths so people can find stuff? I'm currently at the top of the heap on Google as my site has been around for years and is pretty niche and I don't want to lose that advantage. Which leads to the main part of the question; is there a 'site map' generator which will vreate a single crawlable HTM page with all my possible pages on iot which I can then link to from my home page which will enable the search spiders to do their thing? Or am I left with the unenviable task of having to put response/redirects on all the old pages pointing to the equivalent dynamic pages?
Random Pixel Generator
Im trying to create a program that generates random pixels from a set picture.. i know how to write a random number generator its just figuring out how to take that one step further and getting it to grab pixels from a picture and show them one by one when somebody clicks generate button. there needs to be 1,000,000 pixels in total. Raar my head hurts trying to think of a way to do it!
Secret Code Generator
The idea is that I can make a password and then encrypt it to make it safe when sending instant messages and emails to colleagues containing sensitive information. The only way I could get this to work was by entering 1 letter per box. I want to be able to type a series of letter or words into one txt area and it be converted as usual.
Random Password Generator
how can I make a password generator using php and javacript so that whenever a button is clicked it generates a random password in a text box. I've already done the password generator code. When I click on the button it generates a password but if I click it again it won't generate a different code. So is there a way to have it generate a different password each time? Right now when I click on the button it will call the javascript function to change the text in the input box to echo rand_pass(); like so <input id="password" name="password" type="text" size="71" maxlength="128" style="margin-top:2px;" tabindex="26"/> <input name="rand_pass" id="rand_pass" type="button" value="generate" onClick="generate( 'password', '<?php echo rand_pass(); ?>' );" class="Buttons">
Distance Calculation Based On ZIP Codes,etc (need Help)
Does not anyone know how distances are calculated on sites like mapquest.com and verizon.com. You type in the ZIP code or some other information and they tell you how far something is from it or businesses in a particular radius.
Mail () Display All Html Codes
i'm using the mail() to send mail to customer once they confirmed their orders. my problem is, i wnat to display my mails with tables but when i received the email, it display out all the html codes.
Delete Codes For Unix Platform
can anyone post codes for delete on unix platform. i am looking for codes that will delete a dir containing data in it.
Online Reference To Mysql_errno() Codes?
I want to do something like this: while(false == ($result = mysql_query($query)) ) { switch(mysql_errno()) { case $fixableError[0]: case $fixableError[1]: /* fix the errors */ break; default: die ("Fatal error in '$query': " . mysql_error() ); break; } } But I haven't found a satisfactory reference to the error codes. My googling has returned tonnes of references to files in the PHP source, but I'm not willing to download the source files and I doubt that they'd have the kind of error descriptions that would be useful (like, suggestions on how to avoid the error). So can someone supply an address to a reference list of these error numbers? Also, would the syntax in the "while" clause above work in PHP?
|