- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 23
- Posts with Upvotes
- 21
- Upvoting Members
- 20
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
188 Posted Topics
Re: So, do you have more code than what is posted above. Go through the above instructions step by step... Look for @ signs in the string, determine what is left and right of that, use striptags() to remove <>, use str_replace to remove semi; commas, start with some of this … | |
Re: I've made some relevant changes to your code to try to extract unique records. [CODE] <?php //database connect info here include('config.php'); //check for file upload if(isset($_FILES['csv_file']) && is_uploaded_file($_FILES['csv_file']['tmp_name'])){ //upload directory $upload_dir = "csv_dir/"; //create file name $file_path = $upload_dir . $_FILES['csv_file']['name']; //move uploaded file to upload dir if (!move_uploaded_file($_FILES['csv_file']['tmp_name'], $file_path)) … | |
Re: At some point, unclear in your code, you are multiplying qty x rate for each item, so $item_total = qty x rate; although, I do not see this in your code here. anyway I am assuming this is happening in your while loop as you are doing each item. so … ![]() | |
Re: here is a really great script to protect your directory. you can change the $LOGIN_INFORMATION array to read in all of your records from your db or at least authenticate against that instead of an internally stored list in the script. anyway, I have used this for over a year … | |
Re: try to set the CURLOPT_HTTPHEADER something like this: curl_setopt($ch, CURLOPT_HTTPHEADER, Array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15") ); | |
Re: That is not how the 'link' element works in rss. rss is designed to be consumed by an rss reader, and the link element will work properly in that context. If you want to have a clickable 'link' on that page you must put it in the description element of … | |
Re: In your case, this is what I would do, I'm not sure how many duplicates you are getting in a set of say, 10,000 codes, but I would start with a set number, say 50 or 100. so function_being_called($number_to_return) where $number_to_return is your 10000. Add 50 or 100 to that … | |
Re: you need to connect to the database before that function is available: broj1 said: Mind you the connection to mysql has to be established in order to use this function. BTW: It is recommended to switch to mysqli extension. move line 14 in your file to line 3: require "dbc.php"; … | |
Re: What values are you not getting? mysql_real_escape_string($oBookNode->getElementsByTagName('field')->item(0)->nodeValue), to get the value of the second 'field' tag change item to (1) mysql_real_escape_string($oBookNode->getElementsByTagName('field')->item(1)->nodeValue), ran on my machine: output =: sql = INSERT INTO timestamp_table (learningpermit, applicantname, penid, email, phone,firststroke) VALUES ('LOO4', 'Kaifi', 'AJX-AAQ-JFN-5Z', '123@abc.com', '123456', '1352793331') | |
Re: Your question is unclear. What is a computer alarm? do you have any code to show? What is this 'alarm' supposed to do? ![]() | |
Re: steelshark is right, use jquery, I use 5 browsers on a daily basis and have pop-up blockers turned on on all of them. use a modal window or a collapsible div to show /hide a login box. | |
Re: Tizag.com has much better example code than www3. page 1, input form: [CODE]<html> <head> <script type="text/javascript"> function showUser(str){ var ajaxRequest; // The variable that makes Ajax possible! if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers … | |
Re: It appears as though you want to upload multiple files. This code will not do that and there are some major issues within it. First off, never, ever, allow user input to create directories on your site. This is really bad practice: `move_uploaded_file( $_FILES["images"]["tmp_name"][$key], "../speed_west/imagini/$an/$nume/" . $_FILES['images']['name'][$key]);` 2, you should … | |
Re: onsubmit="return validate(this)" add a semicolon; onsubmit="return validate(this);" also, make sure your validate function is returning true if validated, false if not. | |
Re: > header("location: " . $row['id'] / ".php"); I also like the idea of storing the full url in the database, but your current script is trying to divide on line 23. it should be something like: `header("location: " . $row['id']."/index.php");` with the slash being outside of the raw ". $php … | |
![]() | Re: try this: [CODE] <script type="text/javascript"> //Calculator formulae function multiply(){ document.Form.result.value = ((form.inputA.value * form.inputB.value * form.inputC.value * 150) / 1000000) ; } </script> [/CODE] ![]() |
Re: try to assign your get function to a variable... [CODE] function test() { var data data = $.getJSON('singleday.php?dld='+ id+'&chkdag=' + 1, function(json) {sday=json}); OtherFunction(data); } function OtherFunction(data) { for (var i in sday) { // do somthing } } [/CODE] | |
Re: Your logic is flawed... and it appears that the id's on delete would not work properly, for instance if you have 5 records and 3 and 5 are chosen to be deleted, by your logic, 5 would not be deleted as it is now id 4 because you would delete … ![]() | |
Re: [CODE] form action="welcome.php" method="post"> Name: <input type="text" name="fname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> <?php // check to see if the submit button has been pressed, if it has display your variables, if not... don't if isset($_POST['submit']) { ?> Welcome <?php echo $_POST["fname"]; ?>!<br /> You … | |
Re: change you code around a little, move your currenttotal declaration to above the get_buttons call, and add currenttotal=0 to the end of that call, this should be a good place to start: [CODE] // move this above the function getButtons call. var currenttotal = 0; function getButtons() { for(var i … | |
Re: what do you mean adding javascript to the hamburger quantity and price? do you need to total the values of items selected? you still have not explained what you are trying to do...? | |
Re: Ardav is wise i've seen many of his posts. but I must interject djbrown, not on what he was saying... but pagination, on a form, no no no. It can be done, but I don't think it is the route you should take, you would have to store all of … ![]() | |
Re: first off, don't use $_REQUEST, you should have $_POST or $_GET values, update your code to reflect that. also to make sure $data isn't empty you may want to try something like: [CODE] if ($data = mysql_fetch_array($result)) { $id = $data['id']; $link = $data['link']; $gambar = $data['gambar']; } [/CODE] | |
Re: I understand it is accepted practice not to, but please learn to use braces { } in your code. trust me. today I am working on the javascript part of a form that is over 1500 lines long. with several 100 - 150 lines of if / else if statements. … | |
Re: you need to add some sort of onclick function or event to your button. [CODE] <script type="text/javascript"> function redirect(url) { window.location = url; } </script> <h2><center>Product Preview</center></h2> <p> <form method ="post" action ="product_edit.php" > <p> <input name="tambah_produk" type="button" value="Tambah Produk" onclick='redirect("product_edit.php")' /> </p> </form> [/CODE] | |
Re: I found this one (Galleria) works pretty well straight out of the box: [URL="http://galleria.aino.se/"]http://galleria.aino.se/[/URL] | |
![]() | Re: you can try something along the lines of the following: [CODE] select * from (product left join product_attribute on product.product_code = product_attribute.productcode) left join product_attribute_types on product_attribute.attribute_id = product_attriubute_types.attribute_id; [/CODE] |
| |
Re: you can simply try to change your query [CODE] $query="Select sum(Amountspent) from Moneyout"; //or if by cateegory $query="Select sum(Amountspent) from Moneyout where category='x'"; [/CODE] | |
Re: line 76 in the code above is not proper, it is mixed html / php mixing javascript and php is not proper either [CODE] // get rid of the html comment tag on last line: //from <!-- <?php require('footer.php'); ?> // to <?php require('footer.php'); ?> // bad code!. if($username == … | |
Re: your current com1 -> com4 values are strings, not numbers, therefore NaN. set your numbers in separate variables, then you can work with them later. [CODE] function getValue() { var values = new Array(239.99, 129.75, 99.95, 350.89); var name = prompt("Enter your name: ","name here"); var quan1 = prompt("How many … | |
Re: [CODE] <?php // first off, this does not overwrite 'report.txt', but you could do that. // this creates a new file 'myreport.txt' $file = 'report.txt'; $newfile = 'myreport.txt'; $newhandle = fopen($newfile,"w"); $handle = fopen($file, "r"); //echo "parser processing file = " . $file . "\n"; while(!feof($handle)) { $data = fgets($handle); … | |
Re: The admin should be logged in, I am assuming. So in your 'groups' or 'users' you could have a field, something like boolean isAdmin(), or isSuperUser() or, isNormalUser() and set that field when they log in. Then when coding, base your displays (because if they are not admin, they should … | |
Re: try this [CODE] index.html <html> <head> <script type="text/javascript" src="jquery-1.4.3.min.js"></script> <script type="text/javascript" src="ajax.js"></script> </head> <body> <form id="myform" action="test.php"> <input type="text" id="name" /> <input type="submit" value="load" id="submit" /> <div name="result" id="result"></div> </form> </body> </html> Ajax.js $(document).ready(function(){ /* attach a submit handler to the form */ alert('hell called'); $("#myform").submit(function(event) { alert('submit called'); /* … | |
Re: have you tried [CODE] $single_variable = file_get_contents('name_of_file'); [/CODE] | |
Re: the second parameter, 'name' you can reference '_self', to open in same window. you may want to remove some of the picWin.open&&!picWin.closed code as it is irrelevant at this point. [CODE] picWin=window.open("","_self",winProps) picWin.document.write("<HTML>\n<HEAD>\n<TITLE><\/TITLE>\n") picWin.document.write("<\/HEAD>\n") picWin.document.write("<BODY style='background-color:black;margin-top:10px;margin-left:10px'>\n") picWin.document.write("<div id=\"display\">"+data+"<\/div>") picWin.document.write("\n<\/BODY>\n<\/HTML>") } else{ picWin=window.open(hs4Arr[p][1],'self') [/CODE] | |
Re: use javascript: and apparently I google better than you but here is working script from this tuturial: [URL="http://forum.codecall.net/javascript-tutorials/22380-how-create-countdown-timer-javascript.html"]http://forum.codecall.net/javascript-tutorials/22380-how-create-countdown-timer-javascript.html[/URL] [CODE] <script type="text/javascript"> var Timer; var TotalSeconds; function CreateTimer(TimerID, Time) { Timer = document.getElementById(TimerID); TotalSeconds = Time; UpdateTimer() window.setTimeout("Tick()", 1000); } function Tick() { if (TotalSeconds <= 0) { alert("Time's up!") return; … | |
Re: change your php to something like this: [CODE] <?php $content = "<div> <p> Welcome! </p> </div>"; echo $content; ?> [/CODE] tested with your code works as expected. | |
Re: I would add an id to each record div and put a hidden field on the page containing the last id. and increment as each user is added and you can keep track of what record div you are controlling. | |
Re: I cannot reproduce your error. [CODE] $practice_name = 'a really long () name what () is (this) replacing'; echo "<br /> xx ".$practice_name . "<br />"; echo "pr " . preg_replace("/\([^\)]+\)/","",$practice_name) . "<br />"; $practice_name = preg_replace("/\([^\)]+\)/","",$practice_name); echo "zz " .$practice_name . "<br />"; echo ($practice_name); [/CODE] output as expected: … | |
Re: sounds like poor database design. perhaps you need to rethink how you store the names in the first place. are those names name1 name2 name3 in three different rows or is this one big text field that actually looks like name1name2name3 ? | |
Re: yes, first part is seems to be correct: [CODE] SELECT `name` FROM users WHERE `name` LIKE 'A%' [/CODE] But are the prices on the same table? in another column? plese provide full sql table structure and I can write you a query. [CODE] SELECT `name`, 'price' FROM users WHERE `name` … | |
![]() | Re: I have never used but from what I have read: HMACs are substantially less affected by collisions than their underlying hashing algorithms alone. So adding an HMAC to an MD5 hash would make it substantially more difficult to break via a rainbow table. I believe the only known attack type … ![]() |
Re: regmee2 is a stored procedure in your database. "then the regmee2 stored procedure which will make the registration insert in the three previous tables " [URL="http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx"]http://www.mysqltutorial.org/mysql-stored-procedure-tutorial.aspx[/URL] and I happen to agree with this link below. [URL="http://www.tonymarston.net/php-mysql/stored-procedures-are-evil.html"]http://www.tonymarston.net/php-mysql/stored-procedures-are-evil.html[/URL] | |
Re: what do you have done so far? show us some code please. | |
Re: the opening bracket from line 10, is also missing a closing bracket. along with the one from line 54 as pritaeas pointed out. so you need to add in the closing bracket for both of those statements. | |
Re: I can help, give me a few minutes though. | |
Re: Since it appears that you are using the same 'id' to pull for the first set of employeeinformation and then want to also get additional info, just make another call at the end of getinfo2(); chain your requests together. not saying this is ideal, but should get the job done. … | |
Re: first off change line 66 [CODE] while($row = mysql_fetch_array( $result )) { $team=$row["team"]; $options.="<option value=\"$team\">".$team; // change $options above to this: $options.="<option value=\"$team\">".$team."</option>"; } // change line 77 from this: <div id="player"><select name="select"><option>Select Player</option></select></div> to this: <div id="player"></div> //with nothing inside of it [/CODE] as for findplayer.php you also need … | |
Re: this line of code is totally incorrect and fails every time, but there is no else statement alerting you to this fact. it must be changed. [CODE] if ($query_run = mysql_query($sql)) { [/CODE] I've added in some db connection code but you should be able to follow along, there are … |
The End.