Search
Left Quote    Every day I get up and look through the Forbes list of the richest people in America. If I
- Robert Orben    
Right Quote
 
[login] | [Register]
Forum Index » PHP and mySQL » Viewing Topic and Replies
Post Reply


        Viewing Topic: comment script and registered users
  This user is offline  skoda1203
  Subject: "comment script and registered users" Posted: @ 3:09 am on Jun 29 2011   
Member #: 1394
Rank: User - (3)
Since: 06/29/11
Posts: 3

Hello,

I have a registration only page. I already have working registration for members but it is not made by your tutorial. How can I change your comment script (which is great) so users don't need to fill name and contact information? If you could just point me to the right direction I would be very grateful.

Thank you very much and sorry for my english.

    Viewed: 17,308 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: comment script and registered u..." Posted: @ 4:45 am on Jun 29 2011    

Member #: 1
Rank: Admin. - (1,498)
Since: 02/05/05
Posts: 593
From: USA

Just remove everything in the script that checks for name, checks for contact, and delete the display in the form and output for name and contact. Also the same in the table design and query where the appropriate values are added.




-bs0d | AllSyntax.com

    Viewed: 17,299 Times | Reply to This | To top
  This user is offline  skoda1203
  Subject: "re: comment script and registered u..." Posted: @ 7:08 am on Jun 29 2011    
Member #: 1394
Rank: User - (3)
Since: 06/29/11
Posts: 3

Thank you very much for your reply. It works great except I can't see who posted the comment. I will try to work it out somehow. Thank you again for your help and work you have done writing the script and helping everyone on the forums.



    Viewed: 17,295 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: comment script and registered u..." Posted: @ 10:13 am on Jun 29 2011    

Member #: 1
Rank: Admin. - (1,498)
Since: 02/05/05
Posts: 593
From: USA

I may have misunderstood your email. If you did what I told you, then it won't even factor in username or contact data whatsoever.

I bet you wanted it to enter in their username if they're already signed in. To do that, if you're storing usernames in sessions when they login, then just set the value to $_SESSION['var iable_of_your_u sername_here'] ;

same goes for contact data.




-bs0d | AllSyntax.com

    Viewed: 17,283 Times | Reply to This | To top
  This user is offline  skoda1203
  Subject: "re: comment script and registered u..." Posted: @ 12:07 am on Jun 30 2011    
Member #: 1394
Rank: User - (3)
Since: 06/29/11
Posts: 3

I works exactly how I want it to. I can't believe how easy that was. Thank you again.




    Viewed: 17,263 Times | Reply to This | To top
  This user is offline  tony
  Subject: "re:commentscrip tandregisteredu ser..." Posted: @ 9:23 pm on Sep 12 2011    
Member #: 1411
Rank: User - (1)
Since: 09/12/11
Posts: 1

hi guys, im having same problem ...
when i add comment doesn't show the username,shows just blank
where do i have to add $_SESSION['var iable_of_your_u sername_here'] ;

can u be a litle more specific
thnxx



Edited at 09:32:59 pm on 09/12/11


    Viewed: 16,307 Times | Reply to This | To top
  This user is offline  bs0d
  Subject: "re: commentscript and registered us..." Posted: @ 5:19 pm on Sep 13 2011    

Member #: 1
Rank: Admin. - (1,498)
Since: 02/05/05
Posts: 593
From: USA

You need to be more specific about what we're dealing with here. Are you trying to post as a person via session (where someone is already logged in to the site), or simply allow a user to type in their name?

Either way, that name should be passed to the database and stored in the table with the comment. So using phpMyAdmin perhaps, I would browse the table and see if the usernames are being stored. This is of course assuming that you setup the table to accept usernames, and added the functionality to the script to add the username.

So if you're using a member system and the username for the comment should be auto-populated if a $_SESSION variable exists for a username, then you might want to check out the Members System tutorial, more specifically [link=http://ww w.allsyntax.com /tutorials/PHP/ 26/Complete-Mem bers-System/6.p hp] creating a login
script[/link] and ensure the user is being logged in and the SESSION
vars set.

Otherwise (you want a user to type in a name) then ensure your $_POST variable for the username is being set and contains a value. Maybe you're not referencing it properly when you check for it? This would be determined by your form element name of the field where a user should enter their name.



Edited at 05:26:13 pm on 09/13/11


-bs0d | AllSyntax.com

    Viewed: 16,271 Times | Reply to This | To top
Viewing Page: 1 of 1


1 |

You must be logged in to post on the forums. Login or Register






"AllSyntax.com" Copyright © 2002-2014; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank