-
Posts
98 -
Joined
-
Last visited
Never
Posts posted by oliverj777
-
-
Basically,
I have a database table called 'users' and I would like to populate a drop down box with these values of 'users'.
How?? - to call upon the values is this: 'upduser2'
Right now, all I am using is a text box, in where you have to type in the users name manually (this is so an admin can change variables and settings according to that current user). This is what I am using so far:
<h3>Update User Level</h3> <? echo $form->error("upduser"); ?> <table> <form action="adminprocess.php" method="post"> <tr> <td> Username:<br /> <input type="text" name="upduser" maxlength="30" value="<? echo $form->value("upduser"); ?>" /></td> <td> Level:<br /> <select name="updlevel"> <option value="1">1 </option> //example settings <option value="9">9 </option> </select></td> <td><br /> <input type="hidden" name="subupdlevel" value="1" /> <input type="submit" value="Update Level" /></td> </tr> </form> </table></td> </tr>
Much help would be appreciated.
-
I would imagine its something to do with your 'explode' and $file.
The explode is splitting your string by string, and being whats in your $file - is causing it to repeat/place your ;; everywhere
I'm no expert though
-
I've never done it through PHP before.
Have you managed to find the problem yet or is it still printing loads of ;;; everywhere?
-
It could be because you are your <? ?> already within a PHP script.
Try this: (I'm no expert btw)
echo " <html> <head> <title>Photography</title> </head> <body> <table width='100%' border='0' align='center' style='width: 100%;'>"; $result_final // I'm not sure what this is doing here?? include("search.php"); echo" </table> </body> </html>";
-
humm .. is the file in the same directory as your search.php
-
Hello,
This whole time working online and what not, I always end up using PayPal as a payment method.
How to I use credit cards as a payment method ... for free?
Can someone please explain the process of payment via credit cards
Thanks
-
Humm, okay.
What would be the code for counting ($count) how many characters their are in a text field then?
-- then to echo it...
This is what I want ...
$word = "hello"
$count = How many characters in $word.
echo $count
-
Okay -
Is there a way to find out how many characters the password has? (for a different purpose) -- I would like to display their password on a 'manage user page' like so: ***** - so I would only be retrieving a character count, and using that figure to place the ** accordingly??
Cheers
-
Hello,
My user login script saves their passwords into my SQL in a md5 encryption.
I am currently working on a 'forgot password' that sends the password to their email.
The code that pulls out the password is this:
echo $req_user_info['pass'];
Now is there a way to decrypt the 'pass' (currently nothing is displayed - not even the encryption code)
Please help - Ollie
-
Humm, Try one of the following:
<artist><font color="#FFFFFF">Click Here!!</font></artist>
<artist font color="#FFFFFF">Click Here!!</font></artist>
<artist><font color="\#FFFFFF"\>Click Here!!</font></artist>
<artist><font color='#FFFFFF'>Click Here!!</font></artist>
-
Oh My Jesus Christ --
It's taken me, what 6 hours to figure this out ... And I've just found the problem .. You're not going to believe it.
I missed the '=' off the:
input type"text" name"firstname"...
Correction is:
input type="text" name="firstname"...
It had nothing to do with my PHP coding!! HOW ANNOYING!!
-
I missed off the " after the echo ...
-
So if I were to say something like this:
if($field = ''){ echo "Please fill in the field; }
Does that look correct?
-
Hello,
What is the difference Between "" and ''
And also = and ==
-
Okay, I have a useredit page in where a user can manage their account info. All the text field and SQL connections work fine, and they all update perfectly. But when I go ahead and add my own text field (first name) and hit submit, it says success - but in my SQL it hasn't actually updated ... What the Ef?
Here are my snippets of my codes:
--useredit.php--
<form action="process.php" method="POST"> <input type"text" name"firstname" value="<? if($form->value("firstname") == ""){ echo $session->userinfo['firstname']; }else{ echo $form->value("firstname"); } ?>"> <input type="hidden" name="subedit" value="1"> <input type="submit" value="Edit Account">
--process.php--
function procEditAccount(){ global $session, $form; /* Account edit attempt */ $retval = $session->editAccount($_POST['curpass'], $_POST['newpass'], $_POST['email'], $_POST['firstname']); /* Account edit successful */ if($retval){ $_SESSION['useredit'] = true; header("Location: ".$session->referrer); }
--session.php--
function editAccount($subcurpass, $subnewpass, $subemail, $subfirstname){ global $database, $form; if($subfirstname){ $database->updateUserField($this->username,"firstname",$subfirstname); }
--database.php--
function updateUserField($username, $field, $value){ $q = "UPDATE ".TBL_USERS." SET ".$field." = '$value' WHERE username = '$username'"; return mysql_query($q, $this->connection); }
If you need to see more code, let me know.
Would appreciate the help, thanks!
Ollie!
-
Nice one mate - it works!
-
Umm - help me out here. Is this correct:
$mail = file_get_contents("users/$session->username/messages/mail.txt"); nl2br($mail); echo $mail;
-
Where would I insert that then? Here is the code im using to echo:
include("mail.txt");
Cheers
-
sorted - I didn't know I had to change the length/value to a format of: decimal(#,#)
-
Basically, All I want to do is save a .txt (doesn't have to be .txt) to my FTP and PHP simple echos it. The .txt is where a message is stored. But when I write the message my self like this:
Hello
This is a message.
- And then upload it to my FTP, PHP echos it like this "HelloThis is a message". Is there anyway for PHP to notice the 'white space'?
--OR--
If you know of a better way to make a message system, then also let me know
Thanks, Ollie!
-
I get an error:
SQL query:
ALTER TABLE `users` CHANGE `due_balance` `due_balance` DOUBLE( 20 ) NOT NULL
--- Do i need to do something special with the Length/Values? ---
-
Ah okay - cheers
-
Hello,
As you may know, money is displayed like so: 10.50 (from where I am from its £10.50, but anyway ...)
So what would you recommend as a type for SQL to save that value, I would prefer it to be numeric, but I would also like to save the decimal so when it comes to PHP, I can see what is pounds (dollars) and pence (cents) in which I will soon later add to a mathematical array.
Thanks, Ollie!
-
hahah - english, what is that code doing basically?
Help With Dynamic Drop Box - HELP!!!
in PHP Coding Help
Posted
I really can't get my head around this dynamic drop box. What I want is for a drop box to be populated with values in my database.
I have this that connects to my SQL and picks out the table required:
I then have this to pick out any errors, and also using the num_rows to get the number of rows (values) there are:
From here, I guess I want the num_rows to keep 'adding on' the number of <option value=""> in my selection box according the number of values I have in my database.
At this point, I can pull out the values into a dynamic table ... but I want it into a drop box -- but I'll but up the code for the dynamic table so you can get an idea:
I hope you can use the code above to help me develop this darn drop box!
Thanks, Ollie!