-
Posts
25 -
Joined
-
Last visited
Never
About Pr0digy
- Birthday 05/08/1983
Profile Information
-
Gender
Male
-
Location
The Netherlands
Pr0digy's Achievements

Newbie (1/5)
0
Reputation
-
Check if a field is filled out, then move to the next (php/mysql)
Pr0digy replied to Pr0digy's topic in PHP Coding Help
Thank you I will be back -
Check if a field is filled out, then move to the next (php/mysql)
Pr0digy replied to Pr0digy's topic in PHP Coding Help
While i appreciate the feedback i have decided to hire someone and have it all done for me. Every question i ask generates more questions in return and i can't wrap my head around it lol. Any code i have so far is copy/pasted together from another friend's website so using second-hand-code, while amazingly i got this far, is not helping. I need it built from scratch for me and of course i do not expect this to be done for free on a forum Thanks Jay. -
Check if a field is filled out, then move to the next (php/mysql)
Pr0digy replied to Pr0digy's topic in PHP Coding Help
"SELECT * FROM products WHERE serial = '$serial' ORDER BY register_date DESC" This worked but it only shows me the last record of that serial number. (i made 3) I use this to call up the information after a search: <?php displayColumn('firstname'); ?> <?php displayColumn('lastname'); ?> etc. I deleted all the 2firstname, 2lastname etc. with "<?php displayColumn('firstname'); ?>" should it call up all 3 records from that serial number and display them or am i missing something? Jay -
Check if a field is filled out, then move to the next (php/mysql)
Pr0digy replied to Pr0digy's topic in PHP Coding Help
"I would assume that you are not planning to have fields in the same row for multiple registrations. If you are, you would be designing a maintenance nightmare." That is exactly how it's currently setup "Yo need 1 row per registration with one set of fields in it. you can then link the rows as necessary to get a history, by searching on serial number" Sounds much better but that is way above and beyond my capabilities i'm afraid. -
Check if a field is filled out, then move to the next (php/mysql)
Pr0digy replied to Pr0digy's topic in PHP Coding Help
I'm sorry, let me try again People can register anything with a serial number really. This is so that when an item is purchased, someone can see the history of that product (if previous owners have registered it on the site that is). It will show in what years it was previously owned and in what country etc (down the road) and if it has ever been reported stolen. You are correct, right now if a second owner wants to add their information to a serial number that's already in the database... it doesn't work because it has already been registered. So i want it to 'see' that and then move on to the next set of empty fields (2firstname, 2lastname etc) and put the information in there. I hope this helps Jay. -
Hi! I am new to PHP but learning the basics. With the help of samples online i have managed to build a registration form that adds all the filled out info to the database and reads it back when a search field is used. People can register their computers based on the serial number. The database is made up like this: id serial 1firstname 1lastname 1emailaddress 2firstname 2lastname 2emailaddress etc. I can not figure out how to do the following: When a serialnumber is already registered but a new owner wants to add his/her information to the database, how can the form see if all the fields starting with '1' have already been filled out, then automatically put all the new information in the fields starting with '2' ? This is the code i use: $query = " INSERT INTO `records` ( `id`, `serial`, `1firstname`, `1lastname`, `1emailaddress`, ) VALUES ( '', '".$_POST['Serial']."', '".$_POST['Name']."', '".$_POST['LastName']."', '".$_POST['Email']."' ); Any help would be greatly appreciated Jay
-
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
I think i was doing ok but this doesn't look anything like my form so i don't know how to merge this code... with my stuff :/ -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
no luck nothing happens except now it stops writing test. -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
Well i think i've gotten as far as i can.. <form action="serial.php" method="POST" target="MacSerial2Frame"> <strong><br /> <br /> <br /> try it</strong> <input type="text" name="serial" id="serial" value="" onChange="javascript:this.value=this.value.toUpperCase();"/> <input type="submit" value="Get Info"> <br /> </form> <?php $handle = fopen("textfile.txt","a"); $content = $_POST['serial']; fwrite($handle, "test"); fclose($handle); ?> This results in 'test' being written in the textfile. Instead of test i want it to write the contents of the form (that's where the $content = $_POST['serial']; comes in) or so i thought... because it doesn't work. I'm stuck, any help greatly apreciated Jay -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
i got it to delete the file once, but that's it haha -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
Thanks for the links I browsed around on Pixel2Life and found this (hopefully promising) snippet and link... require('log.php'); <?php function log_action($msg) { if ($fp = @fopen("/var/lib/mysql/php_app.log", "a")) { fwrite($fp, $msg, strlen($msg)); fclose($fp); } } ?> And this is a link: http://www.gfx-depot.com/forum/-tutorial-index-t-1040.html I think most of what i need is there but im still lost as how to merge this kind of code with my form and make it work. I have a plain text file on the server called "test.txt". I will keep messing around with this but if someone knows how to get this code to work i might even get this done before the end of the year Jay -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
I don't know how you got there so fast but after google page 34 i gave up I will look at this after i wake up with fresh rested eyes and start messing around (almost 6:30 AM here), thanks so much for the help so far jay -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
Hey thanks for the reply, looks promising Do you have a site like that that shows an example script or anything working with a form, just 1 line is nice but i wouldn't know where to put it :S If it's a matter of putting it between <?php and ?> tags and changing some path names i'd be fine Jay -
[SOLVED] Record form entry to text file, possible ?
Pr0digy replied to Pr0digy's topic in PHP Coding Help
Sorry i forgot to add "i was told PHP is the way to go to get this done". Problem is... i have no clue where to start :S -
Hi folks, I have a simple HTML form and i want the site to record what someone puts in there. Is there a way to have it saved to a text file on the server after someone hits "submit" ? It's just one word that's being entered. Here's the form code: <form action="test.php" method="post" target="TestFrame"> <strong><br /> <br /> <br /> Enter Namel</strong> <input type="text" name="name" id="name" value="" onChange="javascript:this.value=this.value.toUpperCase();"/> <input type="submit"> <br /> </form> I REALLY want to avoid stuff like databases etc since the word 'database' alone scares me Thanks for any help Jay