Re: another php question



Looks pretty good so far.

You can check if a form variable represents a numeric string by using
is_numeric(). It's a little bit clearer and probably a little bit
faster than using ereg().

You've already got the code in place to check that the fields are not
empty and that $mobile contains only numbers. So the only thing left
is to lookup $code in the database. The next section might look
something like this (pseudocode):

$sql = "select count(*) items from code_table where code = '$code'";
//Run the query
if (items == 0) {
header( "Location: http://www.mysite.com/badcode.php"; );
}

//Send email
//delete the row from the database

.



Relevant Pages

  • Re: opening a client application from a server?
    ... I should have been clearer. ... produce a Word document merging data obtained as a result of querying ... a database with a template, so that the user can open the file in Word ...
    (comp.lang.perl.misc)
  • RE: NetworkStream BeginRead & callback invocation
    ... The dev team will file a doc bug into our database and we will change the document in the future to make it clearer. ...
    (microsoft.public.dotnet.framework)
  • Re: selecting specific columns with data and put it in a new sheet
    ... I will try to describe it clearer:) ... I am provided with a database which is approx 20000 lines and 140 ... pivottables wich selects data from certain fixed columns. ... into a new sheet in column A. By a loop it then looks for cellvalue A2 ...
    (microsoft.public.excel.programming)
  • XML generation issues
    ... Apologies Simon for not making it clearer last time. ... reading a table from the SQL Server 2000 database and using: ...
    (comp.databases.ms-sqlserver)