PHP , CSS , Java Script in ChronoForms

ambarishg 31 Oct, 2008
Hi all,

I am a ChronoForm newbie.

I have a HTML page pizza.hml which uses the following
a) Java Script in the HTML
b) CSS file
c) OnSubmit it posts to a PHP file, a seperate file.
d) Image file

I tried using the Form Management New Form adding the

HTML code
Java Script

Did another form with
CSS file

Did another form with
PHP code

Result
=========
The image does not show
The post to the PHP file does not work.

Can anyone please provide some guidelines regarding this ?

Regards
Ambarish[attachment=0]BreakNeckPizza.rar[/attachment]
Max_admin 31 Oct, 2008
Hi Ambarish,

What does this PHP do ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 31 Oct, 2008
Hi Max,

Looks like a text-book exercise. The form has a phone number field and the PHP looks up the number in a simple database table and returns the name and address.

Bob
ambarishg 01 Nov, 2008
Hi Max and GrayHead,

This is a textbook exercise.

GrayHead is absolutely right in the description.

I would like to use this as a POC for further development.

Thanks,
Ambarish
ambarishg 01 Nov, 2008
Whenever I am adding the code in one of the articles in Article Manager , I am getting the error.

{chronocontact}PizzaForm{/chronocontact}


Error =

Attempt to assign property of non-object in F:\xampp\htdocs\StMarys\plugins\content\chronocontact.php on line 18



The PizzaForm html code is very simple
<p>
Enter your phone number:
<input type="text" size="14" name="phone" id="phone"/>

</p>

<p>

<input type="submit" value="Order Pizza" id="submit" />

</p>

Submit code

<?php ///////////////////// // // This script assumes MySQL access. // // If you want to run this script yourself, // you need to do the following things: // 1. Replace DB_HOST with the name of the server your database is on // 2. Replace DB_USERNAME with your database login username // 3. Replace DB_PASSWORD with your database password // 4. Replace DB_NAME with the name of your MySQL database // 5. Make sure your database schema is as follows: // // Table name: hraj_breakneck // Column 1: phone (Type: VARCHAR(15)) // Column 2: name (Type: VARCHAR(100)) // Column 3: street1 (Type: VARCHAR(100)) // Column 4: city (Type: VARCHAR(25)) // Column 5: state (Type: VARCHAR(20)) // Column 6: zipCode (Type: VARCHAR(10)) // // Insert into your table several rows like this to start: // // 2148760976, Doug Henderson, 7804 Jumping Hill Lane, Dallas, Texas, 75218 // 2142908762, Mary Jenkins, 7081 Teakwood #24C, Dallas, Texas, 75182 // 7852215645, John Jacobs, 234 East Rutherford Drive, Topeka, Kansas, 66608 // 7853485412, Happy Traum, 876 Links Circle, Topeka, Kansas, 66608 // // Remember, you really don't need this script to access a database to run // the book's examples. This is just for bonus credit! // /////////////////// // Connect to database $conn = @mysql_connect("localhost", "root", "ambarish"); if (!$conn) die("Error connecting to MySQL: " . mysql_error()); if (!mysql_select_db("stmarys", $conn)) die("Error selecting database: " . mysql_error()); $phone = $_REQUEST['phone']; echo "Your Phone no is $phone"; $phone = preg_replace("/[\. \(\)\-]/", "", $phone); $select = 'SELECT *'; $from = ' FROM breakneckpizza'; $where = ' WHERE phone = \'' . $phone . '\''; $queryResult = @mysql_query($select . $from . $where); if (!$queryResult) die('Error retrieving customer from the database.'); $num = mysql_num_rows($queryResult); if ($num == 0) { $queryResult = @mysql_query($select . $from); } while ($row = mysql_fetch_array($queryResult)) { echo $row['name'] . "\n" . $row['street1'] . "\n" . $row['city'] . ", " . $row['state'] . " " . $row['zipCode']; } mysql_close($conn); ?>

Can anybody please help ?

Thanks again,
Ambarish
GreyHead 01 Nov, 2008
Hi Ambarish,

Do you have a form called 'PizzaForm' set up in ChronoForms? I think this warning is because the form information isn't being found in the ChronoForms database table.

Bob
ambarishg 01 Nov, 2008
Thanks Bob and Grayhead for your support

Dont know what was the exact problem

Downloaded the V3 Plugins again and reinstalled.
Yes , in one of the forms , the form name was wrong .

Now the POC is working fine.

ChronoEngine Forms is great 😀
This topic is locked and no more replies can be posted.