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




Auto Generate A Number


I use an online ordering system. Is there a way to automatically generate a random 6+ digit unique number and also print the number on the confirmation page? I dont use mysql or any database. Here is the link for the actual page. You can go ahead and submit something (just use "Test" on the name field) Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Auto-generate Thumbnails For Video/flash Files?
I'm wondering if there is a (good) way to auto-generate a thumbnails for video (.avi, .wmv, etc.) and flash (.swf) files and display them in a page.

Basically, i want to be able to list the files in a directory containing these file types, and have a thumbnail displayed for the file, w/o having to create thumbnails for the files manually (thus, making the site easily updated).

Is it possible? i do not have SQL installed on this server, and (as of now) the owner of said server has no plans on installing it. I'd complain, but he's hosting for free... soo... herein lies said problem.

Generate From Number.
I need a good method to generate a random number based on a different number. Here is the code i have now, but it doesn't work. Code:

How To Generate Random Number
i want to generate a string which contains 5 characters and all 5
characters are randomly generated means it is not fixed that which
string i will get after i execute function.

so tell me random number generation in php

Generate A Number On Screen...
i have a screen where i register a new patient into the system. way the system works now is that user enters the patient details(first name, middle initial, last name, dob, sex, insuracne, and so on). along with this user also enters the patient # for each patient(its a 9 digit unique number - on the lines of the ssn). the system validates this field upon submittin gthe page. it should contain only numerics ad shoud be 9 characters long. it returns an error message if this field does not match the validations.

the new requirement now is that user should allow (automatically) a number (18 characters - alphanumeric) to be generated when page is loaded. user can either keep this number (system generated) or should be able to enter a new(numeric - 9 digits) when registering a patient. they can come back later and edit it with a proper patient number.

is there a way i can put a check-box or somethign which i can check and then be able to enter alphanumeric value(18 digits) in the same box (used for 9 digit patient number)? Code:

Generate A Unique Number
i have a screen where there is a field called patient #. this is a text write in field. this field should already display a number(can be anything - alphanumeric) when page loads. user can either retain the same number or type in another number on top of it and hit submit to retain whatever was chosen.

is there a way we can auto-generate a number( a function or something like that) that i can use to populate this field? at  this time, user can only enter a number(all numerics) in this field. i should let them either write in their number or keep the system generated number.

Generate Random Number Daily.
how to program in php and for a site I am making I need to create a script that generates a random number every day. I have written this so far and unfortunately it is not giving me the results I need. Code:

Auto Number
How to generate auto number for php? For example, every time I submit the details to another page, the number will add from 10001 to 10002.

Generate A Random Number & Check DB To See It Is Unique
I have a registration form that once submitted inserts the values into a mysql db. Its a registration form for a trade account (eCommerce site) - basically once a company applies for a trade account, i'd like an Account Number to be generated automatically however obviously this needs to be unique.

So ideally i'd would like it to randomly generate an 8 digit number and then check the database to ensure it isn't already in use.

Get Last Auto-increment Number
I am inserting related data into 2 tables. The first table I insert into has an auto-incremented field. The second table i insert into has a field which needs to hold the same number as the number in the auto-increment field from the first table. I cannot auto-increment the field in the second table because the number will occur more than once in the second table.

How can I retrieve this auto-incremented number from the first table?

Get Auto Number On Insert
i need to implement it in PHP so im posting this here. i have a table that auto numbers each row, and i need to get the primary key of each now row as it is added for further use.... for example: PHP Code:

Grabbing An Auto Increment Number??
I am entering information in to a database. Everything enters 100% fine, the first column is an auto_increment id number. What I want to do is enter information in to another table, but I need to use that id number that is generated in one of the columns. (and it has to be pretty much instant with the first one, its for a register form) Is this possible? If so, how would I do it?

Replace Hex Number Or Decimal Number In A String ?
String may contain alphanumeric values. What is the bestway to replace a hex number such as 0x122aaa and decimal number such as 5678 with a string "blah" Example: I want to replace below--

wr_thru1 data or mask mismatch!! for addr=0x00000b73a0540 & mdfid:11
with
wr_thru1 data or mask mismatch!! for addr=hexVal & mdfid:decVal

Order Number Or Tracking Number
I need to create some kind of random number within a persons session that can be inserted into a customer id column for their orders, customer, and credit card tables.

Unless their is a better way to link a customers information together between a few tables besides using auto increment. Things could get screwed up for me if I use auto increment, especially if someone submits their information but does not actually place an order.

My question is " How can I create a random order number that can be used within a persons session and will stay the same throughout the whole program for that one person? "

Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10.

I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???

Generate HTML From PHP
I am just wondering if it is possible to save a HTML string from PHPs?
Let me elaborate more on what I mean.

If you do
<?php
include 'abc.php'
?>

//abc.php
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
<?php $a_number = 5?>
<javascript ...
<?php echo $a_number ?>
/javascript>

I am looking for a way to display only HTML and javascript and have
$a_number replaced with 5.

I need something that will display resulting HTML of PHP execution. So
if there are functions or database queries in PHP, the HTML string
will reflect the result of function execution or retrieved result from
database queries. Not the function definition or database query
strings.

In other words, process a seperate PHP file and return its HTML output
like the INCLUDE function, but do not output it (instead set it to a
variable value).

This Page Took To Generate
Ive seen it on a couple of sites. I would be interested in this, but not only for a search or something. Basically I want it somewhere on all pages, so it should compute how long it takes for PHP to generate the entire page, including the time thats wasted building up content gathered from MySQL queries ....

XSL Generate-id Problems
I used the xslt functions with php4... now i've moved to php5, and, as
the xslt functions are no longer bundled, i'm moving the code to the
XSLTProcessor class.

I've found a problem with the generate-id() XSL function... with the old
functions, generate-id() gave me the same id for the same section of my
XML document every time i processed it. Now, with the XSLTProcessor
class, every time it gives me a new id.

This is not how it's supposed to work, as it is impossible to make
references to sections of the document.

Am i doing something wrong or the new classes are a bit buggy?

Generate All Possibilities
You know them brute force password crackers... Just give the min/max
passwordlength and the character scope in which they have to search.

min length: 1
max length: 7
scope:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR STUVWXYZ01234567890!@#$%^&*()_

Generate A Erport?
i want to ask is it possible to write a php code to generate the report about the database?

Generate An Image On The Fly
I have an interesting problem when trying to generate an image on the fly. Here are two pieces of code:

PHP To Dynamically Generate XML
I am interesting in using PHP to dynamically create an XML document and
then use XSLT to transform to XHTML. I have come across two methods for
doing this. I made two equivalent examples so you can see what I mean.

http://members.shaw.ca/petermichaux...SLT_method.html

I am interested in critisim of how I implemented each method. However
my main problem is deciding between methods. Which method is better for
bigger programs where the bits of the XML data are assembled by various
php functions that I write?

For example, one php function queries a database table for a list of CD
titles. A second php function loops through this CD title list and gets
the track listing for each CD from another table in the database. Then
the composite XML data (ie. CD title and tracks as nodes) can be
tranformed to XHTML.

Ssl And Php (generate Certs)
I want to generate ssl certificate (with public key) and private key. My
code:

$ssl_configargs = array(
"digest_alg" => "sha1",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_RSA,
"encrypt_key" => false
);
$dn = array("countryName" => $_POST[ 'country' ],
"stateOrProvinceName" => $_POST[ 'state' ],
"localityName" => $_POST[ 'city' ],
"organizationName" => $_POST[ 'org' ],
"organizationalUnitName" => $_POST[ 'unit' ],
"commonName" => $_POST[ 'name' ],
"emailAddress" => $_POST[ 'mail' ] );

$numberofdays = $_POST[ 'days' ];

$pkey = openssl_pkey_new( $ssl_configargs );
// there is a error
$csr = openssl_csr_new( $dn, $privkey, $ssl_configargs );
$sscert = openssl_csr_sign( $csr, null, $privkey, $numberofdays );

openssl_csr_export( $csr, $csrout );
openssl_x509_export( $sscert, $certout );
openssl_pkey_export( $privkey, $pkeyout, $configargs[
'licence_pwd' ] );

I've tried use openssl_pkey_new without param ($ssl_configargs ), but it
still doesn't work.
My errors:

Warning: openssl_csr_sign(): key type not supported in this PHP build! in
xx.php on line xx

Warning: openssl_csr_sign(): failed to sign it in xx.php on line x

Warning: openssl_x509_export() expects parameter 1 to be resource, boolean
given in xx.php on line xx

Warning: openssl_pkey_export(): key type not supported in this PHP build! in
xx.php on line x

Generate MIDI CC
I have done many searches and cannot find the information I'm looking for.  I'm a very beginner PHP user and would like to know if it's possible and how to generate specific MIDI CC's (so for example, note on information, specific CC#'s, etc).

How To Generate Reports
i have to generate reports in php,can anybody help me on this issue,providing me the documentation for that.

Using PHP To Generate XML File
How do you use PHP to generate an XML file? I need to use PHP to grab some variables from my database and then insert them into my XML file for a dynamic flash playlist that changes with each user. Currently my XML file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song url="url1" artist="artistname1" track="001" />
<song url="url2" artist="artistname2" track="003" />
<song url="url3" artist="artistname3" track="004" />
</songs>

I want it so that each variable (artist, url, track) can be pulled from my mySQL database to generate this XML file.

Generate Reports With Php
i want the procedure to generate reports with php,can any one help me regarding this issue.

Using PHP To Generate A Csv File
I need to be able to generate the file without using double quotes in the resultant file. 

Generate PDF File From HTML Using PHP
anyone know how to generate pdf file using php.. As far as i know there are 2 ways to do that.

1) Using PDF library
2) Using header that will send application type as pdf

Anybody know which is the better or easiest way to generate pdf?

Dynamically Generate Mp3 Clip
I have page in which user will upload song and i need to automatically
generate a 30 second clip of the uploaded mp3 file and save it

can anyone suggest how to do this on linux server which software to use

is it possible with ffmepg or ffmpeg-php to cut a 30 second clip or 60 second clip etc.

if you have any example then please show me how to do that.

Generate Thumbnail Of Any Webpage Using PHP
Joshua Eichorn(http://blog.joshuaeichorn.com) recently released a
fantastic service for creating thumbnail of webpages at runtime. The
service is named as WebThumb (http://webthumb.bluga.net). Later he
relased some API for developers to incorporate the service using a
API-Key. The API-Key is available after registering at the site.

Ccbill (generate The Refer)
I am creating a site, in where it exists to banner that must have the following Link http://refer.ccbill.com/cgi-bin/cli...ww.domain.com/,

but the PA=YYYYYY must be generated by the url of the page .

http://sub.domain.com/index.php?id=YYYYYY or,

http://sub.domain.com/index.php?ccbill=YYYYYY

i do need a database constructed ?
how do i generate the refer on the banner when i type the ccbill on the url on the navigator ?

How To Generate An XHTML Form With PHP
Given a list of catalog items contained in a comma delimited text file like this:

item_1_name, item_1_shape, item_1_color
item_2_name, item_2_shape, item_2_color
item_3_name, item_3_shape, item_3_color
.
.
.
item_n_name, item_n_shape, item_n_color

how can PHP be used to read the text file and then produce a typical XHTML form? The form would look something like this in the browser:

Item 1 -- Square -- Red ---- [Quantity Box]
Item 2 -- Circle -- White -- [Quantity Box]
Item 3 -- Star ---- Blue --- [Quantity Box]
.
.
.

The quantity boxes are the typical XHTML form input boxes wherein a website visitor can enter an integer.

PHP Scripts To Generate Documentation
I'm searching for a PHP tool that will work similar to JavaDoc, generating PHP documentation on the fly. Anyone know of any good scripts out there?

Generate A Sequency Of Values
I have a mysql table which contains several stores. What i want is to, for instance. each day pick a store and when he finds the last store in the table returns to the first. e.g.

22 January - Store A
23 January - Store B
24 January - Store C
25 January - Store D
26 January - Store A
27 January - Store B
28 January - Store C

I dont have any script and i would like that someone could help me with this.

Generate Random Id / Unique Id
I am creating an affiliate system for a website and am a bit stuck as to how to generate a unique id for each affiliate when they register.

In my mysql table I will have a unique 'id' (auto inc) and I then want to have an affiliate_id column. Can I get the DB to give auto increment the id numberr using these letters beforfe the id number 'aff-'

example:

aff-1
aff-2
aff-3

Or should I use php to generate this?

Dynamically Generate Mp3 Clip
I have page in which user will upload song and i need to automatically generate a 30 second clip of the uploaded mp3 file and save it. can anyone suggest how to do this on linux server which software to use? is it possible with ffmepg or ffmpeg-php to cut a 30 second clip or 60 second clip etc

Bash Script That Generate PHP From SQL
as i write on the topic, i'm programing a Bash script using the
standard GNU Linux text utilities (gawk, grep, sed, and so on) that get
information from SQL source (table attib, type per column, constrains,
etc.) and finally generate PHP codification.

This is not a magic tool that makes whole site from SQL tables, but i
just want to make easy repetitive task. Almost every table on a
database has certain page asociatted, ex.:

from Company relation (table) we should, for sure, do:
(1) company-index.php // just links to other pages
(2) company-query.php // perform company data filter
(3) company-insert.php // insert a new company
(4) company-delete.php // delete
(5) company-browse.php // browse (all or filtered) brief companies data
(6) company-update.php // update
(7) company-detail.php // show every
(8) company-operation.php // SQL queries

Scripts To Generate Calanders
Just wondering if anyone out there has any scripts to generate a small popup calander that would display the current month?

Generate A List Of Weekdays
I have a time card app in PHP and MySQL. It tracks a job worked on by date. I want a way to inform the user that they failed to submit a time report for a given day. I figured the best way to do this would be to compare all of their time entries in the database against an array of weekday only dates and report on which ones are missing. This seems like it would be a lot of processing each time it is run.

Php Generate Text File
I have been trying for the past 3-4 days now to get flash to write into a text file for me. Basically I made a rating script on flash and then I made another php file that counted the top 10. I want to get the info from the top 10 to a text file but I've been stuck for a while now.

I read php.net for the commands, kessler's tutorial, but I'm just missing something. I posted the top 10 script that works and the other that doesn't work when I try to text can someone please tell me what I'm messing up on? PHP Code:

Generate EMule File Id
I am hosting a huge archive of german documents, tools and movies
related to IT security[1].

Due the fact some files (especially the software and movie parts) are
large in their size and therefore heavily increasing the traffic of my
web site, I would like to provide an alternative eMule link to download
them.

The generation of an e2DK link seems to be very easy:

ed2k://|file|<file name>|<file size in bytes>|<fileid>|/

Does somebody know how to generate an e2DK file id? It does not seem to
be an usual MD5 value. But I have not tried other hash algorithms (e.g.
SHA1) yet - I hope somebody can help me out without doing the research
myself ;) ! Putting the link manually on my web site is not an option
because I am too lazy on my old days ;) !

Generate Checkbox List
I have a table with two fields:
1) groups_id
2) groups_name

The data contained is simple:

groups_idgroups_name
---------------------------
1 Group A
2 Group B
3 Group C
4 Group D

I would like to dynamically create a checkbox selection similar to:

<input name="sel_group" type="checkbox" value="1">Group A<BR>
<input name="sel_group" type="checkbox" value="2">Group B<BR>
<input name="sel_group" type="checkbox" value="3">Group C<BR>
<input name="sel_group" type="checkbox" value="4">Group D<BR>

So I need a script that'll take this information from the groups table
and create the above.

Generate Mysql Timestamp
how can I generate a mysql timstamp value of the current time?

sample:
20040605042505
YYYYMMDDhhmmss

is it only possible by concat year.month.day.hours.minutes.seconds or is
there any final function included in PHP to do that for me?
I didn't find it, yet.

I hope you can give me a hint?

Generate Calendar Appointments
I have a db with event
info (date, time, location,...) and would like to be able to generate
a file that the user can click on so that the event is added to their
Outlook calendar. Is there a standard format for such a file or name
for this? Where can I get information to be able to program the
creation of this file?

Programmatically Generate Jpg Thumbnails
I'm looking for a simple way to programmatically generate thumbnails
from uploaded jpgs in PHP. It doesn't need to be too fancy either.
Any thoughts?



Generate A Gif Of A LaTeX Expression Using PHP
Want to ask your help for the following problem:

I want to generate a GIF or PNG image from a latex expression like:
$lim_{x o -infty} x^m$
or
$int_{0}^{+infty} e^{-x^2} dx$
or whatever?

$latexstring = base64encode("$sum_{n=0}^{infty} frac{1}{n^2}$");
i've thought about a file like latex.php?string=$latexstring

Is there maybe already such a script or how could I do this?

A Tool To Generate Background
I am looking for a tool (script, plugin, code, ...) which can generate
background image for webpage

look at background on http://vtorrent.info/ page or on the Vista
webpage.
I want to create this in fly - only give two colours and expect result
which will be created by function.

Is any plugin for it?
code in php or js or .. whatever ?

Using Php To Generate An RTF File But Having A Footer
i have attempted to search these forums but searching the string "rtf" doesn't bring up much apart from a lot of people writing the word portfoilo. I have also spent many hours googling and not come up with anything which fully works...yet.

Basically what I'm attempting to do, using php is generate a word document which contains varibles which are populated by a MySQL database.
I've tried a number of ways thus far but the below method has been the closest.

The word document is basically a letter with a picture at the top, then the addresses, then a mini introduction, a small table and then the end signature.
I've acomplished this using:

header("Content-disposition: attachment; filename=letter.doc");Then writing the 'letter' in html with all the < b>'s and < u>'s and a couple < hr>'s

So, so far so good. All is well, the only thing which i haven't been able to do is populate the footer of the document. This being the very bottom of each page when the document is printed. I want to enter an address into the footer but i'm unable to faverm out how this can be done using the doc content-disposition method.

How To Generate Two Subsequent Outputs In One Run.
Does somebody have a solution to this one ? :
How can I get a script to send two subsquent pages.

Example:

My script accepts form data and shows a preliminary "Thank you" page
while it continues to process the data. Then, after completing the
process it returns a final response page, thus replacing the
preliminary "Thank you" screen.

When I generate two subsequent outputs I get the following error:

"Warning: Cannot modify header information - headers already sent by
(output started at /.../script.php:53) in /.../script.php on line 167"

How can I replace a previous output with a new one during one single
script run? Or what solution could you suggest?


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