Follow corelegion on Twitter
Welcome, Guest
Please Login or Register.    Lost Password?

Using Flexi Custom Code to create PHP based forms in Joomla!
(1 viewing) (1) Guest
General Borad
Go to bottomPage: 1
TOPIC: Using Flexi Custom Code to create PHP based forms in Joomla!
#1199
Using Flexi Custom Code to create PHP based forms in Joomla! 1 Year, 8 Months ago Karma: 0
I am trying to do the following on a Joomla! site:

1. Create a form where members of a Non-Profit Group can add items to a wishlist Database.
2. Have that form reference a PHP file (<form action="wish_list_submittal.php" method="post">)
3. Have the PHP file read the posted variables from the form, update the database table, create an HTML response page.

I have successfully created the HTML and PHP to do all this but the problem is embedding the code into my Joomla! site. I downloaded and installed Flexi Custom Code and brought up the customize module screen but not sure where to go from here.

Do I create a module using the code from my wish_list_submittal.php file and somehow reference it in my form?

Do I somehow create the form using a customize module?

Need help! Thanks in advance!

I am using Joomla! 1.5 and installed Flexi Custom Code for 1.5.
golfvilla
Acquainter
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#1217
Re: Using Flexi Custom Code to create PHP based forms in Joomla! 1 Year, 8 Months ago Karma: 0
The forum administrators need to tighten the spam control on this forum!

I was able to resolve my own issue and will post it here for others.
Solution:
Put the form action at the top of the code and do not include an action in the form tag. This creates a single file that can be cut and pasted into the module.

Example:
<?php

//no direct access
defined('_JEXEC') or die('Direct Access to this location is not allowed.');

mysql_connect('localhost','database_name','password') or die ('Error connecting to database');


// create short variable names
mysql_select_db('database_name') or die ('Error: ' .mysql_error());


[create your PHP variables from posted form names below]

if (mysqli_connect_errno()) {
echo "Error: Could not connect to database. Please try again later.";
exit;
}

$sql = "insert into TableName ()";

mysql_query($sql) or die ('Error updating database');

?>

<h1>Wish List Database Submittal Test</h1>

<form method="post">

[form HTML CODE HERE]

</form>
golfvilla
Acquainter
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The topic has been locked.
 
#1494
Re: Using Flexi Custom Code to create PHP based forms in Joomla! 1 Year, 6 Months ago Karma: 3
thanks for your confirmation
techicore
Supervisor
Posts: 116
graph
User Offline Click here to see the profile of this user
The topic has been locked.
 
Go to topPage: 1
Moderators: techicore
Feel free to see the demo for addons at This Demo or you can also see the real action at TechnoTravels and TechiCore
Associated with RBO Teamget the latest posts directly to your desktop

Australia SEO

Selecting an Australian SEO company is only turning into a more difficult task as more technologies emerge. We conducted a search for Australia SEO and after speaking with multiple companies are confident in suggesting The Web Showroom.