Jump to content

Problem Of Sending Email To User


Recommended Posts

Dear SIr,I am a web designer i have command in adobe,flash and dreamweaver.Now i am interested in PHP language.Recently i learn some lessons from w3schools.I am facing a problem in some lecture.Let me explain them.I have made a NETserver to run PHP.1)When i use the scripting to make an upload form it express that ur uploading file is saved in C/WINDOWS/TMP/iMGage_name.But when i reack to this path i dont find any file.Secondly,When i use another scripting which allows me to save uploading file in UPLOAD folder.I can even find file there.Sir,let me know where do the files save after uploading?2)Second problem occurs in EMAIL sending.When i use php scripting from W3SChools to send an email.IT does not work.Sir,please let me know what is a EMAIL system And how will it work.I use the following SCripting for email sending.<html><body><?phpif (isset($_REQUEST['email']))//if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "someone@example.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; }else//if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; }?></body></html> Sir please teach me,how can i learn to send email from a LOCALSERVER.I shall be very thankul to u if u teach me to resolve these problems.I am writing u because u seem a nice person who help others.Than u.

Link to post
Share on other sites
  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

ehat can i do to only the member delet him article only
It looks like the ssubject table has this field:mem_id int(10) Yes 0Is that the member ID of the person who owns it? I also see this in your mail script:$_SESSION["UserID"]So I'm assuming that $_SESSION['UserID'] contains the member ID of the user who is logged in. To make sure that the user can only delete their own stuff, you can add that to the SQL query. So this:$delete=mysql_query("DELETE from ssubject WHERE id='$sid'");would become this:$delete=mysql_query("DELETE FROM ssubject WHERE id='$sid' AND mem_id={$_SESSION['UserID']}");Mubashar - Please don't use amrgad's topic to ask your questions, create your own topic and ask your question there.
Link to post
Share on other sites

now it is good but whene the user delet his article give him mesage and if he try to delet another user article give him the same mesageand both mesage said the aricle was delet when i see to articles the user article was really delletedbut the article to another user wsn't delet this code if($delete){echo "تم الحذف بنجاح";} else {echo "هناك خطأ في عملية الحذف";}i need if he try to delet ather user article give him message that is not allowed to youor thatecho "هناك خطأ في عملية الحذف

Link to post
Share on other sites

Replace this:$delete=mysql_query("DELETE FROM ssubject WHERE id='$sid' AND mem_id={$memberid}");if($delete){echo "تم الحذف بنجاح";} else {echo "هناك خطأ في عملية الحذف";}with this:

$result = mysql_query("SELECT mem_id FROM ssubject WHERE id='{$sid}'");if ($row = mysql_fetch_assoc($result)){  if ($row['mem_id'] == $memberid)  {	$delete=mysql_query("DELETE from ssubject WHERE id='$sid'");	if($delete){echo "تم الحذف بنجاح";} else {echo "delete failed";}  }  else  {	echo "هناك خطأ في عملية الحذف";  }}else{  echo "Article ID not found in database";}

You may need to translate the English to Arabic. This:echo "delete failed";just means that for some reason the database was not able to delete the record, but we don't know why. This:echo "Article ID not found in database";means that the article ID they clicked on wasn't found in the database.

Link to post
Share on other sites

done and thank you siri need also to srarsh for user i have searsh for article and subjecti need to add searsh for memberthis is searsh code <html><head><meta http-equiv="Content-Language" content="en-us"><meta name="GENERATOR" content="Microsoft FrontPage 6.0"><meta name="ProgId" content="FrontPage.Editor.Document"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>New Page 1</title></head><body><div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" width="100%"> <tr> <td width="50%" style="border-style: none; border-width: medium" align="center"> <input type="submit" value="إعلان" name="B1" style="width:50"></td> <td width="50%" style="border-style: none; border-width: medium" align="center"> <input type="text" name="adv" size="12"></td> </tr> <tr> <td width="50%" style="border-style: none; border-width: medium" align="center"> <input type="submit" value="موضوع" name="B1" style="width:50"></td> <td width="50%" style="border-style: none; border-width: medium" align="center"> <input type="text" name="sub" size="12"></td> </tr> </table> </center></div></body></html>and this is searchnum in index.phpif($action == "searchnum"){br();if ($adv == "" AND $sub == ""){echo $Msg['search_failed']; }br(); br();if ($adv != "" AND $sub == ""){ $as_selectt = mysql_query ("SELECT * from ssubject where id='$adv' and active='1' "); $count_advs= mysql_num_rows($as_selectt); if($count_advs == "0"){ echo "<center>عفواً... لا يوجد إعلان بهذا الرقم <br> حاول مرة أخرى </center>";} if($count_advs != ""){ while ($Row4=mysql_fetch_array($as_selectt)) { $s_id = $Row4 [id]; $cat_id = $Row4 [cat_id]; $mem_id = $Row4 [mem_id]; $sscountry = $Row4 [scountry]; $s_name = $Row4 [s_name]; $s_photo = $Row4 [s_photo]; $s_disc = $Row4 [s_disc]; $start_date = $Row4 [start_date]; $end_date = $Row4 [end_date]; $rep = $Row4 [replay]; $count = $Row4 [count]; $as7_select = mysql_query ("SELECT * from members where id='$mem_id' and active='1'"); while ($Row=mysql_fetch_array($as7_select)) { $id = $Row [id]; $mem_name = $Row [name]; $country = $Row [country]; $city = $Row [city]; $email = $Row ; $email_case = $Row [email_case]; $address = $Row [address]; $mobile = $Row [mobile1]; $tel = $Row [tel]; $another_ways = $Row [another_ways]; $date = $Row [date]; $special = $Row [special]; } $selecctm= mysql_query ("SELECT * from mtajer where mem_id='$mem_id' and active='1'"); $countm= mysql_num_rows($selecctm); $seleccts= mysql_query ("SELECT * from ssubject where mem_id='$mem_id' and active='1'"); $counts= mysql_num_rows($seleccts); $selecct= mysql_query ("SELECT * from forum_subjects where mem_id='$mem_id' and active='1'"); $countfs= mysql_num_rows($selecct); $selecctt= mysql_query ("SELECT * from forums where mem_id='$mem_id' and active='1'"); $countf= mysql_num_rows($selecctt); $selecctt= mysql_query ("SELECT * from subject_replays where subject_id='$s_id' and active='1'"); $countrep= mysql_num_rows($selecctt); $as2d_select = mysql_query ("SELECT * from ssubject where id='$s_id' and active='1'"); while ($Row9=mysql_fetch_array($as2d_select)) { $subjectid = $Row9 [id]; } $ascat_select = mysql_query ("SELECT * from cats where id='$cat_id' and active='1'"); while ($Row3=mysql_fetch_array($ascat_select)) { $catname = $Row3 [cat_name]; } $as17_select = mysql_query ("SELECT * from country where id='$sscountry'"); while ($Roww=mysql_fetch_array($as17_select)) { $scountry = $Roww [country]; }center();include ("template/style1/subject_disc.htm");echo "</td></tr></table></center>";br();echo "<table width=95% border=1 cellspacing=0 cellpadding=0 bordercolor=#efe8d6 style=\"border-collapse: collapse\"><tr><td align=center bgcolor=#efe8d6> <b><font color=#FF0000>الإعلان</font></b> </td></tr>";echo "<tr><td>";include ("template/style1/subject_form.tpl");echo "</td></tr></table>";br();echo "<table width=95% border=1 cellspacing=0 cellpadding=0 bordercolor=#efe8d6 style=\"border-collapse: collapse\"><tr><td align=center bgcolor=#efe8d6> <b><font color=#FF0000>المعلن</font></b> </td></tr>";echo "<tr><td>";include ("template/style1/member_form3.tpl");echo "</td></tr></table>";if ($memberid == ""){}else {br();echo "<table width=95% bgcolor=#efe8d6 height=25><tr><td align=center> <b><font color=#FF0000>الردود: $countrep</font></b> </td></tr></table>";br(); $asmemr_select = mysql_query ("SELECT * from subject_replays where subject_id='$advid' and active='1' order by id desc"); while ($Row55=mysql_fetch_array($asmemr_select)) { $ssub_id = $Row55[id]; $member_id = $Row55[mem_id]; $replay = $Row55[replay]; $date = $Row55[date]; $asmem_select = mysql_query ("SELECT * from members where id='$member_id' and active='1'"); while ($Row6=mysql_fetch_array($asmem_select)) { $name = $Row6 [name]; $country = $Row6 [country]; $email = $Row6 ;include ("template/style1/replay_form.tpl");} } if($rep == "1"){br(); br();echo "<table width=95% bgcolor=#1875B5><tr><td align=center> <b><font color=#FF0000>إضافة رد</font></b> </td></tr></table>";br();echo "<table width=95% bgcolor=#ffcc66><tr><td align=center><font size=2 color=#FF0000><b>تحذير: إن إساءة استخدامك لهذا الموقع سيعرضك للمسائلة من السلطات الأمنية، مع العلم أن رقم الأي بي (IP) الخاص بك هو:</b></font>  ";echo"<b><font size=2 color=#FF0000>". $_SERVER["REMOTE_ADDR"] ."</font><b><br><br></td></tr></table>";echo"<form action=\"index.php?action=insert_avds_replay&memb_id=$memberid&advv_id=$advid\" method=\"post\">";include ("template/style1/replays.tpl");br();echo "</form>"; } if($rep == "0"){?><table border="1" width="95%" bordercolor="#1875B5" style="border-collapse: collapse" height="93"> <tr> <td bgcolor="#1875B5" height="29"> <p align="center"><b><font color="#FF0000">إضافة رد</font></b></td> </tr> <tr> <td bgcolor="#F7F7F7"> <p><font color="#FF0000"><b>عفواً...قام صاحب هذا الإعلان بإغلاق خاصية الردود.</b></font><br>لأن صاحب هذا الإعلان <a href="index.php?action=special_member"><span lang="ar-eg">عضو مميز</span></a>، فإنه يستطيع إغلاق خاصية الردود على أي إعلان من إعلاناته.</p></p> <p> </td> </tr> </table><? }}br();c_center(); }}}if ($sub != "" AND $adv == ""){ $as_selectt = mysql_query ("SELECT * from forum_subjects where id='$sub' and active='1' "); $count= mysql_num_rows($as_selectt); if($count == ""){ echo "<center>عفواً...لا يوجد موضوع بهذا الرقم <br> حاول مرة أخرى </center>";} if($count != ""){ while ($Row4=mysql_fetch_array($as_selectt)) { $fs_id = $Row4 [id]; $mem_id = $Row4 [mem_id]; $sscountry = $Row4 [scountry]; $fs_name = $Row4 [fs_name]; $fs_photo = $Row4 [fs_photo]; $fs_disc = $Row4 [fs_disc]; $start_date = $Row4 [add_date]; $end_date = $Row4 [end_date]; $count = $Row4 [count]; $as7_select = mysql_query ("SELECT * from members where id='$mem_id' and active='1'"); while ($Row=mysql_fetch_array($as7_select)) { $id = $Row [id]; $mem_name = $Row [name]; $country = $Row [country]; $city = $Row [city]; $email = $Row ; $email_case = $Row [email_case]; $address = $Row [address]; $mobile = $Row [mobile1]; $tel = $Row [tel]; $another_ways = $Row [another_ways]; $date = $Row [date]; $special = $Row [special]; } $selecctm= mysql_query ("SELECT * from mtajer where mem_id='$mem_id' and active='1'"); $countm= mysql_num_rows($selecctm); $seleccts= mysql_query ("SELECT * from ssubject where mem_id='$mem_id' and active='1'"); $counts= mysql_num_rows($seleccts); $selecct= mysql_query ("SELECT * from forum_subjects where mem_id='$mem_id' and active='1'"); $countfs= mysql_num_rows($selecct); $selecctt= mysql_query ("SELECT * from forums where mem_id='$mem_id' and active='1'"); $countf= mysql_num_rows($selecctt); $selecctt= mysql_query ("SELECT * from fs_replays where fs_id='$fs_id' and active='1'"); $countrep= mysql_num_rows($selecctt); $as17_select = mysql_query ("SELECT * from country where id='$sscountry'"); while ($Roww=mysql_fetch_array($as17_select)) { $scountry = $Roww [country]; }center();include ("template/style1/fs_disc.htm");br();echo "<table width=95% border=1 cellspacing=0 cellpadding=0 bordercolor=#1875B5 style=\"border-collapse: collapse\"><tr><td align=center bgcolor=#1875B5> <b><font color=#FFFFFF>الموضوع</font></b> </td></tr>";echo "<tr><td>";include ("template/style1/fs_form.tpl");echo "</td></tr></table>";br();echo "<table width=95% border=1 cellspacing=0 cellpadding=0 bordercolor=#1875B5 style=\"border-collapse: collapse\"><tr><td align=center bgcolor=#1875B5> <b><font color=#FFFFFF>المعلن</font></b> </td></tr>";echo "<tr><td>";include ("template/style1/member_form3.tpl");echo "</td></tr></table>";if ($memberid == ""){}else {br();echo "<table width=95% bgcolor=#1875B5><tr><td align=center> <b><font color=#FFFFFF>الردود</font></b> </td></tr></table>";br(); $asmemr_select = mysql_query ("SELECT * from fs_replays where fs_id='$forumid' and active='1' order by id desc"); while ($Row55=mysql_fetch_array($asmemr_select)) { $member_id = $Row55[mem_id]; $replay = $Row55[replay]; $date = $Row55[date]; $asmem_select = mysql_query ("SELECT * from members where id='$member_id' and active='1'"); while ($Row6=mysql_fetch_array($asmem_select)) { $name = $Row6 [name]; $country = $Row6 [country]; $email = $Row6 ;include ("template/style1/replay_form.tpl");} }br(); br();echo "<table width=95% bgcolor=#1875B5><tr><td align=center> <b><font color=#FFFFFF>إضافة رد</font></b> </td></tr></table>";br();echo "<table width=95% bgcolor=#FDFBF2><tr><td align=center><font size=2 color=#FF0000><b>تحذير: إن إساءة استخدامك لهذا الموقع سيعرضك للمسائلة من السلطات الأمنية، مع العلم أن رقم الأي بي (IP) الخاص بك هو:</b></font>  ";echo"<b><font size=2 color=#FF0000>". $_SERVER["REMOTE_ADDR"] ."</font><b><br><br></td></tr></table>";echo"<form action=\"index.php?action=insert_fs_disc_replay&memb_id=$memberid&fsid=$fs_id\" method=\"post\">";include ("template/style1/replays.tpl");br();echo "</form>";}br();c_center(); }}}}

Link to post
Share on other sites

You want people to search for member name?What are these fields for:<tr><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="submit" value="إعلان" name="B1" style="width:50"></td><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="text" name="adv" size="12"></td></tr><tr><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="submit" value="موضوع" name="B1" style="width:50"></td><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="text" name="sub" size="12"></td></tr>That looks like maybe the article ID, then subject. What do the 2 buttons mean?

Link to post
Share on other sites

I'm not quite sure how this submits, but this should add a new button and field:<tr><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="submit" value="عضو" name="B1" style="width:50"></td><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="text" name="user" size="12"></td></tr>Add that above or below one of the other buttons, after one of the </tr>s.I can have it search for a user, but I don't know what it needs to do after that. Searching for the other 2 things makes it do 2 different things, so I don't know what it's supposed to do to show whatever you want it to show when you search for a user.To start with, you can change this:if ($adv == "" AND $sub == ""){echo $Msg['search_failed']; }to this:$search_user = $_POST['user'];if ($adv == "" AND $sub == "" AND $search_user == ""){echo $Msg['search_failed']; }That will give an error if they don't fill something out. Other than that, I'm not sure what to tell you. Searching using sub searches the ssubjects table and uses a certain Smarty template, and searching using adv searches the forum_subjects table, and also uses some Smarty templates. I'm not sure what the Smarty templates are being used for or what they need in order to work. You can add this to your search page under the code I wrote above to add a search for member name:

if ($search_user != ''){  $result = mysql_query ("SELECT * from members where name LIKE '%" . mysql_real_escape_string($search_user) . "%' and active='1'");  echo "Found " . mysql_num_rows($result) . " users<br>";  while ($row = mysql_fetch_assoc($result))  {	echo "Name: {$row['name']}; country: {$row['country']}; city: {$row['city']}<br>";	  }}

That will just print out a list of users that matched the search, but beyond that I'm not real sure what you want it to do once it finds people.

Link to post
Share on other sites

thank you sir very much for your helpi need my result for user like that <table border="0" width="100%" bordercolor="#FFFFFF" cellpadding="2" height="71"> <tr><td width="26%" height="15" bgcolor=#efe8d6> <b> <span lang="ar-eg">اسم المستخدم</span></b></td> <td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo $name; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">تاريخ العضوية</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $date; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الإعلانات</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $countt; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">المتجر الإلكتروني</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $m_name; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">المنتدى الإلكتروني</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $counttt; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b>البريد الإليكتروني</b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $email; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الدولة</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $country; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">المدينة</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $city; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الجوال</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $mobile; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الهاتف</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo $tel; ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">طرق اتصال أخرى</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? $another_ways=nl2br($another_ways);?> <? echo $another_ways; ?></td> </tr> </table>i make page with this code name : member_s.tplwhat can i do to make the result searsh for user fill this table ?

Link to post
Share on other sites

ه did that sir <table border="0" width="100%" bordercolor="#FFFFFF" cellpadding="2" height="71"> <tr><td width="26%" height="15" bgcolor=#efe8d6> <b> <span lang="ar-eg">اسم المستخدم</span></b></td> <td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo " {$row['name']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">تاريخ العضوية</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['date']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الإعلانات</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['countt']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">المتجر الإلكتروني</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['m_name']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">المنتدى الإلكتروني</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['ccoounttt']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b>البريد الإليكتروني</b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['email']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الدولة</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['country']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">المدينة</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['city']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الجوال</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['mobile1']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">الهاتف</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['tel']}" ?></td> </tr> <tr><td width="26%" height="19" bgcolor=#efe8d6> <b> <span lang="ar-eg">طرق اتصال أخرى</span></b></td> <td width="85%" height="19" align="right" bgcolor="#efe8d6"><? $another_ways=nl2br($another_ways);?> <? echo "{$row['another_ways']}" ?></td> </tr> </table>on member_sbut 3 opjects not print any results$row['m_name'{$row['ccoounttt']}{$row['countt']}this three i can't do it

Link to post
Share on other sites

Dear Sir,please help me.When i try to send email from a simple script of php it shows the following error.Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\xampp\htdocs\mailform.php on line 11Thank you for using our mail form .Please tell me how can i rechange SMTP setting.I Cant find php.ini file from my LOCal server.Tell me where is it placed and also inform me should i connect internet while browsing this script.please help me i am new in this field.Thank u.

Link to post
Share on other sites
but 3 opjects not print any results$row['m_name'{$row['ccoounttt']}{$row['countt']}this three i can't do it
Make sure you're using the correct names from the database. I'm not sure if 'ccoounttt' is the correct field name to use. Why would someone make a column with a name like that?Mubashar - Please create your own topics to ask questions, don't ask your questions in another person's topic.
Link to post
Share on other sites
I'm not quite sure how this submits, but this should add a new button and field:<tr><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="submit" value="عضو" name="B1" style="width:50"></td><td width="50%" style="border-style: none; border-width: medium" align="center"><input type="text" name="user" size="12"></td></tr>Add that above or below one of the other buttons, after one of the </tr>s.I can have it search for a user, but I don't know what it needs to do after that. Searching for the other 2 things makes it do 2 different things, so I don't know what it's supposed to do to show whatever you want it to show when you search for a user.To start with, you can change this:if ($adv == "" AND $sub == ""){echo $Msg['search_failed']; }to this:$search_user = $_POST['user'];if ($adv == "" AND $sub == "" AND $search_user == ""){echo $Msg['search_failed']; }That will give an error if they don't fill something out. Other than that, I'm not sure what to tell you. Searching using sub searches the ssubjects table and uses a certain Smarty template, and searching using adv searches the forum_subjects table, and also uses some Smarty templates. I'm not sure what the Smarty templates are being used for or what they need in order to work. You can add this to your search page under the code I wrote above to add a search for member name:
if ($search_user != ''){  $result = mysql_query ("SELECT * from members where name LIKE '%" . mysql_real_escape_string($search_user) . "%' and active='1'");  echo "Found " . mysql_num_rows($result) . " users<br>";  while ($row = mysql_fetch_assoc($result))  {	echo "Name: {$row['name']}; country: {$row['country']}; city: {$row['city']}<br>";	  }}

That will just print out a list of users that matched the search, but beyond that I'm not real sure what you want it to do once it finds people.

this is the code you tell me sir to searsh for user or member i neet the reasalts in the table that is all
Link to post
Share on other sites
if ($search_user != ''){  $result = mysql_query ("SELECT * from members where name LIKE '%" . mysql_real_escape_string($search_user) . "%' and active='1'");  echo "Found " . mysql_num_rows($result) . " users<br>";  echo '<table>';  while ($row = mysql_fetch_assoc($result))  {	echo '<tr>';	echo "<td>Name: {$row['name']}</td>";	echo "<td>country: {$row['country']}</td>";	echo "<td>city: {$row['city']}</td>";		echo '</tr>';  }  echo '</table>';}

Link to post
Share on other sites

sir i need it to print in this table<table border="0" width="100%" bordercolor="#FFFFFF" cellpadding="2" height="71"><tr><td width="26%" height="15" bgcolor=#efe8d6><b><span lang="ar-eg">اسم المستخدم</span></b></td><td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo " {$row['name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">تاريخ العضوية</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['date']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الإعلانات</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['countt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المتجر الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['m_name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المنتدى الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['ccoounttt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b>البريد الإليكتروني</b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['email']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الدولة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['country']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المدينة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['city']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الجوال</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['mobile1']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الهاتف</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['tel']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">طرق اتصال أخرى</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? $another_ways=nl2br($another_ways);?> <? echo "{$row['another_ways']}" ?></td></tr>i put this table in file and i pute it as inclode fie after searsh code

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...