Tagg Posted December 20, 2008 Share Posted December 20, 2008 Currently I am working on updating a new profile layout. On the old one you would have to put in their ID followed by the message. I know this is annoying to do for users so I wish to make it automatically insert the ID, which doesn't seem to be working for me (tried using $_GET[iD] as value= to call it). else { print "<form action='writepm.php' method='post'>"; print "ID of recipient:<br>"; print "<input type='text' name='nameID' size='5' value=$_GET[iD]><br>"; print "Subject:<br>"; print "<input name='subject' type='text' size='30'><br>"; print "Message:<br>"; print "<textarea name='message' rows='5' cols='40'></textarea><br><br>"; print "<input type='submit' name='submit' value='sen The code for 'nameID' is $nameID=$_POST['nameID']; $suser="SELECT * from km_users where ID='$nameID'"; $suser2=mysql_query($suser) or die("Could not get user"); $suser3=mysql_fetch_array($suser2); Code used to send it once it passes the if else statements verifying if there is an ID/Subject/Msg { $subject=$_POST['subject']; $message=$_POST['message']; $date=date("U"); $sendmessage="INSERT into km_pms (sender, receiver,subject,message,therealtime) values('$userstats3[iD]','$nameID','$subject','$message','$date')"; mysql_query($sendmessage) or die("Could not send message"); print "PM Sent, please go back to <A href='pm.php'>PM Main</a>."; } I based this off the other things that can be done straight from the new profile (like view stats) which would bring up their page. But the calling of the user ID has caught me off guard which doesn't seem to work the same way I reckon? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.