- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Programmer, BOOMj.com
- Interests
- anything LAMP
- PC Specs
- 64-bit Ubuntu 8.04 (Hardy) GNOME 2.22.3 AMD64 X2 Dual Core Processor 5600+ 7.8GiB RAM GeForce 9400 GT…
59 Posted Topics
Re: when in doubt check out the mysql manual... [URL="http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html"]http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html[/URL] ![]() | |
Re: ensure that you don't have any whitespace after the closing php '?>' tag in your include files and that you are not echoing or printing anything prior to sending headers with the header() function. Any content printed prior to sending a header will cause errors like that, and can be … | |
Re: The only way I know of is to use a workaround...This website has the best solution I've come across...Just follow the steps, and be sure to download the scripts he has written at the bottom of the page. [url]http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom[/url] | |
Re: try this out [CODE=php] <?php //specify path of directory $dir = 'text/'; //open directory if ($handle = opendir($dir)) { //read each file while ($file = readdir($handle)) { //only get files of a particular type if(mime_content_type($dir . $file) == 'text/plain') { //eliminate additional directories if ($file != "." && $file != … | |
Re: [QUOTE=markhammill;532921] Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/mark1471/public_html/shop.php:6) in /home/mark1471/public_html/library/config.php on line 3 [/QUOTE] If you try to call session_start() after any content has been output to the page, you will get this error. Make sure that none of your included … | |
Re: [QUOTE=Chaosbreaker;653231] I'm guessing its something to do with the code piece:- [CODE]onchange=\"location = this.options[this.selectedIndex].value;\"[/CODE] Anyone knows what changes I need to be done to make it work the way I want? Thanks in advance.[/QUOTE] Yes, this is where the issue lies. The onchange attribute of each of your select boxes … | |
Re: I believe you can only use a write mode such as 'a+' with fopen on a remote file if using ftp:// as the protocol...even so, you would have to have appropriate ftp permissions to write/append. More about that here: [URL="http://us.php.net/manual/en/features.remote-files.php"]http://us.php.net/manual/en/features.remote-files.php [/URL] | |
Re: JavaScript would be the way to go. You'll probably get better help in the JavaScript/AJAX/DHTML forum on this one. | |
Re: you want pagination. check out a couple of scripts in the snippets section... [URL="http://www.daniweb.com/code/snippet341.html"]http://www.daniweb.com/code/snippet341.html[/URL] [URL="http://www.daniweb.com/code/snippet612.html"]http://www.daniweb.com/code/snippet612.html[/URL] pagination is pretty popular, google 'php pagination' and you'll get several (paginated) pages of results to sift through. | |
Re: try specifying method='POST" in all of of your <form> tags...like so: [CODE] <form name="pointofcontact" action = "saveproject.php" method="POST"> [/CODE] it seems like some of your forms are defaulting to GET, but you are reading all variables with $_POST...specifying the method type will prevent this variable confusion. Also, a heads up...you … | |
Re: [QUOTE=MrMonirul;646060]Previously I solved this problem using [B]arrya [/B]method by following code but i can't solve using [B]for[/B] . $abc[1]="ABC1"; $abc[2]="3435345"; $abc[3]="A012"; for($i=1; $i<=3; $i++) { $abc = $abc[ $i]; echo $abc." "; } Thanks all the best.[/QUOTE] you were close here. Just a small change: [code=php] for($i=1; $i<=3; $i++) { … | |
Re: you could use a for loop rather than a while statement. For example: [code=php] $howMany=$_POST["hmany"]; for($i=0;$i<=$howMany;$i++) { $rand=mt_rand(1,$_POST["dice"]); echo "You rolled a $rand"; } [/code] if your numbers are all coming up '1', that probably means the value of $_POST["dice"] is empty or '1'. Check that you are passing it … | |
Re: the modulus operator (%) takes the left side, divides it by the right side, and returns the remainder. So, 5%3 would result in two, since 5/3 yields a remainder 2. If you are getting a division by zero error, that means the value on the right side of the equation … | |
Re: I took the code you pasted above and tested it locally with IE7 and it started the countdown at 30... check to make sure you don't have an initial value set in your form 'document.frm.clock' element... or aren't setting it anywhere else in the document as an aside, I would … | |
Re: I'm not sure I understand everything you're trying to do, but if you want the sum of all the rows' allotment columns, you can use the sum() mysql function. for example: [CODE]SELECT sum( allotment ) FROM `categories`[/CODE] | |
Re: [QUOTE=pritaeas;621255]when loading a page, the $_POST fields may be empty, so the code is not executed.[/QUOTE] like the user said, if the POST variables aren't set, the code won't execute. Even if they are, the code won't execute the second time around if the user was validated on the first … | |
Re: you'll get that warning when trying to call session_start after outputting content to the browser with something like echo or print, or if you have embedded PHP that calls a session_start following HTML content. The reason your DB update still works is because the error is just a warning. Warnings … | |
Re: try encoding your str1 with [I]encodeURIComponent[/I] [URL="http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp"]more about this at w3schools[/URL] | |
Re: [QUOTE=assgar;530795] 2) To get the above results should I copy the existing data and insert two new entries (10 to 11 and 11 to 12) and update the existing entry to reflect 9 to 10? [/QUOTE] that seems most logical...it would depend, however...Is there code elsewhere that has to make … | |
Re: [QUOTE=lordx78;559964][code=mysql] $result = mysql_query("SELECT * FROM cycles WHERE Upper(brand) LIKE '%$brandC%' AND type LIKE '%$typeC%'"); [/code] Above code is not working, pls help.[/QUOTE] the syntax of your query is ok. Something else is going on here. Can you post more code or any MySQL errors you are getting? | |
Re: to encode it in php... [CODE=php] <?php //encode input going in... $encode = urlencode("in'out\""); //decode output coming out... $decode = urldecode($encode); ?> [/CODE] If you have to hard code your HTML input tag with that value, then you'll need to write like this: [CODE=html]<input value="'in' out"">[/CODE] if a user is … | |
Re: [CODE=php]echo "<td align=center style=\"width: 30px\"><strong><a href=\"$link1\" style=\"color: red\">CID</a></strong></td>";[/CODE] | |
Re: [CODE=php]<?php //old time $old_time = '2008-03-05 18:05:44'; //convert to UNIX timestamp $timestamp = strtotime($old_time); //fetch new format $new_time = date('m-d-Y H:i:s' , $timestamp); //output new time echo $new_time; ?>[/CODE] | |
Re: since most people will probably never pick more than a few, it would save space to only have one column. try this: [CODE=php]<?php //multi-list boxes post an array of results //get this array into a single comma-seperated-value string foreach($_POST['select'] as $key=>$val) { //add item as comma-seperated-value $csv .= $val .','; … | |
Re: mmmmmmm cookies... [CODE=php]<?php //make a batch of cookies //pass name of array as $batchName, and the values you wish to store as an array $valueArray function batch_of_cookies($batchName, $valueArray) { foreach($valueArray as $key=>$val) { //put cookies in the jar setcookie($batchName . "[$key]" , $val); } } //name cookie $cookieName = 'myCookie'; … | |
Re: try changing your code like this: [CODE=php]while($row = mysql_fetch_array($resultmoto)) { $data = $row[1]; $leg = $row[0]; $chart [ 'chart_data' ][ 0 ][ $bar ] = $data; $chart [ 'chart_data' ][ $row ][ $bar ] = $leg; $bar++; }[/CODE] changes: made 'data' and 'leg' flat variables instead of arrays, changed comma … | |
Re: [QUOTE=billah_norm;62325]Is there anything or keawords in PHP from which I can break or continue from a LOOP in PHP?? in C for(i=0;i<=100;i++){ statement1....; statement2....; if(condition1) break; else continue; statement3....; statement4....; statement5....; } I need something like this in PHP.. Can anybody Help me?[/QUOTE] syntax is the same as c. for … | |
Re: echo your option tags inside of a select tag like this: [CODE] <select name="test" id="test"> <option value="value 1">option 1</option> <option value="value 2">option 2</option> <option value="value 3">option 3</option> </select> [/CODE] | |
Re: [QUOTE=Auzzie;543994]also use comma's between the params in the date function $date_curr = date('l, dS, F, Y');[/QUOTE] you only have to use commas if you want commas to appear in the output [QUOTE=lordx78;544068]still not working.[/QUOTE] what part is not working, Everything seems to work when I run it...what are you trying … | |
Re: i assume you have root access to the server to set configurations etc.... I am not a phpmyadmin maestro, so you might be better off posting this in a linux/wamp forum depending on your server type...I can just suggest a few troubleshooting techniques that I have come across in my … | |
Re: try these changes...I put some comments where I thought they might help you understand what I changed... [CODE=php]<?php $accountname = $_POST['accountname']; $phone = $_POST['phone']; $fax = $_POST['fax']; $cell = $_POST['cell']; $add1 = $_POST['add1']; $add2 = $_POST['add2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $data = "$accountname \n $phone … | |
Re: to do a site like that, you're going to need secure form processing, some database interactivity to store sales records and customer info, and some email scripts to communicate with your customers. You are also going to need some sort of payment gateway to process credit cards. Google the term … | |
Re: on line 53 you say: [CODE]die(echo($errors)[0] );[/CODE] to take care of the parse error you can change this to : [CODE] die($errors[0]); [/CODE] however, that will only print the first error. If you want to print all of the errors, try changing this: [CODE] if (count($errors) > 0) { die(echo($errors)[0] … | |
Re: have you checked out the igoogle documentation ? [URL="http://code.google.com/apis/gadgets/index.html"]http://code.google.com/apis/gadgets/index.html[/URL] | |
Re: as nav33n pointed out, there are other issues going on in this script, but if you change your code like so, you should get the siri=xxx as you wanted... [CODE=php]foreach ($_POST[status_batch] as $key=> $papar) { $myTable = $_POST[jadual]; //------------------------------------------------------------------------------- $sql = "SELECT status_batch FROM ".$myTable." "; //echo "<hr><pre>$sql</pre><hr>"; $result = … | |
Re: try modifying your code like this: [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title> Test </title> <script language='javascript'> redirTime = "5000"; redirURL = "/common/index.php"; function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); } </script> </head> <body onload="redirTimer();" > </body> </html>[/CODE] | |
Re: something along these lines...you'll need to tweak it to fit your script, but you should get the idea... [CODE=php]//connect to mysql with your variables here... //execute your sql query(s), store result in $result //make a table to hold images and data $output = "<table width=\"300\">"; //fetch each row of data … | |
Re: I don't really have the time to read through all your code, but I will tell you that I usually get this error as the result of special characters inside of my sql statements (i.e. a -,&,%, !, etc where they don't belong). This could also be due to a … | |
| |
Re: you could use ajax to load the contents of a page into a div layer, but that is about the same approach as using frames, with more work. You could try and get fancy with some actionscript to write session or cookie data from within the flash at increments of … | |
Re: [QUOTE=web_lock;530760]I've handled this problem in my applications by using a SESSION random value which is initiated at my login page itself. Lets say your initial loading page is login.php. It would contain the following LOC [code] <?php session_start(); if($_POST[úserID']) { $_SESSION['randomvalue']=rand(); $_SESSION['loginValue']=md5($_SESSION['randomValue']); } else { écho '<script>'; echo "document.location='logout.php'"; echo"</script>"; … | |
Re: absolutely! There is a lot of material out there on the subject, so expect to spend some time learning some new tricks. there are several ways to go about doing it. For a simple introduction to PHP and XML check out [URL="http://www.kirupa.com/developer/php/php5_simpleXML.htm"]http://www.kirupa.com/developer/php/php5_simpleXML.htm[/URL] In that example, just replace the path of … | |
Re: when I use the select menu on your live page, I get a javascript error that says 'previewProduct is undefined' (look at the little exclamation alert on the bottom left of your browser and double click it to view details). instead of your output saying this: [QUOTE=myth3_16;529045] <select name=\"os0\" onchange=\"showimage()\">"; … | |
Re: You know, you've still got the Shift key working for you, and you're pretty good at camel casing your sentences...I had no problem reading that at all. If I were you I would ride the life of that keyboard out a bit more. | |
Re: there are about a gazillion of them...phpclasses.org has a pretty good treasure chest full of pre-written, free-for-use classes. [URL="http://www.phpclasses.org/browse/class/2.html"] http://www.phpclasses.org/browse/class/2.html[/URL] | |
Re: you can try [URL="http://www.thescripts.com/forum/thread601992.html"]http://www.thescripts.com/forum/thread601992.html[/URL] doesn't seem to work in IE7 though... [QUOTE=DangerDev;528180]reduce the size of pages...[/QUOTE] that's probably the best solution...;) | |
Re: As far as I understand, it's cached by the browsers in order to eliminate the need to constantly log in everytime you access/refresh a page. [URL="http://httpd.apache.org/docs/1.3/howto/auth.html"]see Apache article regarding basic authentication (scroll down about half way through page)[/URL]. | |
Re: [CODE]Can't create/write to file '/root/tmp/#sql_ddc_0.MY[/CODE] might be a permissions issue. Make sure folder /root/tmp/ has writable permissions | |
Re: that's a bit vague, but if you want an introduction to how ISPs work, check out the ever-so-informative wikipedia. [URL="http://en.wikipedia.org/wiki/ISP"]http://en.wikipedia.org/wiki/ISP[/URL] follow the various links throughout the page, and after hours/days of reading, you should have a pretty good idea. |
The End.