hcdarkmage
-
Posts
326 -
Joined
-
Last visited
Posts posted by hcdarkmage
-
-
Hi, you are missing the $ infront of your variable j when incrementing it
change:
for ($j=0; sizeof( $optBox ); j++){
to:
for ($j=0; sizeof( $optBox ); $j++){
Thanks for catching that. Usually when I code, I go a bit fast and forget to put in the $ and ; every once in a while. It bugs the crap out of people when that happens, but it happens.
-
Here is a question to add to this, or at least a situation that may be familiar.
In this case, you have your site that gathers information from a database (name, address, phone, etc.). All this information is yours, you are submitting information to different sites that are loaded through the iframe that has forms that require this information, and instead of copy-paste, you want to drag-and-drop this information into the forms.
Or another way would be to have a button that does an auto-fill for these forms. Remember, the iframe sites are not on the same server, but are apart of an affiliate program or something like that where you can submit your information.
How would you handle crossing information from the main page into the iframe?
-
Alright....lets try this:
<?php $nameQry = "SELECT * FROM database"; $result = mysql_query($nameQry) or die(mysql_error()); $i = 0; while($row = mysql_fetch_array($result)){ $name = $row['name']; $email = $row['email']; $location = $row['location']; $id = $row['id']; $optBox[$i] = $row; $i++; } if(isset($names)){ $valueQry = "SELECT * FROM database WHERE id = '$id'"; $result = mysql_query($valueQry) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $valID = $row['id']; $valName = $row['name']; $valEmail = $row['email']; $valLocation = $row['location']; } } ?>
Then in the form area:
<form name="form1" method="post"> <select id="names" name="names"> <? for ($j=0; sizeof( $optBox ); j++){ echo "<option value='".$optbox[$j]['id']."'>".$optbox[$j]['name']."</option>"; } ?> </select> Input First Name: <input type="text" name="firstname" value="<? echo $valName ?>" /><br /> Input Email: <input type="text" name="email" value="<? echo $valEmail ?>" /><br /> Input Location: <input type="text" name="location" value="<? echo $valLocation?>" /><br /> Input ID Number: <input type="text" name="id" value="<? echo $valID?>" /><br /> <input type="submit" name="submit" value="Update Data" /> </form>
This code is untested, but in theory should help.
-
I dont understand that completly, it doesnt update when i changed everything to. I would of thought first i would need a box where i search for name/id number, then if i get a result back it would let me use 4 text boxxes to update the rows i have.
You could do a drop down box that selects all the people in the database and sets the values of the form to auto-populate with the information and you can change and update the information.
<?php $nameQry = "SELECT * FROM database"; $result = mysql_query($nameQry) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $name = $row['name']; $email = $row['email']; $location = $row['location']; $id = $row['id']; } ?>
Then in your form control you have this:
<form name="form1" method="post"> <select id="names" name="names"> <option>option values</option> </select> Input First Name: <input type="text" name="firstname" value="<? echo $name ?>" /><br /> Input Email: <input type="text" name="email" value="<? echo $email ?>" /><br /> Input Location: <input type="text" name="location" value="<? echo $location?>" /><br /> Input ID Number: <input type="text" name="id" value="<? echo $id?>" /><br /> <input type="submit" name="submit" value="Update Data" /> </form>
or something along those lines.
-
If you have setup a unique primary key in your database, you could use it for updating the information.
Create the form that has the fields you want to update the database:
<form name="form1" method="post"> Input First Name: <input type="text" name="firstname" /><br /> Input Email: <input type="text" name="email" /><br /> Input Location: <input type="text" name="location" /><br /> Input ID Number: <input type="text" name="id" /><br /> <input type="submit" name="submit" value="Update Data" /> </form>
Of course being a little rusty, in the PHP section of the page you do something like this:
<?php foreach($_POST as $key => $value) $$key = $value; //This sets the form field names to values. mysql_query("UPDATE table SET location = '$location', name = '$firstname', email = '$email' WHERE id = '$id'") or die(mysql_error()); ?>
That way you have a clean update of any information that needs to be updated.
-
I was thrown into it. I learned by looking at the way the coding structure was done by others and worked the rest out from there.
-
I think everything in Creative Suite 3 is top notch. It is a great set of software.
And very expensive!
-
A very decent site. The clock is backwards . . . did you do that on purpose, or is it an error? Any way, this is a site I think I would go to. Coldkill is right about the logo. Maybe fade the reflection and slant it a tad, almost like a shadow. Just a suggestion.
-
I'm getting that strange feeling of deja vu. I know I've seen this post some where . . .
I was right: http://www.phpfreaks.com/forums/index.php/topic,171284.0.html
-
I'm getting that strange feeling of deja vu. I know I've seen this post some where . . .
-
Syncronization is not exactly what I am looking for, though it may help. I also have Xenu (http://home.snafu.de/tilman/xenulink.html) for looking into broken links, but it doesn't tell me if files, pics, pages, etc. are not being linked to in any way, shape or form.
What a pain! The web site is running fine, but the excessive files that don't go anywhere are driving me nuts. It would help to have a program that tells you what files can be deleted without hurting your site.
-
This link http://home.snafu.de/tilman/xenulink.html takes you to a program that looks for broken links and gives you a form of site map.
-
So is there a program that goes through each song in a directory and erases it's tags?
I had used this http://www.dbpoweramp.com/ when it was free. Just convert them to mp3, wma or ogg and tell it not to keep the tags. I believe that ANY program that converts song files can erase the tags.
http://www.google.com/search?source=ig&hl=en&rlz=&q=music+convert&btnG=Google+Search
Try these.
-
Here we go with a question that may cause the two word answer "Google it". The problem is I am not sure which keywords to use. Does any body know of a program or function that searches your site files (local or other) and tells you what files you have on the site that are not needed (i.e. images, web pages, old style sheets)?
Has anybody run into this type of problem before?
I am cleaning our company's website, but I don't necessarily want to go through EVERY batch of code to see what file are being used, what are missing and what need to be taken off to save space.
And if you are going to be nice and say "Google", then could you at least give me a good keyword (or words) that will point me in the right direction. I don't want to start a fight.
-
One word: Google
-
We have MANY sales reps that speak/write Spanish fluently, but they never have the time to work with me (the good ol' "what's in it for me"). The one person we DO use takes up to a month to translate simple documents (and by then they have been updated or removed). He is getting paid to do it, but we can't impress enough on the urgency of getting it all translated ASAP.
That is why I asked about the term "reasonable amount of time". What do you feel is a reasonable turnaround for the translation of a few documents?
-
You know, some people take the "fun" out of "functional".
Just as the new year started, I was ask...no, wait . . . scratch that . . . told that the Spanish version of the company website HAD to be updated within a reasonable time. What is considered as a reasonable time? A week? A month? A year?
Well, it wouldn't be bad if I could cut out the middle man and translate what needs to be translated without having to go to an outside source (more money in my pocket), but as it is, I don't speak, write or translate Spanish. At all.
The company is too **insert your choice cussword here** cheep to pay for any training (taught myself PHP, even though they said they would pay for schooling). Can't complain too much, mostly because I found this forum for help.
There has got to be a way to take a website and have it AUTOMATICALLY translated to another language. I mean, I don't expect Wikipedia or Google to have private translators sit there and translate EVERY bit of information they have.
Until I find it, I guess I'm stuck doing it the "copy-paste" way.
Does anyone else run into these problems?
-
Welcome to the "The make fun/puns of other people's usernames thread!"
Here's the game:
Required:
1. Make a pun or funny explanation of the username of the person above you.
2. Keep it funny, not hateful.
3. Be creative. The sky is the limit.
Optional:
1. Make more than 1 pun or explanation on people's usernames of the same person, or other people in the thread.
Go!
(Mine name is kind of tough to start out with..oh well )
dsaba - how a southerner explains what a sheep says when a child ask "wads dat noise?" (ds a ba - That's A Baa)
It was bad, but - it was worth a try!
-
dodecahedron
or
rhombus
Dodecahedron because it makes better dice for D&D
Email or IM
-
One Pillow or Two Pillows
Two - they are nice and fluffy and keep my head elevated (needed for those big Ego days).
Pizza or Spaghetti
-
Drown - I suffer less becuase I have the option to swallow water whenever I want to.
Bold
or
Italics
Bold, just because!
Sticky
or
Keep trying to put this post on top
-
A little sick for 2 weeks
or
Killer sick for 2 days (without dying of couse)
A little sick, mostly because if you are killer sick you can't get out of bed.
Quick Snack
or
Light Meal
-
DVD-R
or
DVD+R
DVD+R, but I'm not sure of the difference
SWF
or
PDF
-
I want to get a DVD player and not sure which one I should get. any recommendations?
Get a hybrid. they may be more expensive, but at least you will have a player that will p[lay whatever discs win the HD vs. BluRay war.
help with dropdown list
in PHP Coding Help
Posted
I hate to be the barer of bad news, but it looks like you are going to have to delve into the world of Javascript to get the drop down lists to do your bidding. I personally do NOT know how to handle your request, but I have seen some people do what you are asking.
If you try to do it with PHP you're going to run into the problem of having to refresh the page and use a submit button with each drop down. That gets cumbersome and annoying to the end user. My suggestion is to Google js drop-down changing.