Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7747465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:32:11+00:00 2026-06-01T10:32:11+00:00

i’m working on a wordpress site using buddypress. So, i’m making a page where

  • 0

i’m working on a wordpress site using buddypress. So, i’m making a page where you can see members and search for them using a database: wp_users.
This works fine if i have it as a php when adding it to a wp page it shows up correctly but when clicking submit I get a 404 error.

This is the code:

    <!DOCTYPE  HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta  http-equiv="Content-Type" content="text/html;  charset=utf-8">
    <title>Search  Contacts</title>
  <style type="text/css">
  #spacer {
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-left-width: 1px;
    border-top-style: solid;
}
  </style>
  </head>
  <p><body>
    <p>&nbsp;</p>
    <form  method="post" action=""  id="searchform">
      <p>
        <input name="name"  type="text">
        <input  type="submit" name="submit" value="Søk">
      </p>
      <p>Tips: du kan søke etter adresse, navn og e-post.</p>
    </form>

  <table width="600">
            <tr>
              <th width="200" height="50">Navn</th>
                <th width="200">&nbsp;</th>
              <th width="200">E-post adresse</th>
            </tr>  
<?php
/* Change next two lines  if using online*/
$db="skynnaks_skyn";
$link = mysql_connect('localhost', 'skynnaks_skyn', '*password*');

if (! $link) die(mysql_error());
mysql_select_db($db , $link) or die("Couldn't open $db: ".mysql_error());
$result = mysql_query( "SELECT * FROM wp_users" )
          or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);

if ($result) {

while ($row = mysql_fetch_array($result)) { 
$_SESSION['id']=$row['id'];
#echo "<tr><a href='#'>".$row['display_name']."</a>";
echo "<td><a href="."/members/".$row['user_nicename']."/profile/>".$row['display_name']."</a></td>";
#echo "<a href=" '.$row['id'].'>Bruker: ".$row['user_url']."</a>";
echo "<td><a href=".$row['user_url'].">".$row['user_url']."</a></td>";
echo "<td><a href=".'mailto:'.$row['user_email'].">".$row['user_email']."</a></td></tr>";
}
}


?>
</table>
    <div id="spacer">
     <?php
  if(isset($_POST['submit'])){
  if(preg_match("/^[  a-zA-Z]+/", $_POST['name'])){
  $name=$_POST['name'];
  //connect  to the database
  $db=mysql_connect  ("localhost", "skynnaks_skyn",  "*password*") or die ('I cannot connect to the database  because: ' . mysql_error());
  //-select  the database to use
  $mydb=mysql_select_db("skynnaks_skyn");
  //-query  the database table
  $sql="SELECT  ID, user_login, user_nicename FROM wp_users WHERE user_login LIKE '%" . $name .  "%' OR user_nicename LIKE '%" . $name ."%'";
  //-run  the query against the mysql query function
  $result=mysql_query($sql);
  //-create  while loop and loop through result set
  while($row=mysql_fetch_array($result)){
          $loginName  =$row['user_login'];
          $niceName=$row['user_nicename'];
          $ID=$row['ID'];
  //-display the result of the array

  echo "<ul>\n";
  echo "<li>" . "<a href="."/members/".$loginName."/profile/>".$niceName."</a>" ;
  echo "</ul>";
  }
  }
  else{
  echo  "<p>Please enter a search query</p>";
  }
  }
?>
  </div>
    <p>&nbsp;</p>


  </body>
</html>
</p>

PS: I cant use default permalinks due buddypress plugin. And i know that buddypress comes with a members search, but i have installed norwegian language pack, but it wont work with members search in buddypress.

Thanks for the help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:32:13+00:00Added an answer on June 1, 2026 at 10:32 am

    It looks like this problem,

    so change your input tag name with any specific name attribute.

    for example,

    <input name="membername" type="text" />
    

    but don’t forget to get variable with same from $_POST

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.