627 Posted Topics
Re: You need to close your SELECT. Then to read the selected value upon post: [CODE] if( isset($_POST) && !empty($_POST)) { $userSelected = $_POST['studentrow']; } [/CODE] | |
Re: see code below. Notice that there is a leading space: [CODE=html] <input type="text" onchange="this.className+=' YourNewClassNameHere'" value="" /> [/CODE] | |
Re: IF title will always be the first child of catalog, then simply use: [CODE]xmlDoc.documentElement.childNodes[0].firstChild.nodeValue[/CODE] if it is likely to change position, then you will need to "search" for it: [CODE=javascript] var i=-1, limit=xmlDoc.documentElement.childNodes.length; while(++i<limit) { if("title"==xmlDoc.documentElement.childNodes[i].nodeName) { alert(xmlDoc.documentElement.childNodes[i].firstChild.nodeValue) } } [/CODE] | |
Re: 'nickels' is a string, NOT a variable. Your variable is [iCODE]$_POST['nickels'][/iCODE] So do: intval(VARIABLE) * MULTIPLIER: [CODE] <td align="right"><?php echo $totalCents=intval($_POST['pennies']) + (intval($_POST['nickels'])*5) + (intval($_POST['dimes'])*10) + (intval($_POST['quarters'])*25); ?></td> [/CODE] | |
Re: instead of: [CODE=php] echo "<input type='radio' id='charID' name='charID' value='" . $row['characteristicID'] . "'/> " . $row['characteristic'] . "<br />" ; [/CODE] try: [CODE=php] echo "<input onclick='window.clickedCharID=this.value' type='radio' id='charID' name='charID' value='" . $row['characteristicID'] . "'/> " . $row['characteristic'] . "<br />" ; [/CODE] then on the function that you need to … | |
Re: How To: ======= [url]http://articles.sitepoint.com/article/sql-injection-attacks-safe[/url] [url]http://www.securiteam.com/securityreviews/5DP0N1P76E.html[/url] Prevention ========== Classic ASP: [url]http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6999&lngWId=4[/url] .NET: [url]http://www.aspnet101.com/2007/03/parameterized-queries-in-asp-net/[/url] | |
Re: Based on the fact that you are using [iCODE]document.getElementById("IncludeCharges_no").value[/iCODE], my guess is that you have: [CODE=html] <input type="radio" id="IncludeCharges_no".../> <input type="radio" id="IncludeCharges_yes".../> [/CODE] However, the browser does NOT provide/send the [B]id[/B] to the server. Instead, it uses the [B]name[/B]. So all you need to do is give both buttons the … | |
Re: try adding a "fake" field with a fixed valud for each of the selects and use that as your primary sort field: [CODE=mysql] ( SELECT 1 as `temp`, `name`, `date` FROM `events` WHERE `date` >= curdate() ) UNION ALL ( SELECT 2 as `temp`, `name`, `date` FROM `events` WHERE `date` … | |
Re: try: [CODE=javascript] $("#ka").change(function(){ var nadkat=$("#ka").val(); $.post("uzmi_podkategorije.php", { nk: nadkat }, function(result){ $("#pka1").show(); var niz=podaci.split("+"); var i=-1,limit=niz.length; while(++i<limit){ $('<option value="'+niz[i]+'">' + niz[i] + '</option>').appendTo('#pka'); } }); }); [/CODE] | |
Re: What you are actually (incorrectly) doing now is inserting the "BINARY" image content into the div. What you need to do is to insert and <IMG> tag into the div and set the SRC attribute to the path of the image. The browser will take care of the rendering. | |
Re: you need to prefix the double quote with a slash if your echo command uses the double quotes: [CODE=php]echo "Welcome Guest!<br><a href='#' onclick=\"javascript:ajaxpage('login.php', 'ajax');\">"[/CODE] Here's another implementation: [CODE=php]echo 'Welcome Guest!<br><a href="#" onclick="javascript:ajaxpage('login.php', 'ajax');">'[/CODE] and another (look up the sprintf() function on the php.net site if it is not obvious to … | |
Re: first, start with "blank" html body - just the basic structure with nothing in the body. Then add your table markup with EMPTY cells (<td>) and run it through the validator. If you did anything wrong, it should give you feedback as to what you did wrong. Once you have … | |
Re: [CODE=php] function toAssoc($arr){ $data=array(); if(is_array($arr)) { for($i=0,$limit=count($arr); $i < $limit; ++$i) { $data[$i]=isset($data[1+$i]) ? $data[1+$i]: ''; ++$i; } } return $data; } [/CODE] | |
![]() | Re: instead of simply executing [iCODE]mysql_query("...");[/iCODE] use [iCODE]mysql_query("...") or die( mysql_error() );[/iCODE]. This way you will get details about the error. As for your ACTUAL problem, I am seeing field named "by", which is a keyword. To avoid this "beginner's mistake" (no offense), ALWAYS enclose the db name, table and field … ![]() |
Re: On index.php, when you call ajaxpage('page1.php', 'rightcolumn'); then your rightcolumn will have html - the html from page1.php: [CODE] <div id="rightcolumn"> <a href="javascript:ajaxpage('page4.php', 'rightcolumn');">page4</a> </div> [/CODE] When you click on page4, it should load it into the rightdiv of index.php because that link now exists within index.php. On another note, … | |
Re: instead of [iCODE]CURLOPT_USERAGENT => "spider", // who am i[/iCODE] try proving a value that identifies a popular browser. For example, try this instead: [iCODE]CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0', // who am i[/iCODE] | |
Re: line 54 should be [iCODE]id="rightdiv"[/iCODE] NOT [iCODE]class="rightdiv"[/iCODE]. Also, get rid of that "dangling" [iCODE]left;[/iCODE] | |
Re: it should like in your db field `profileid` you have PHP code instead of just a number. Make sure you have a unique number in it. | |
Re: all you need to do is use preg_replace() to remove the unwanted set of characters. [CODE] //your initial string $str = 'img*1L%^_ove>ly.jpg'; /* //this removes anything that is NOT //a,b,c,....z //A,B,C,...Z //0,1,2,...9 //In other words, it KEEPS only a-z, A-Z, and 0-9. //If you want other character(s), simply add //it(them) … | |
Re: When a function executes Synchronously, the following statement is NOT executed until the previous one is done executing - ex: [CODE=javascript] /* here, the statements are executed one after the other. In other words, if the web server is experiencing delays and it takes 5 seconds to respond then you … | |
Re: [CODE]i have contacted this with my hosting service they said its the problem with php mail () function [/CODE] According to them, what exactly is wrong with it? mail() has no problems sending emails TO external/remote domains. If you are trying to authenticate to a remote server (like gmail) and … | |
Re: Yes, it is a keyword: [url]http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html[/url] However, if you really want to use that, enclose with backticks: create table emp2 (`Leave` decimal(12,2) default NULL) and when you do any operation on that field (SELECT/UPDATE/INSERT,etc) don't forget to ALSO put the backticks around it as well. | |
Re: [QUOTE]@ip=$server1ip[/QUOTE] ip is a node, NOT an attribute. for testing purposes try: [iCODE]select="document('servers.xml')/servers/ip[@id='172.22.17.80']"[/iCODE] | |
Re: assuming you are making an ajax call, when you send the request, be sure to set the ajax dataType option to "xml". Then use the find() method on the result. This is clearly explained here: [url]http://www.xml.com/pub/a/2007/10/10/jquery-and-xml.html[/url] | |
Re: [CODE=php]//save everything up to "SCRIPT;" in the variable $js $js<<<SCRIPT <script language="javascript" type="text/javascript"> jQuery(document).ready(function() { $('#countdown_dashboard').countDown({ targetDate: { 'day': 17, 'month': 9, 'year': 2010, 'hour': 1, 'min': 0, 'sec': 0 } }); }); </script> SCRIPT; /*note the line where you see "SCRIPT;" MUST end with a semicolon IMMEDIATELY followed by … | |
Re: change: [iCODE]<input type="submit" name="submit" id="submit" value="Submit">[/iCODE] to: [iCODE]<input type="submit" name="Submit" id="Submit" value="Submit">[/iCODE] uppercase "S" for the name and id. Do not use lower case since it is reserved for javascript. As for your problem (with the current submit button), it is on line 138. Change the input field as suggested … | |
Re: [QUOTE]Can i change this url to alertpay payment gateway url? If i change this url will it working?[/QUOTE] Not likely. If you changed the URL to point to MY site, then on my site there would need to be a script in place that "receives/processes" the information sent to my … | |
Re: In javascript you cannot customize the buttons. alert() displays: OK confirm() and prompt() displays: OK , Cancel Your option would be to use a javascript plugin: [url]http://trentrichardson.com/Impromptu/index.php[/url] | |
Re: That typically happens when you have the WRONG path to the image and/or you have misspelled the image name. Also, be aware that some webservers are case-sensitive. So if your image name is "logo.gif", then if you code "logo.GIF", it will not work. So, your first task is to figure … | |
Re: Save this as hielo.php and try it: [CODE=php] <?php if( isset($_POST['nic']) && !empty($_POST['nic']) ) { mysql_connect("localhost","username","password") or die( mysql_error() ); mysql_select_db("dbName") or die( mysql_error() ); $sql = sprintf("SELECT `customer_id`, `nic`, `full_name`, `name_with_initials`, `address`, `contact_number`, `gender` FROM `customer` WHERE `nic`='%s'", mysql_real_escape_string($_POST['nic']) ); $result=mysql_query($sql) or die( mysql_error() ); if( 0==mysql_num_rows($result) ) { … | |
Re: save this as hielo.php and try it: [CODE=php] <?php define('TABLE_NAME','accounts'); $dbConnection= mysql_connect("localhost","username","password") or die( mysql_error() ); $fields=array( 'tran_ID'=>array('label'=>'Transction ID','format'=>"%d") ,'account_type'=>array('label'=>'Account Type','format'=>"'%s'") ,'account_number'=>array('label'=>'Account Number','format'=>"'%s'") ,'transaction_type'=>array('label'=>'Transaction Type','format'=>"'%s'") ,'amount'=>array('label'=>'Amount','format'=>"'%s'") ,'Date'=>array('label'=>'Date','format'=>"'%s'") ); mysql_select_db("dbName") or die( mysql_error() ); if( isset($_POST['update']) && !empty($_POST['update']) ) { updateRecord($_POST['tran_ID'], $dbConnection); } elseif( isset($_POST['edit']) && !empty($_POST['edit']) ) { showSelectedRecord($_POST['tran_ID'], $dbConnection); … | |
Re: to reload the whole page: [CODE=html] <a href="#" onclick="top.location.reload(true)">Reload Page</a> [/CODE] | |
Re: Make sure your tables are using InnoDB Storage engine and then try: [CODE=sql]ALTER TABLE `ORDERS` ADD FOREIGN KEY(`CUSTOMER_NUM`) REFERENCES `CUSTOMER`(`CUSTOMER_NUM`);[/CODE] | |
Re: instead of [CODE]SELECT * ...[/CODE] use: [CODE]SELECT blogpost, DATE_FORMAT(dateandtime,'%M %e %Y at %h:%i%p') as dateandtime ...[/CODE] | |
Re: [iCODE] ... where id = '$_SESSION[user_id]'")[/iCODE] are you updating $_SESSION[user_id] to that of the one you selected/click on in profile.php? | |
Re: When using ajax, from your local machine, you need a local web server installed. You cannot open your test file via "file://...". You must open your file using "http://..." since ajax makes http requests. If you are using the "file" protocol instead of the "http" protocol, it will not work. … | |
Re: a. Post the code you have thus far (the file doing the "importing") b.specify how you are accessing/loading your test page from the browser (ex: using [url]http://localhost[/url], file:///path/to/file, [url]http://yoursite.com[/url]) c. post a sample of the xml file you are trying to load. | |
Re: I tried exactly what you posted and it works fine for me. Here is something else I tried: [url]http://articles.sitepoint.com/article/xml-data-source-object/[/url] (specifically refer to page 2) and it also works for me. I suspect your problems are all tied to security permissions. If that is the case, I suspect that even that … | |
Re: try: [CODE=javascript] function calc(){ room_charges = isNaN(parseInt(document.ipd_bill.room_charges.value)) ? 0 : parseInt(document.ipd_bill.room_charges.value); lab_charges = isNaN(parseInt(document.ipd_bill.lab_charges.value)) ? 0 : parseInt(document.ipd_bill.lab_charges.value); consultancy_fees = isNaN(parseInt(document.ipd_bill.consultancy_fees.value)) ? 0 : parseInt(document.ipd_bill.consultancy_fees.value); blood_charges = isNaN(parseInt(document.ipd_bill.blood_charges.value)) ? 0 : parseInt(document.ipd_bill.blood_charges.value); organ_charges = isNaN(parseInt(document.ipd_bill.organ_charges.value)) ? 0 : parseInt(document.ipd_bill.organ_charges.value); discount = isNaN(parseInt(document.ipd_bill.discount.value)) ? 0 : parseInt(document.ipd_bill.discount.value); document.ipd_bill.total_payment.value = eval(room_charges) + … | |
Re: try: [CODE=asp] <% 'Note: No Trim() nor UCase() after the "to" for i=1 to Request.QueryString("print").Count 'NOTE: the (i) is adjacent to querystring If Trim(UCase( Request.QueryString("print")(i) )) = Trim(UCase(rsAuto.Fields.Item("vin").Value)) Then %> <tr> <td width="10%" height="45" align="center" valign="middle"><%=(rsAuto.Fields.Item("year").Value)%></td> <td width="15%" align="center" valign="middle"><%=(rsAuto.Fields.Item("make").Value)%></td> <td width="30%" align="center" valign="middle"><%=(rsAuto.Fields.Item("vin").Value)%></td> <td width="15%" align="center" valign="middle"><%=(rsAuto.Fields.Item("title").Value)%></td> <td width="25%" … | |
Re: Are you always getting "ERROR" when you submit the form? If yes, then try changing [iCODE]$header="from: $name <$mail_from>";[/iCODE] to: [CODE=php] $header="From: " . $mail_from . PHP_EOL; $header="To: " . $to.PHP_EOL; [/CODE] If you are NOT seeing "ERROR", then check your spam folder. | |
Re: what is init.php? How and where are you connecting to the db server? | |
Re: you have to use the getElementById() AFTER the page has finished loading. Try: [CODE=javascript] function car(seats,engine,theradio) { this.seats=seats; this.engine=engine; this.theradio=theradio; } var work_car=new car ("cloth","V8","Tape Deck"); var b1=null; window.onload=function(){ b1 = document.getElementById("work_car"); b1.onclick=function(){ alert("I want a car with " + work_car.seats + " yeah"); //if you put <div id="message"></div> in … | |
Re: assuming you had: [CODE=html] <input type="text" name="person" value="John"/> <input name="sport[]" type="checkbox" value="baseball"> <input name="sport[]" type="checkbox" value="basquetball"> <input name="sport[]" type="checkbox" value="football"> <input name="sport[]" type="checkbox" value="hocket"> [/CODE] then: [CODE=php] foreach($_POST['sport'] as $value) { $sql = sprintf("INSERT INTO `Atletes`(`personId`,`sportName`) VALUES('%s','%s')" ,mysql_real_escape_string($_POST['person']) ,mysql_real_escape_string($value) ); } [/CODE] | |
Re: It sounds like you are INITIALLY arriving at the page via [iCODE]editsites.php?siteid=95[/iCODE], in which case line 11 works as expected. BUT your FORM does not "save" that siteid, so when you submit/POST the form, it is going to editsites.php, NOT to editsites.php?siteid=95. So add the site id to your FORM's … | |
Re: CREATE TABLE student( name CHAR(100), father CHAR(100), mother CHAR(100), address VARCHAR(255), PRIMARY KEY (name,father,mother) ) | |
Re: Do you know for a fact that your server is returning a VALID xml document? | |
Re: Fix line 5. The name of your select is "additions" NOT "extrastuff". Also, on line 14, the third parameter to mysql_connect() should be $pass. Lastly, the syntax for INSERT is: [code=sql]INSERT INTO TableName(FieldName1, FieldName2) VALUES('valueForField1','valueForField2')[/code] | |
Re: First make a DELETE query. It it succeeds, then make an UPDATE query - ex: [CODE] $id=3; mysql_connect("localhost","username","password") or die(mysql_error()); mysql_select_db("dbname") or die(mysql_error()); mysql_query("DELETE FROM tableName WHERE `id`=$id") or die(mysql_error()); mysql_query("UPDATE tableName SET `userno`=`userno`-1 WHERE `id` > $id") or die(mysql_error()); [/CODE] | |
Re: name them with "array notation" syntax: [CODE=html] <input name="name[1]" /> <input name="father[1]" /> <input name="name[2]" /> <input name="father[2]" /> <input name="name[50]" /> <input name="father[50]" /> [/CODE] Then, when you post the data, that index will be used to find the related records: [CODE=php] <?php //on every iteration, $numKey will vary … |
The End.