Topic: Parameter Passing, Generating Code, and Storing the user input from the new code (Read 911 times)
Google dot what?
Posts: 2
16 credits Members referred : 0
« on: Mar 02, 2007, 03:56:56 pm »
Hello, I am trying to create a user interface to connect to a MySql database. The problem is when the user input their data the values aren't stored or passed. Also is there a better way to generate html code from the user input. Please run the code so you can see what I am talking about.
Thanks in advance
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This file ask the user for the database name, table name and how many fields, then it calls itself back and it creates the fields and allow the user to put in the input. Now I think the problem is here when the user put the data in, its not storing it and then when they click "submit me1!" button it doesn't pass it to the 2n.php file.
//to see if the info was pass from file to file echo $dname1; echo $tname1; echo $famount1; for($i=0; $i<$famount1; $i++) { echo $carray[$i]; echo $darray[$i]; } /* //open up connection $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); }
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #2 on: Mar 02, 2007, 04:35:03 pm »
I'm not 100% sure but I think its also not OK to post array's from form to form, you need to serialize them first or you convert them them into the post array...(to be sure check the php manual about "serialize/unserialize")
Google dot what?
Posts: 2
16 credits Members referred : 0
Re: Parameter Passing, Generating Code, and Storing the user input from the new
« Reply #3 on: Mar 02, 2007, 07:48:10 pm »
Thanks everyone for your help. Forgive for my ignorance, but I am a novice at this PHP game.
Nikolas, I tried using your code, but didn't know where to place it. where ever I did place it, it didn't work.
I also tried these hidden fields(maroon color), but it just returned me to my original script without the input fields:
________________________________________________________________________________________________________________________________________________________________ Olaf, serializing (I don't even know what that means) that's a little bit too advance for me right now, I am a beginner, that will be my last resort. I do appreciate the help and if you can provide a quick example of how to "serialize an array" that would be helpful (and also explain what it is).
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #4 on: Mar 02, 2007, 10:03:34 pm »
Code:
I am a beginner,...
you should start reading the book , you're asking for examples? all functions inside the PHP manual have some
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6138