close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Nothing happens

Thread began 6/05/2012 8:59 am by hbibizadeh396670 | Last modified 6/06/2012 6:50 pm by Ian S | 1301 views | 15 replies |

hbibizadeh396670

Nothing happens

I am adding a Friends feature to social network, like facebook.

My system works as follows:

I am trying to create a new record in a table each time the add friend button is clicked.

The table needs to contain the user ids of the user making the friend request and the user who’s profile is being viewed.

I would then filter the data later to create friend lists and so on... I have user registration in place for the IDs... so that is not an issue.

The issue is, when clicking the button, the page just re-loads and does not create a record or do anything.

As the page is supposed to redirect to the index page afterwords, I know that there is an error or I am doing something incorrectly.

Although, I do not understand the issue, as I am an experienced user of these products

Help would be appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of your page please so i can see the code.

Sign in to reply to this post

hbibizadeh396670

Thanks, I have attached a copy.

Attached Files
Page.zip
Sign in to reply to this post

Ian S

It looks like your server side validation is failing, because you don't have a captcha in the form...

Take out this code....

<?php 
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "UserProfile.php";
$_SESSION['WAVT_UserProfile_767_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateLE(strtolower($_SESSION['captcha_Security_Code_1']) . "",strtolower(((isset($_POST["Security_Code_1"]))?$_POST["Security_Code_1"]:"")) . "",true,1);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"UserProfile_767");
}
}
?>



and see if that helps.

The problem looks like submission is failing, but you have not setup any show on fail messages.

Also, on a side note, you are referring to a session value in your validation but have not started sessions on the page (unless they are started in one of the includes)

Cheers
Ian

Sign in to reply to this post

hbibizadeh396670

Thanks that works, but I have a small issue again.

I need to filter a recordset twice. It need to filter based on a UserID in a form field on the page, and the UserID of the logged in user to see if the database table contains a record with both the users. Hence, they are friends already.

My plan was then to use "show if" to display messages. However I cannot make it work. Is my SQL incorrect?


SELECT *
FROM friends
WHERE UserID = colname AND FriendID = colnamem

colname
$_POST['AddFriend_UserID']

colnamem
$_SESSION['UserID']

Sign in to reply to this post

Ian S

That looks OK to me.

Is this on a different page to the one you attached?

Having you got <?php session_start(); ?> at the top of the page so that the SESSION call can read the value?

Cheers
Ian

Sign in to reply to this post

hbibizadeh396670

Thanks

Its all the same page, but this is a more up to date version

An interesting point, for testing purposes. I edited the sql to have the ids in the database, and it did work. (The add friend button was hidden) but when i try and use the session variables etc... it stops working.

Attached Files
Page.zip
Sign in to reply to this post

hbibizadeh396670

Any Ideas?

Sign in to reply to this post

Ian S

Have you added the session_start code at the top of the page?

Cheers
Ian

Sign in to reply to this post

hbibizadeh396670

Yep, I added the code on line 1

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...