Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 30th Mar 2014, 07:08 AM   #1
Warrior Member
 
abdel's Avatar
 
Join Date: 2011
Location: Jacksonville, FL
Posts: 18
Thanks: 12
Thanked 3 Times in 3 Posts
Default
how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Hello,

I have a webpage with a 3 fields webform inside.
The user will have to fill in the form and to click the button "generate".
The output will be the same page with some differrences based on his 3 inputs:
- input#1 will generate a specific user URL, ex: ww.webpage.com/userID
- input#2 will remplace a word in the webpage content
- input#3 will remplace another word in the webpage content

Thanks.
abdel is offline  
Unread 30th Mar 2014, 02:09 PM   #2
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 71
Thanks: 2
Thanked 13 Times in 13 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by abdel View Post

Hello,

I have a webpage with a 3 fields webform inside.
The user will have to fill in the form and to click the button "generate".
The output will be the same page with some differrences based on his 3 inputs:
- input#1 will generate a specific user URL, ex: ww.webpage.com/userID
- input#2 will remplace a word in the webpage content
- input#3 will remplace another word in the webpage content

Thanks.
Best way to do this is to save user submitted data to MySql database and when user visits ww.webpage.com/userID it loads content from database by user id.

You need to edit .htaccess so you site understands that "userID" is variable on url, else it will give 404 error.

Send me your code and I can work something out

Lani is offline  
Unread 31st Mar 2014, 02:37 AM   #3
Warrior Member
 
abdel's Avatar
 
Join Date: 2011
Location: Jacksonville, FL
Posts: 18
Thanks: 12
Thanked 3 Times in 3 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Lani View Post

Best way to do this is to save user submitted data to MySql database and when user visits ww.webpage.com/userID it loads content from database by user id.

You need to edit .htaccess so you site understands that "userID" is variable on url, else it will give 404 error.

Send me your code and I can work something out
Hello Lani, thank you,

Sorry, I meant I have the content for a webpage I plan to publish online.
So, I haven’t the code yet because I am not a developer,
I am just an internet marketing newbie,
who is looking for some help to generate his first dollars through internet.

I can insert and edit the content by myself once I have the said code.
I can do it by using Kompozer for example.

The content is just some text lines.
The text will include 2 variables.
And somewhere between the text lines there is a 3 fields form.
The 3rd variable is for the end-user URL as I said.

I will be very grateful if you can help me to have the basic structure of
the said code where I will be able to add and edit my text lines.

By the way, I have a domain name and hosting account at Hostgator.

Thanks once more again,
abdel is offline  
Unread 31st Mar 2014, 03:51 AM   #4
HyperActive Warrior
 
tweakr's Avatar
 
Join Date: 2011
Posts: 106
Thanks: 3
Thanked 12 Times in 11 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Seeing that you're hosting the site on hostgator, I'm going to assume that you're going to use PHP to complete the task. With this in mind I put together a brief example that should get you started.

Free AdPress Theme for WordPress .
tweakr is offline  
Unread 31st Mar 2014, 04:53 AM   #5
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 71
Thanks: 2
Thanked 13 Times in 13 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Here is simple example I made for you.

index.php
get_data.php
.htaccess
DB Schema

Hope this helps you to get started

Lani is offline  
Unread 31st Mar 2014, 05:01 AM   #6
Warrior Member
 
abdel's Avatar
 
Join Date: 2011
Location: Jacksonville, FL
Posts: 18
Thanks: 12
Thanked 3 Times in 3 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by tweakr View Post

Seeing that you're hosting the site on hostgator, I'm going to assume that you're going to use PHP to complete the task. With this in mind I put together a brief example that should get you started.
Thanks,

Now I have created a php page where I inserted the code you gave here,
then I added some content.
I also created MySql database to connect it to the said php page.
But I don't know how. Can you please tell me how to connect
my php page to my MySql database?

Thanks once more again.
abdel is offline  
Unread 1st Apr 2014, 07:08 AM   #7
Warrior Member
 
abdel's Avatar
 
Join Date: 2011
Location: Jacksonville, FL
Posts: 18
Thanks: 12
Thanked 3 Times in 3 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Lani View Post

Here is simple example I made for you.

index.php
get_data.php
.htaccess
DB Schema

Hope this helps you to get started
Hello Lani,

First, I appreciate the examples you have posted here. Thanks.
But I don’t know how to use each one of them:
which one will be my webpage?
which one is the configuration file?
etc..

And can you please give me an idea on how to connect
the MySql database I have created to my webpage?

Thank you very much.
abdel is offline  
Unread 1st Apr 2014, 07:15 AM   #8
digital carpenter
War Room Member
 
brutecky's Avatar
 
Join Date: 2013
Location: Pennsylvania
Posts: 1,306
Thanks: 480
Thanked 747 Times in 444 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Lani View Post

Best way to do this is to save user submitted data to MySql database and when user visits ww.webpage.com/userID it loads content from database by user id.

You need to edit .htaccess so you site understands that "userID" is variable on url, else it will give 404 error.

Send me your code and I can work something out
OP .. its going to be very difficult to explain how to do this since it seems you have not coding experience. However dont listen to this guy. His solution is over complex.

brutecky is offline  
Unread 1st Apr 2014, 08:37 AM   #9
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 71
Thanks: 2
Thanked 13 Times in 13 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by brutecky View Post

OP .. its going to be very difficult to explain how to do this since it seems you have not coding experience. However dont listen to this guy. His solution is over complex.
Whats complex about website storing data to database? I'd say its pretty normal

Originally Posted by abdel View Post

Thanks,

Now I have created a php page where I inserted the code you gave here,
then I added some content.
I also created MySql database to connect it to the said php page.
But I don't know how. Can you please tell me how to connect
my php page to my MySql database?

Thanks once more again.
Index.php is frontpage of your website.
Frontpages of websites is called "index".

On index.php and get_data.php there is line

$db = new PDO('mysql:host=127.0.0.1;dbname=mysql_table', 'mysql_user', 'mysql_pass');

Replace "mysql_table" with your database name, "mysql_user" with your mysql username and "mysql_pass" with password.

Before that, go to phpmyadmin and select database you have created and go to sql tab and run whats in "db schema" link.

Here is picture:
http://i.imgur.com/SajM4C9.png

But as brutecky said, its a bit hard to explain some things for non coders and Im sure that google gives some answers faster

Lani is offline  
Unread 5th Apr 2014, 07:27 AM   #10
Warrior Member
 
abdel's Avatar
 
Join Date: 2011
Location: Jacksonville, FL
Posts: 18
Thanks: 12
Thanked 3 Times in 3 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Lani View Post

Whats complex about website storing data to database? I'd say its pretty normal


Index.php is frontpage of your website.
Frontpages of websites is called "index".

On index.php and get_data.php there is line

= new PDO('mysql:host=127.0.0.1;dbname=mysql_table', 'mysql_user', 'mysql_pass');

Replace "mysql_table" with your database name, "mysql_user" with your mysql username and "mysql_pass" with password.

Before that, go to phpmyadmin and select database you have created and go to sql tab and run whats in "db schema" link.

Here is picture:
http://i.imgur.com/SajM4C9.png

But as brutecky said, its a bit hard to explain some things for non coders and Im sure that google gives some answers faster
Hi,
I followed all the steps here above,
But when I tried to test the page by filling the form in and submitting it,
I got 3 differents WARNING messages in once, see below:
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'sahar'@'localhost' (using password: NO) in /home2/sahar/public_html/smartlist/index.php on line 9

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home2/sahar/public_html/smartlist/index.php on line 9

Warning: Cannot modify header information - headers already sent by (output started at /home2/sahar/public_html/smartlist/index.php:9) in /home2/sahar/public_html/smartlist/index.php on line 34
I don't know how to deal with those warnings. Any help please?
Thanks.
abdel is offline  
Unread 6th Apr 2014, 12:10 PM   #11
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 71
Thanks: 2
Thanked 13 Times in 13 Posts
Default
Re: how to get output based on a Webform the user filled out?
Share on: 
fb share twitter share gplus share more share

Originally Posted by abdel View Post

Hi,
I followed all the steps here above,
But when I tried to test the page by filling the form in and submitting it,
I got 3 differents WARNING messages in once, see below:

I don't know how to deal with those warnings. Any help please?
Thanks.
New index.php
New get_data.php

Lani is offline  
Closed Thread


Bookmarks

Tags
based, filled, output, user, webform


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:28 AM.