188 Posted Topics
Re: how about a sample page. this is why you should run your logic outside of the scope of your page, but anyway, need a sample page of your code to see what you are talking about. is there really an error, does the page stop loading because of the error? … | |
Re: when you call your 'write' function, call trim() around the text you are sending. make sure your not sending something like \t (which is a tab character) and would be interpreted by your browser as such. can't help much if there is no code to look at. | |
Re: first off, if you don't have 10 menu items set, the script will break. for example I only set 5 elements (faking your query and setting items in a for statement), I tried to save one of the five elements I was toying with and immediately go doecument.getElementById("linkname6") is null. … | |
Re: Drupal, does indeed do the things you are looking for. I would look at 6 or 7 (i believe 7 is the latest version.) We run 4 drupal sites and it is exactly what you are looking for you just need to get over the learning curve of what it … | |
Re: If you really really just want to do it from the 'validate' form to index. you can change the action in your form tag. I believe that your hidden input needs to be the very first thing under your form tag as well [CODE] <form action="index.php?username=" method="get"> <input type="hidden" name="username" … | |
Re: not sure why you are calling window.location there. what is it that you want to do. are you trying to fire php when hi == true? | |
Re: it's because it is a bigint type. some things to try. remove your first % [CODE] ...WHERE acctstarttime LIKE '".$today."%'"); // that should hopefully do the trick. // since acctstarttime is a big int you can also 'CONVERT' when pulling the data. // try: $totaltimetodayresult = pg_query($link, "SELECT SUM(acctsessiontime) AS … | |
Re: you need a comma , in between '{$applicantId}' and '{$additionalConcern}' [CODE] other code...'{$applicantId}', '{$additionalConcern}'...other code [/CODE] | |
Re: your link doesn't work, and what is your question. what do you want to total on this page? there are no "total = harga * unit;" 'harga' or 'unit' variables on this page at all. there are no form tags and no submit button on your form. what is your … | |
Re: yes, you are using the correct syntax. when in doubt test it, use echo to see your values. if they are the expected values that you should be seeing then you are fine, if not figure out what is set and what is not. | |
Re: I downloaded and altered so I could run your code. it appears to be fine. are you getting an error? pull up your page source after you execute the code and see use firebug to inspect your elements and you can see which one is 'selected'. I defaulted my $myDate … | |
Re: you can wrap you search code (right before $tag and after mysql_close() in an if statement like: [CODE] // this will only run the php code if the submit button was pressed on your page. if (isset($_POST['submit'])) { $tag... // rest of your code. mysql_close($con); } [/CODE] | |
Re: I suggest you read up on mysql a little start here: [URL="http://www.php.net/manual/en/function.mysql-result.php"]http://www.php.net/manual/en/function.mysql-result.php[/URL] the return item from a mysql_query() call is a resource that yet needs further evaluation. To get data from the db you have to process the resource There is more than one way to do it but here … | |
Re: That's the first thing I noticed as well... [CODE] <input id="input3" type="text" name=""mbid/></td> //needs to be fixed //name="mbid"; // I ran the code it all seems to function just fine as long as the mbid is fixed. [/CODE] | |
Re: It is a php error coming from your display_map.php page. what code is on that page? | |
Re: yes, need more info: just a thought. you can have code call your dynamic generated page read its contents and then send that to the api. again I don't know what your full issue is. [CODE] $to_send = file_get_contents('dynamic.html'); // then use curl to call the api $URL = 'the_url_for_api'; … | |
Re: [CODE] // in your validation JSON call you need to remove this line: "category" : document.forms["myForm"]["category"].value, // there is no category input from your form. often js breaks if it cant find the item it is looking for, as is the case here. [/CODE] | |
Re: on your echo statement lose the {} and put in php tags [CODE] <?php echo $row['description']; ?> // move your echo to the else of your if(!$valid) statement. //if it is not valid which is set in your above code nothing will be in $row. //so if not valid 'error', … | |
Re: [CODE] if(strlen($email) < 1){ echo "0__notice__Email is empty."; } // the expected result is "0__notice__Email is empty." // change your echo to this: if(strlen($email) < 1){ echo "Email is empty."; } // the expected result is "Email is empty." [/CODE] [URL="http://php.net/manual/en/function.echo.php"]http://php.net/manual/en/function.echo.php[/URL] | |
Re: I'm assuming your issue is on message2: [CODE] //$message2 = "Name : " + $name + "email : " + $email + "message : " + $message; //change that to this (+ is javascript) (. is php): $message2 = "Name: " . $name . " email: " . $email . … | |
Re: either try file_get_contents or properly read your file. both [CODE] // assuming welcome.txt is in the same directory. $text = file_get_contents("welcome.txt"); echo $text; // also you are only opening your file and not doing anything with it. $myFile = "welcome.txt"; // set your file name & path $fh = fopen($myFile, … | |
Re: I didn't follow the link posted by psych.. 2 quick ways. if you are one directory above say localhost/dir1/dir2 you can reference dir1 with ../ and localhost with ../../ so: [CODE] include ('../core.inc.php'); // another way is to use your environment variable for your server. //just do an echo $_SERVER['DOCUMENT_ROOT']; … | |
Re: this doesn't appear to have anything to do with sessions. you need to initialize $blnk array outside your loop. otherwise you are constantly overwriting what is held in $blnk every time you pass over it in the while loop. [CODE] $blnk=array(); while loop { $val=mysql_num_rows($result14); array_push($blnk,$val); } $blnkarraysum=array_sum($blnk); [/CODE] | |
![]() | Re: [CODE] //textarea will always be set when looking at it this way. so if(isset($_POST['textarea'] && $_POST['textarea'] != '') { // You have textarea data do something with it... $text = $_POST['textarea'] } else { echo "textarea has no value..."; } [/CODE] |
Re: can you post your whole form? that is not enough code to debug. | |
Re: So you need to process them a different way. Or decide if you want to accept the file or not. The whole point of checking the file type is to make sure you are getting a specific type of file. So if the image type comes across as blank, save … | |
Re: I've never seen a variable set this way: [CODE] $f1=mysql_result($result,$i,"StudentID"); // since you want all of your results printed anyway use mysql_fetch_array() like this: <?php while ($row = mysql_fetch_array($result)) { $f1 = $row['StudentID']; $f2 = $row['FullName']; $f3 = $row['EnrolledTerm']; $f4 = $row['EnrolledYear']; ?> <tr> <td><?php echo $f1; ?></font></td> <td><?php echo … | |
Re: "I just don't understand when to say, "I need class at this point in the code."" Before you start coding is the best time to decide on how and when to use a class. That said, classes give you better flexibility and easier ways to handle your data. It also … | |
Re: first off, this is a classic case for Class / object code. drive around on phpclasses.net site for a while for a feel of classes. Clearly, since you seem to be just starting out on this project, what are you trying to do? duplicate the conditionals that happen in the … | |
Re: if reference_num is an int type in your database it will not update because of the tick marks around $refnum. [CODE] $sql = "UPDATE `order` SET `receiver_tel` = '".$recetel."' WHERE `reference_num` = ".$refnum."; // lose the ticks ' ' <-- [/CODE] | |
![]() | Re: I recommend using classes and objects and build up what a 'user' and friend are, and pass the data back and forth between classes. That is some intense querying from the page you are going to kill your site. if you send me your dashboard, friends and dissusers table structures … |
Re: requesting full code post. It appears as though that there is nothing in your $mysql_result variable. | |
Re: you want an array of banners dependent on the menu name in table menu. Do you want to rotate them on your page or only display one, once per menu call? | |
Re: [CODE] // This is not 'working code' only an example of what you need to do. if($matchcount >= 1) { // yes $doneString = ''; // you need to do a foreach or some look on possibly multiple images. // so either do a for, or foreach //for($i=0; $i<$matchcount; $i++) … | |
Re: then use your original query, minus the , [CODE] $sql="UPDATE stock SET HDDType='$hddtype', HDDConnection='$hddconnection', HDDSize='$hddsize', Make='$make', Model='$model', Comments='$comments', Date='$date' WHERE StockID= $id"; // that's about as 'clean' as your going to get. [/CODE] | |
Re: [CODE] // wrong. <input name= "name" type="text"> get rid of the spaces in your form. <input name="name" type="text"> [/CODE] | |
Re: As far as printing the page that is more of a javascript function. without seeing your code I cannot recommend proper placement... but you can simply try to add: [CODE] onClick="window.print() to your submit button. so: <form method="post" action="somepage.php"> <input type="submit" name="submit" onClick="window.print()"> // will print the current page you … | |
Re: you should really use an autoincrement field on your table. but this should work for you desired solution: [CODE] //change your while statement and update query: $i=1; // old: // while($i<=$num_rows) //new: purpose to only update one row on table, use the 'nummer' retrieved in previous query while ($row = … | |
Re: Your page should 'refresh' on the post to php_self. Post your full page, maybe I can help you. | |
Re: Dan, what exactly are you trying to do?... you could try [CODE] $url = "http://someurl.com/some****&!!!!!other_text"; $url = str_replace("*", "", $url); $url = str_replace("&", "", $url); $url = str_replace("!", "", $url); // or str_replace("whatever you want removed","replacement value",string_to_search); echo "url = " . $url . "<br>"; [/CODE] | |
Re: personally, I would never code a form that way. They are doing a lot of php calls when information is set on the form, there is no reason to even use php on that form as all of the validation could be done through javascript or a single php call. … | |
Re: The statement itself looks fine. So I would need to see the surrounding code in order to tell you why it is not working. Also, what is not working, does row['id'] ever == dec[id]? is it getting evaluated at all? put an else in with an echo to see if … | |
Re: how are you calling your function. more code please, cannot debug your single line above. ![]() | |
Re: debug! instead of jumping in and doing a bunch of processing... [CODE] comment this out for now, run it on a test page... /* if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000000)) */ /* and start uploading files start with a pdf … | |
Re: cant go into too much detail on your code, but... debug. [CODE] if (isset($_GET['prev'])) echo $_GET['prev']; if ($_GET['prev'] == "1") { echo "true"; } else { [/CODE] ![]() | |
Re: In your config instead of declaring global you could try: [CODE] define(DB_HOST,'localhost'); define(DB_USER,'root'); define(DB_PASS,'needsome1'); define(DB_BASE,'classdb'); [/CODE] and then in your classes call [CODE] $dob = new DBhandling(DB_HOST,DB_USER,DB_BASE,DB_PASS); [/CODE] | |
Re: do you have access to the soap code itself? you need to change your api code if possible. maybe make three calls. instead of [CODE] catalog_product.list catalog_a.list catalog_b.list catalog_c.list //where each of the lists returns only a third of your data. [/CODE] if you don't have access to the api, … | |
Re: to suppress warning messages you can try to use @. [CODE] // line 46 @rmdir($dir2.$file) or DIE("couldn't delete $dir$file<br />"); [/CODE] | |
Re: [CODE] // do more debugging of your code. // actually that isset 'Submit' is failing. // this fails everytime. if (isset($_POST['Submit'])) { echo "SUBMIT IS SET!!!<BR />"; } // your form submit buttons are all names submit, lowercase. if (isset($_POST['submit'])) { // this evaluates true everytime. echo "little submit IS … |
The End.