Jump to content

haibec

Members
  • Posts

    102
  • Joined

  • Last visited

Posts posted by haibec

  1. In the case of AJAX you could also return the data as an xml-structure and parse it using JS and add to the select/combo box.The JS could look something like this
    function StateChanged(){	if (XmlHttp.readyState == 4) {		var XmlDoc = XmlHttp.responseXML;		// Clear the select		var sel = document.getElementById('districts');		for (I = 0; I < sel.length;  ) {			sel.remove( 0 );		}		// The the districts (DOM)		Districts = XmlDoc.getElementsByTagName("district");		// Loop thru the districts		for (var I = 0; I < Districts.length; I++) {			// Get the districtname			var District = Districts[I].firstChild.nodeValue;			var DistrictId = Districts[I].item(0).getAttribute( 'id' );			// Create a new option			var elOptNew = document.createElement('option');			elOptNew.text = District;			elOptNew.value = DistrictId;			// Get the select			var elSel = document.getElementById('districts');			// Add the option/district			try {				elSel.add(elOptNew, null); // standards compliant; doesn't work in IE			} catch(ex) {				elSel.add(elOptNew); // IE only			}		}	}function GetDistricts( Province ){	XmlHttp = GetXMLHTTPObject();	if (XmlHttp==null) {		alert ("Your browser does not support AJAX!!");		return;	}	XmlHttp.onreadystatechange = StateChanged;	var URL = "getdistricts.php";	URL = URL + "?province=" + Province;	XmlHttp.open( "GET", URL, true );	XmlHttp.send(null);}function ProvinceSelected() {	// Get the number/index (in the select) of the selected province	var ProvinceNum = document.getElementById('provinces').selectedIndex;	// Get the id of the province	var Province = document.getElementById('provinces').options[ ProvinceNum ].value;	// Get districts	GetDistricts( Province );}.....<select id="provinces" name="provinces" onchange="ProvinceSelected()">{Provinces:<option value="ID">PROVINCE</option>}</select><select id="districts" name="districts"></select>

    The getdistricts.php-file could look something like this:

    <?php// Open db and so on...$query = "SELECT * FROM District WHERE ProvinceID=".$_GET['province'];$res = mysql_query( $query );echo '<?xml version="1.0"?>'."\n";echo '<province id="'.$_GET['province']."\">\n";while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {	echo '  <district id="'.$row['DistrictId'].'">';	echo $row['DistrictName'];	echo "  </district>\n";}echo "</province>\n";// Close DB and so on..?>

    Hope that helped...Good Luck and Don't Panic!

    Okie! thank you very much ! :)
  2. Hi Guys!I making a PHP for register. I have a 2 table . Table Province include ProvinceID,ProvinceName. Table Distrist include : ProvinceID,DistristID,DistristName. In my page have a two combo box : Province and Distrist. I want when User click into combo box province then in combobox distrist will list all values distrist of Province. Please help me

  3. Hi Guys!I make a page ASP for sendmail use CDO.Message (Send about 500.000 Email). Now , I have a file .JPG size about 500KB. I Public this file .JPG into a Webserver. When I send mail for 500.000 Email. I want send a HTML email (Purpose, email send for customer size very small.) When Customer open their email will view that file .JPG on Webserver. This is my code:<% Dim MyMail,HTML%><!--#INCLUDE FILE="connect.asp"--><% server.ScriptTimeout=server.ScriptTimeout * 10000000 response.write(Server.ScriptTimeout) sSQL = "select * from Customer order by JID desc" Set rs = Server.CreateObject("ADODB.Recordset") rs.source=sSQL set rs.Activeconnection = conn rs.Open,,1,3,1 do while not rs.eof Set myMail=CreateObject("CDO.Message") myMail.Subject="Hello!" MyMail.From= "Jonh <webmaster@bbc.com>" MyMail.To =rs("Email") myMail.CreateMHTMLBody " " 'Please help me %><% MyMail.Subject = " hello!" MyMail.Send response.Write(rs("Email")&" OK "&"<p>") rs.movenext Loop Set Mymail=nothing rs.close set rs=nothing conn.close set conn=nothingserver.ScriptTimeout=server.ScriptTimeout / 10000000%>

  4. MailEnable is probably the best option, but as you can see, it's not exactly free. There's a free version with limited capabilities and payed ones.If you're looking for totally freeware mail server, then the only one I know is Mercury Mail, but I have no idea how to work with it. It's interface is really not user friendly, at least not in comparrison to Mail Enable.
    Thank you very much ! :)
  5. Hi Guys!I have problem : I have table Lottery include fields: ID,Name,Ticket1,Ticket2,Ticket3 ( With a user have max three ticket). I make a program use for Lottery (with Ticket1,ticket2,ticket3). I user random() function.I Want break up my table folow :I will add 2 field in to my table have name : Ticket and NewID and NewID field is Autocrement. With a user have three ticket .Example : ID Name Ticket1 Ticket2 Ticket3 23 John 001 003 112will Break up: NewID ID Name Ticket 1 23 John 001 2 23 John 003 3 23 John 112And finish : I will dial number in NewID use random() functionPlease help me

  6. Hi Guys!I have two table. TB1 have ID,Name,Birthday full data. TB2 have ID,Name,Class have done data but Birthday is null. I want corect my DB. I want insert all data from Birhtday on TB1 into Birthday on TB2. Please help me

  7. you can't you would have to make it a .aspx page like this.
    <%@ Page Language="C#" %><script runat="server">private void Page_Load(object sender, EventArgs e){   ensureHttps();}private void ensureHttps(){	string url = Request.ServerVariables["REMOTE_ADDR"].ToString();	string protocol = url.Substring(0,5);	if(String.Compare("https",protocol) != 0)	{		url = url.Split(':')[1].Replace("//",String.Empty);		Response.Redirect("https://" + url);	}}</script><html><head>  <title></title></head><body></body></html>

    If you insist it must be done with a .htm page you will have to use JavaScript, but that is unreliable since users can turn it off. If you still want it I can write you a javascript to do this. Would you like me to?

    If you help me . I'm very thank to you!
    you can't you would have to make it a .aspx page like this.
    <%@ Page Language="C#" %><script runat="server">private void Page_Load(object sender, EventArgs e){   ensureHttps();}private void ensureHttps(){	string url = Request.ServerVariables["REMOTE_ADDR"].ToString();	string protocol = url.Substring(0,5);	if(String.Compare("https",protocol) != 0)	{		url = url.Split(':')[1].Replace("//",String.Empty);		Response.Redirect("https://" + url);	}}</script><html><head>  <title></title></head><body></body></html>

    If you insist it must be done with a .htm page you will have to use JavaScript, but that is unreliable since users can turn it off. If you still want it I can write you a javascript to do this. Would you like me to?

    I run it and have error:Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.Source Error: Line 13: if(String.Compare("https",protocol) != 0)Line 14: {Line 15: url = url.Split(':')[1].Replace("//",String.Empty);Line 16: Response.Redirect("https://" + url);Line 17: } help me!
  8. use the following function as the first to get executed on each page
    private void ensureHttps(){	string url = Request.ServerVariables["REMOTE_ADDR"].ToString();	string protocol = url.Substring(0,5);	if(String.Compare("https",protocol) != 0)	{		url = url.Split(':')[1].Replace("//",String.Empty);		Response.Redirect("https://" + url);	}}

    I have not had time to check this so there may be some small logic errors but ti demonstrates the basic idea.

    Hiihhihi!I don't know C# . I wan't make .htm with that function . Help me
  9. hi Guys!My Web server installed APACHE,PHP,MySQL running very good!. But today. have ERROR : There seems to have been a problem with the database.Please try again by clicking the Refresh button in your web browser.An E-Mail has been dispatched to our Technical Staff, whom you can also contact if the problem persists.We apologise for any inconvenience.I am running VBB and Kayyako (Code by PHP). Please help me

  10. Hi GuyS!My Webserver include two servers are running APACHE. one Server used save Pictures . That server include my code . With server picture . Member can browser folder images! I want not alow user browser folders images.Please help me!
    DETAIL :Hi friendsI’m trying to disable the browse directory option on Apache 2.0.43, I don’t want users to list any files, under directories without an index.html :).Does anyone know how can I accomplish this?Any help will be really appreciated...Best regards
  11. Hi GuyS!My Webserver include two servers are running APACHE. one Server used save Pictures . That server include my code . With server picture . Member can browser folder images! I want not alow user browser folders images.Please help me!

  12. Hi Guy!My web server is running IIS for ASP and APACHE for PHP but when i used APACHE running PHP i must change port in file httpd.conf is 8080. Now, i want running PHP on IIS (not must change port ) . Please help me this problem!

  13. Hi all!I have two table USER1 includes field : ID, Username,Password and Table USER2 includes filed : ID ,Username,Name . When user register . Data will save into 2 that table . One reason or other, two filed ID on the two table not same but Username on the 2 table same . I want UPDATE all ID on the User1 = ID on the User2 .Please help meeeeeeeeeeee

  14. Hi, Why do you need Trigger for simple update, just write an update query that will do?set Gold = Gold + 1000??If there is some thing that I got incorrect please let me know.Hope this helps.Good LuckHemendra Singh ShaktawatMindfire Solutionswww.mindfiresolutions.com
    Okie! please help me
×
×
  • Create New...