627 Posted Topics
Re: [QUOTE]when I try to download image ...the file gets corrupted[/QUOTE] Have you tried sending the appropriate MIME type for the file. Assuming you are dealing with a JPEG image, try sending [iCODE]header("Content-type: image/jpeg");[/iCODE] instead of [iCODE]header("Content-type: application/octet-stream");[/iCODE] Also, be sure to add [iCODE]exit();[/iCODE] right before the closing [iCODE]?>[/iCODE] | |
Re: in your javascript code, line 66 should be: [iCODE]ajaxRequest.open("[COLOR="Red"]GET[/COLOR]", "dropdownyear.php" + queryString, true);[/iCODE] in dropdownmodel.php, line 12 should be: [iCODE]$opt = "<option [COLOR="Red"]value[/COLOR]='$Mod'>$Mod</option>";[/iCODE] | |
Re: You need to enclose the expression in parenthesis for the back reference to work. Since you need to replace based on your php array, you also need to use the 'e' switch at the end of the regex: [CODE] <?php $str="String of text containing item1 and item2"; $x['item1']="Item 1"; $x['item2']="Item … | |
Re: Upload File without COM [url]http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8525&lngWId=4[/url] Free ASP Upload [url]http://www.freeaspupload.net/[/url] ShadowUploader.asp [url]http://forums.aspfree.com/code-bank-54/pure-asp-upload-script-with-additional-features-94647.html[/url] ("attached" as zip file at bottom of page) | |
Re: [CODE] NOTE: On the steps below ">" mean "click on" ">>" mean "double click on" >Start >Control Panel >>Administrative Tools >>Services >>MySQL Change Startup type to Manual >Apply [/CODE] | |
Re: whenever you see "Warning: mysql_XXX expects XXX to be resource..." typically it means that whatever query you attempted to execute failed. So replace your line 13 with the following instead to find out what is causing the error: [iCODE]$result = mysql_query($query) or die( mysql_error() );[/iCODE] | |
Re: try: [CODE] $i = 0; while($row=mysql_fetch_array($result, MYSQL_NUM)) { echo "$row[0]"; if( !(++$i % 2) ) { echo "<br />"; } } [/CODE] | |
Re: read comments in code below: [CODE=javascript] //queue that keeps track of which requests are currently active var ajaxRequest=[]; //this function is where you would be making your ajax request function requestPage(url) { //now see if url is within ajaxRequest. If so, then just return var tempQ = ',' + ajaxRequest.join(",") … | |
Re: Change line 14 from this: [iCODE]clickLink.on[COLOR="Red"]C[/COLOR]lick = promptWhatsName[COLOR="Red"]()[/COLOR];[/iCODE] to this: [iCODE]clickLink.onclick = promptWhatsName;[/iCODE] | |
Re: You can use an external/remote SMTP server (Ex: gmail, as suggested above). Go to: [url]http://phpmailer.worxware.com/[/url] and get a copy of the PHPMailer class. Be sure to check: Products -> PHPMailer -> PHPMailer Examples -> Adv. SMTP Examples | |
Re: [CODE] var theDiv = document.getElementById("test"); //the div's content alert( theDiv.innerHTML ); /* get the paragraph - NOTE: getElementsByTagName returns an array of references to the elements that match the tag specified. In this case "p". Arrays are zero indexed, so the first P element is at index zero. If you … | |
Re: It sounds like you have: [CODE] if ($rank < "Boss, Supreme Boss, Kingpin, Don, Godfather"){ echo "You have to be ranked atleast Boss to kill"; } //code that "kills" follows here ... [/CODE] You need to wrap the code that kills in an else clause: [CODE] if ($rank < "Boss, … | |
Re: Where should be at the end: [CODE] $query = "SELECT COUNT(*) as num FROM $tableName where headm='" . mysql_real_escape_string($_GET['chead']) . "'"; [/CODE] | |
Re: this: [CODE]$(document).ready(function(){ $(".productSelect").click(function() { alert( this.innerHTML ); }); });[/CODE] is equivalent to this: [CODE]$(document).ready(function(){ $(".productSelect").bind('click',function() { alert( this.innerHTML ); }); });[/CODE] but bind will "attach/trigger" that anonymous function upon document.ready [B]ONLY[/B] to [B]already existing[/B] elements with class="productSelect". So, the elements that you are adding via ajax with class="productSelect" do not … | |
Re: On line 67, you probably meant to write [iCODE]$var_[COLOR="Red"]U[/COLOR]list = explode("\n",$var_data);[/iCODE] | |
Re: somewhere in your code you probably have a DB class (ex: [iCODE]$db = new DB(...);/* or something similar */[/iCODE]). Does that class have a method that will let you know if any records were returned? It would help to see the definition of your custom class. | |
Re: try "APPENDING" the text. If you just swap the lines you have, then you would be overwriting the textarea with the text: [CODE] var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cella = row.insertCell(0); cella.style.backgroundColor = "EAEAEA"; var element1 = document.createElement("textarea"); element1.cols = "9"; element1.rows … | |
Re: If you are viewing the output/result via a browser then try: [CODE]echo "<div style='text-align:center;'>Successfuly sent</div>";[/CODE] | |
Re: assuming you are using MySQL as your Database, as soon as you execute your INSERT statement, use the mysql_insert_id() function - [url]http://us3.php.net/manual/en/function.mysql-insert-id.php[/url] to retrieve the auto_number.Then use that number to INSERT it into your AF table: [CODE] ... $sql="INSERT INTO `room`(...) VALUES(...)"; $result = mysql_query($sql) or die( mysql_error() ); $Room_No=mysql_insert_id(); … | |
Re: line 27 is missing a semicolon at the end: [iCODE]echo"Page doesnt exist."[COLOR="Red"];[/COLOR][/icODE] | |
Re: Try: [CODE] xmlString ="<Chart:Bullet xmlns:Chart='http://yoursite.com' values='100,200' size='100x20' shading='5' ></Chart:Bullet>"; XmlDocument doc = new System.Xml.XmlDocument(); doc.LoadXml(xmlString); //Instantiate an XmlNamespaceManager object. System.Xml.XmlNamespaceManager xmlnsManager = new System.Xml.XmlNamespaceManager(xmldoc.NameTable); //Add the namespaces used in books.xml to the XmlNamespaceManager. xmlnsManager.AddNamespace("Chart", "http://yoursite.com"); [/CODE] Additionally, the following resources may be of interest to you: [url]http://support.microsoft.com/kb/318545[/url] [url]http://stackoverflow.com/questions/331568/how-do-i-add-multiple-namespaces-to-the-root-element-with-xmldocument[/url] [url]http://stackoverflow.com/questions/310669/why-does-c-xmldocument-loadxmlstring-fail-when-an-xml-header-is-included[/url] | |
Re: If you have an input element of [iCODE]type="file"[/iCODE] whose [iCODE]name="photo"[/iCODE] then you should be using [iCODE]$_FILES['photo']['name'][/iCODE] since [iCODE]$_FILES['photo'][/iCODE] would actually be an array. [CODE]$TARGET_PATH="pics/"; $TARGET_PATH =$TARGET_PATH . $_FILES['photo']['name'] . '.jpg'; while (file_exists($TARGET_PATH)) { $TARGET_PATH =$TARGET_PATH . $_FILES['photo']['name']. uniqid() . '.jpg'; } [/CODE] | |
Re: Make sure there are no leading nor trailing blank characters. Try: [CODE] $realUser = trim($userPrefs[0]); $realPass = trim($userPrefs[1]); [/CODE] | |
Re: try: [CODE]$query="SELECT fieldId FROM table WHERE (fieldName IS NULL) OR (''=trim(fieldName) )"; [/CODE] | |
Re: Ids must be unique, so you will need to change the id of at least one of them or you will likely experience cross-browser incompatibilities. However, it is OK to have multiple elements with the same class name. So, if you change those [iCODE]id='myid'[/iCODE] to [iCODE]class='myid'[/iCODE] then use [ICODE]$('.myid:eq(0)').html()[/iCODE] to … | |
Re: Try using: [CODE] $result=mysql_query( $sql ) or die( mysql_error() ); [/CODE] Instead so you can determine what is causing the error. | |
Re: Try: [code] <?php session_start(); include('dbconnect.php'); $tbl_name="members"; $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql) or die(mysql_error()); $count=mysql_num_rows($result); if($count==1){ //session_register("myusername"); //session_register("mypassword"); $_SESSION['myusername']=$myusername; header("location:memberpage.php"); exit; } else { echo "Wrong Username or Password"; } ?> [/code] | |
Re: assuming the name of your table is Account, try [code] <?php include "connecttodb.php"; $name = mysql_real_escape_string( $_POST['name']); $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['pass']); $query = "INSERT INTO Account( username,password,email) VALUES('$name', '$password', '$email')"; mysql_query($query) or die('There was an error in your registration'); echo'Registration Complete!'; mysql_close(); ?> [/code] | |
Re: On line 11 you are using CustomerId, but it is NOT initialized yet. You need to initialize it first. Also, try changing line 38 to: [iCODE]fadeimages[counter]=["images/<%=CustomerId & "/" & objItem.Name %>", "", ""][/iCODE] | |
Re: Let's say that you are browsing "aboutUs.asp" AND that it contains one of those problematic links. Look at the browser's source code. Does the link in question have [iCODE]href="http://liveserver.com"[/iCODE]?if so, it is not a server configuration problem. Otherwise, also look for [iCODE]<base href="http://liveserver.com">[/iCODE]. if you find it then it is … | |
Re: [QUOTE] i've detected the problem where my sql statement only call once for each assignments[/QUOTE] You are seeing the correct results. Your query is returning all the relevant rows. The problem is in your DB design. [QUOTE]I hope anyone can help me without changing or upgrading my database.. [/QUOTE] Why … | |
Re: [quote]i have found a free php email form[/quote] Where did u find this? I wonder if there's a "manual" for it. Also, can you clarify what you mean by "redirect the title " ![]() | |
Re: try: [iCODE]onclick="aster( document.getElementById('fn'), document.getElementById('ast1') )"[/iCODE] | |
Re: On those string parameters, include the size of the fields as the fourth parameter. EX: assuming that NameStr is defined (in your DB Table) to be of size 100, try: [iCODE]call sp.addParam("@NameStr", 200, 1, [COLOR="Green"][B]100[/B][/COLOR],"Stuff and Things")[/iCODE] | |
Re: [CODE] <?php //your page must start by calling session_start() first: session_start(); //THEN you can begin saving data onto $_SESSION //assuming that in YOUR example, $details is an array - ex: $details=array('firstName'=>'john', 'lastName'=>'doe'); //then you just assign the array to $_SESSION $_SESSION['ecart']=$details; ?> page2.php <?php //If you need to retrieve the … | |
Re: [QUOTE]Is it correct?[/QUOTE] No! a.) To delimit the strings you can use either DOUBLE QUOTES (") OR APOSTROPHES('). You are using the backtick(`) which is NOT correct b.) On the document.write() you need to separate different string using a comma(,) NOT a semicolon( ; ) | |
Re: change your SELECT to: [CODE]<select id="cpule" onchange="updatecost1();"> <option value="Core 2 Duo 2.7">Intel Core 2 Duo 2.7Ghz</option> <option value="Core 2 Qaud 2.6">Intel Core 2 Quad 2.6GHz</option> </select>[/CODE] | |
Re: [QUOTE]and also i am trying to read any length of tilde document.[/QUOTE] I don't know what you mean by that but since you are using [iCODE]fgetcsv()[/iCODE] then each line of the file should have columns separated by '~'. If that is the case, try: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML … | |
Re: Whenever you see "is not a valid MySQL result resource", that is a clear indication that the query failed. You are probably executing something SIMILAR to: [iCODE]$result=mysql_query($query);[/iCODE] If instead you had suffixed your query with "or die( mysql_error() );": [iCODE]$result=mysql_query($query) or die( "Unable to execute:<br> $query<br>". mysql_error() );[/iCODE] it would … | |
Re: create cookie (ex: lastPageLoaded), and whenever you make an ajax request, upon successful retrieval of your content, update the cookie to the url you used last. So, upon page load you just need to see if the cookie exists, If yes, load the page/content from whatever url is in the … | |
Re: AFTER successful execution of line 11, [iCODE]$sql[/iCODE] contains a resource [B]NOT[/B] a string - so line 28 doesn't make sense. You need to extract the data from the resource ($sql) returned by your query. It is not clear to me which field in [iCODE]$sql[/iCODE] you are interested in , but … | |
Re: On line 34 you are attempting to submit the hidden form, BUT at that point, there is no such form defined/seen by the browser yet because you begin the definition until line 45. What you need to do is call that function AFTER you have closed the hidden form OR … | |
Re: assuming your image table had fields image AND also id: [CODE] <?php $con = mysql_connect("localhost","root","" ); mysql_select_db("test",$con); if( isset($_GET['id']) && is_numeric($_GET['id']) && intval($_GET['id'])>0 ) { $sql="select image FROM image where id=" . intval($_GET['id']) . ' LIMIT 1'; $res=mysql_query($sql) or die(mysql_error()); $row=mysql_fetch_assoc($res); header('Content-Type: image/jpeg'); echo $row['image']; exit; } else { $sql="select … | |
Re: [CODE] newData="test"; if($('input[name="' + newData + '"]').is(":checked")) { // my other code } [/CODE] | |
Re: [CODE]var name=[]; name[0]=["tom",12];[/CODE] | |
Re: try changing: [iCODE]if (null == server_msg)[/iCODE] to: [iCODE]if (!/a-z/i.test(server_msg))[/iCODE] | |
Re: On line TEN of your original post you misspelled [iCODE]$image[/iCODE]. You have [iCODE][COLOR="Red"]$iamge[/COLOR] = trim($_POST['image']);[/iCODE] | |
![]() | Re: Are you trying to view the images via an HTML page? If yes, do you know what is the SYNTAX for an HTML Image? ![]() |
Re: It is not clear if your end date is October 11 OR 10th of November. At any rate, use CONVERT: [url]http://msdn.microsoft.com/en-us/library/ms187928.aspx[/url] [url]http://stackoverflow.com/questions/10825/howto-compare-a-date-string-to-datetime-in-sql-server[/url] |
The End.