Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




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.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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?

Php - Mysql Form Field Generator
does anyone know of a simple function/class that will take config
options: table name and the database connection stuff(or whatever)
It will then print out appropriate form fields to allow editing of a
row?

The reason being is that in the admin section of a website I am
building we are constantly adding columns to a table...It is used for
keeping config options of the site. We do not wanna update the form
each time we add a column.

Links For Form Validation Class?
I am searching for a good form validation class in php which i can use for my programming. Do anybody know such links , posts? I would be very greatful if i got the good one.

Recommend A Form Validation Class
I need a good PHP form validation class that can be used to easily validate input data before entering it into DB; I need just basic functions like alpha(num)/numeric only, X-Y length only etc.

Form Submits Every Time You Request Something From Another Class?
I have html form from time to time I access methods from class forms since it contains all of the function are needed to work with forms. in the form it self I request 2 different functions from class form, the thing is when I press submit button, the form submits it self the ammount of times as the function that request data from forms.php class. Code:

Smarty Newbie Add/edit Form For Object Class
Anyone can point me to a real example (with code possibly) of an
implementation of add/edit form for a structured object class with adodb
database access layer?

Recommendation For Easy-to-use Form Validation Class Or File?
I normally use HTML_Quickform but new client's server doesn't have it and
can't get it (ipowerweb.com). So I am reverting back to my beginnings and
have forgotten how to validate forms easily.

If you know of any links to classes or files (yes, I have already searched
google) that you like and are EASY to use/implement, please post them or
links to them.

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.

Defining A Class/instantiating Object Inside A Method Of Another Class
I have a class. Inside the class I have a method that reads a text file.
In the text file I have a class name and a file name where that class is
defined. Now, I need to instantiate an object of that class, the problem
being that at the time I find out the class name and the file name, I'm
inside a method of another class. Well, let me just type up a little
example:

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...

Child Class Member's Iteration By Parent Class
I have a class that has a few private members. Is there a way to create a function in its parent class that can access its (child's) private members.

With the following code I am able to get only the public and protected members.

class parentIter {

function iterateProps ( ) {
foreach ( $this as $propName => $propValue ) {
echo "<br>$propName => $propValue" ;
}
}
}

class childIter extends parentIter {
protected $var1 = 'protected var' ;
private $var2 = 'private var' ;
public $var3 = 'public var' ;

function iterateProps ( ) {
parent::iterateProps () ;
}
}
$obj = new childIter () ;
$obj->iterateProps ( ) ;

PHP5: Can A Class Inherit Initialized Classvariable From Another Class?
I got following problem trying to inherit a variable from another class

class Core
{
public $obj;

function initialize($obj)
{
$this->obj = $obj;
}

}

class test extends Core
{
function test()
{
echo $this->obj;
// or
echo parent::$obj;
// ??
}

}

$core = new Core
$core->initialize('hello');

$test = new test
$test->test();

As far as what I would like to get, I would see 'hello', but instead I
get following error:
Fatal error: Access to undeclared static property: Core::$obj (echo
parent::$obj;)
After declaring $obj as public and static I don't get any result as
well..
Is it possible to inherit already initialized variables from a
different class or are there design patterns who could do something
like that? I hope it is clear where I want to go with this..
I am doing this because I can't give the class test any parameters
because it could be extended (class woow extends test). Also the amount
of variables is not certain and there might be lots of classes needing
to inherit the variables. That would mean that I would have to change
every class if a parameter would change..

Access Class Member Function Without Instantiating Class?
I need to access a class member function from outside the class, and hopefully without having to instantiate the class if possible?

I have an HTML form <select> and each <option> item is being pulled from an array stored in a mysql db.  But I'm doing this independently of the normal purpose of the class itself, I just want to use that member function.

Modify A Function Of A Parent Class From The Child Class ?
How do i modify a function of a parent class from the child class ?

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?

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.

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!

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.

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">

Sitemap Generator Script?
Does anyone know where I ca find a sitemap generator script?

Flat File Code Generator
I want to know how I can add breaks between table elements (html code) when it's generated from a flat file (input forms) ? Right now the code appears in one continous string, and I'd like it to be neat and tidy (breaking in the code after </td></tr> and </table>) Is this possible? Here's teh code, to show you what I mean :

http://stage.jpauldesign.com/mctl/h.../viewevents.php

Rapidshare Premium Link Generator :
I got a script from one of my friend.It is used for generating rapidshare premium links like : http://rapidfool.com/ But its not working !Code:

Six-random No Generator, But Not In Good Ordering
how to put a randomly generate in to an array, so that I can sort them with sort function?

result is:
B1 38 + 41 + 34 + 30 + 27 + 22
B2 34 + 22 + 10 + 35 + 18 + 11
B3 34 + 2 + 7 + 34 + 37 + 1
B4 30 + 34 + 7 + 2 + 27 + 25

//$holdno = array ($rno);
//sort ($holdno);
//echo sort($holdno);
//reset ($holdno);

I follow from php.net, they are wrong. I need something like:

$holdno(1)=no(random draw1)
$holdno(2)=no(random draw2)
$holdno[sixno] = $rno;
echo $holdno[sixno];

I tried this but I can't sort them.
....
....etc its very difficult, when a nos is drawn, it is not put back to pool, and continue to draw a nos. leave question 2 for the time being. PHP Code:

Can My Server Take The Load Of This Thumbnail Generator?
My server: Shared VPS
Centos 4
Equal share CPU
1GB Burst RAM
256MB RAM

My question: I have a .php file generate thumbnails on the fly. I have a moderate amount of traffic. Sometimes the gallery(s) shown can list up to 20 or so images, with fairly large thumbnails. Am I causing uneccessary server load by not just making my own thumbnails and having all these galleries generated on the fly?

Sequential Alphanumeric String Generator
I was wondering how I would generate a set of Alphanumeric strings with PHP. So the script would run and output something like:

a
b
c
d
..
x
y
z
aa
ab
ac
ad
...and so on.

Alpha would be good, although Alphanumeric would be much better. Also the option to define how many characters long the string can be would be a plus.

Permissions Problem With Sitemap Generator
I have bought a standalone xml sitemap generator online.I am new to webhosting and a newbie in all these stuff.I ahve followed all the instructions by the software provider, but still cant get my sitemap ready.
The error showing is

"config file is not writable: /home/mydomain/public_html/generator/config.inc.php
Datastorage folder is not writable: /home/mydomain/public_html/generator/data/"

however i have changes the permission of these files in my server to 0666 and 0777 as instructed. But when I try to save my configuration it shows the above mentioned error.

Calling Class Method Of Variable Class.
Yes, it's the week of OO here in c.l.php

If I want to call the method a class (not an object), one normally uses:
classname::method();

which works fine.

However, what if I don't know the classname yet?
$classname::method();
doesn't work, neither does
{$classname}::method();

I've got solved it like this now:
call_user_func(array($classname,'method'));

Syntax? How To Declare A Member Of A Class Which Is Itself A Class
how to declare a member of a class which is itself an object?

class cA
{
private $blah;
public function foo()
{
return blah;
}
}

class cB
{
private cA $a; // I want this to be of type class A
}

Temp Table - Random Number Generator
I am developing a data entry program where information is entered into a form, then submitted to a databse.

I need to be able to set up a temporary table which houses this data and then when all transactions are complete, the data in the temporary table is entered into my permanent table - then the temp table is deleted. (I won't get into the details as to why this has to be done this way)

Setting up the table is simple, however I ran into a bit of a wall when it comes to having several people entering data at the same time. If they were all to use the same temp table, then when one user finishes (and the table is auto-dropped) then other users data entry would be killed.

SOLUTION:
Use a random generator to name the temp tables, that way I can have several data entry users without running the risk of losing data when the temp tables are dropped.

PROBLEM
I don't know the best method to make a random number generator

Can anyone help, or suggest a simple, yet effective generator?

How Can I Create A Random 'Phrase' Generator Without Using A Database In PHP3???
I would like to set up a rotating, random phrase generator online. I hav a list of phrases and would like them to pop up randomly as the page is loaded or reloaded...

I've played aroud with random number generators...but how would I get phrases to show up rather than numbers?

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?

PHP 4: Does Method_exist Return True If Parent Class Method Even If Child Class Forgot To Call Parent::
My code was dying on the line below where I use method_exists:

if (class_exists($nameOfClassToBeUsed)) {
$object = new $nameOfClassToBeUsed();
$this->arrayOfAllTheObjectsSoFarLoaded[$nameOfClassToBeUsed] = &
$object;
if (method_exists($object, "setCallingCode"))
$object->setCallingCode($nameOfFunctionOrClassCalling);
return $object;
} else {
$this->error("$nameOfClassToBeUsed not found. The code that wants
this class is $nameOfFunctionOrClassCalling ");
}

The method is in the parent class yet I'd forgotten to call parent:: in
the constructor of the child class. It seems to me that method_exists
was testing true, though the method was not truly available, and then
the code died. Adding parent:: to the constructor of the child solved
the problem. Is this a bug in PHP?

Class.phpmailer.php & Class.smtp.php ?
class.phpmailer.php & class.smtp.php ?

Hi friend,

anybody tried class.phpmailer.php & class.smtp.php to
sendmail?

I try to connect to mail.yahoo.com, not working.

<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
// set mailer to use SMTP
$mail->Host = "smtp1.example.com;smtp2.example.com";
// specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP
authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@...";
$mail->FromName = "Mailer";
$mail->AddAddress("josh@...", "Josh Adams");
$mail->AddAddress("ellen@...");
// name is optional
$mail->AddReplyTo("info@...", "Information");
$mail->WordWrap = 50;
// set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz");
// add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
// optional name
$mail->IsHTML(true);
// set email format to HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML message body <b>in
bold!</b>";
$mail->AltBody = "This is the body in plain text for
non-HTML mail clients";
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>


Copyright © 2005-08 www.BigResource.com, All rights reserved