Forum: PHP May 7th, 2009 |
| Replies: 2 Views: 781 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.... |
Forum: PHP Jul 23rd, 2008 |
| Replies: 2 Views: 323 you want pagination.
check out a couple of scripts in the snippets section...
http://www.daniweb.com/code/snippet341.html
http://www.daniweb.com/code/snippet612.html
pagination is pretty... |
Forum: PHP Jul 23rd, 2008 |
| Replies: 1 Views: 1,223 try specifying method='POST" in all of of your <form> tags...like so:
<form name="pointofcontact" action = "saveproject.php" method="POST">
it seems like some of your forms are defaulting... |
Forum: PHP Jul 23rd, 2008 |
| Replies: 4 Views: 732 JavaScript would be the way to go.
You'll probably get better help in the JavaScript/AJAX/DHTML forum on this one. |
Forum: PHP Jul 23rd, 2008 |
| Replies: 14 Views: 885 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... |
Forum: PHP Jul 23rd, 2008 |
| Replies: 3 Views: 1,714 Yes, this is where the issue lies. The onchange attribute of each of your select boxes is set to redirect to a page as soon as an option is selected. The page is determined by the selected option's... |
Forum: PHP Jul 13th, 2008 |
| Replies: 3 Views: 435 you could use a for loop rather than a while statement. For example:
$howMany=$_POST["hmany"];
for($i=0;$i<=$howMany;$i++)
{
$rand=mt_rand(1,$_POST["dice"]);
echo "You rolled a... |
Forum: PHP Jul 13th, 2008 |
| Replies: 13 Views: 1,077 actually, this will just print the value of $abc (nothing) with the value of $i appended to the end. If you have variables $abc1, $abc2, etc. , you will not get the value of those variables, you'll... |
Forum: PHP Jul 12th, 2008 |
| Replies: 7 Views: 655 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... |
Forum: PHP Jul 12th, 2008 |
| Replies: 13 Views: 1,077 you were close here. Just a small change:
for($i=1; $i<=3; $i++)
{
echo $abc[$i];
}
or for unknown array size, use: |
Forum: PHP Jun 6th, 2008 |
| Replies: 3 Views: 720 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 run, because your... |
Forum: PHP Apr 16th, 2008 |
| Replies: 1 Views: 457 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... |
Forum: PHP Mar 24th, 2008 |
| Replies: 3 Views: 2,205 try encoding your str1 with encodeURIComponent
more about this at w3schools (http://www.w3schools.com/jsref/jsref_encodeURIComponent.asp) |
Forum: PHP Mar 8th, 2008 |
| Replies: 4 Views: 1,085 to encode it in php...
<?php
//encode input going in...
$encode = urlencode("in'out\"");
//decode output coming out...
$decode = urldecode($encode); |
Forum: PHP Mar 8th, 2008 |
| Replies: 3 Views: 554 another way to tackle it would be...
echo '<td align=center style="width: 30px"><strong><a href="' . $link1 . '" style="color: red">CID</a></strong></td>'; |
Forum: PHP Mar 8th, 2008 |
| Replies: 3 Views: 554 echo "<td align=center style=\"width: 30px\"><strong><a href=\"$link1\" style=\"color: red\">CID</a></strong></td>"; |
Forum: PHP Mar 6th, 2008 |
| Replies: 4 Views: 1,001 'L' returns 1 if it is a leap year or 0 if it is not. Use 'Y' for 4-digit year. |
Forum: PHP Mar 6th, 2008 |
| Replies: 4 Views: 1,001 <?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); |
Forum: PHP Mar 3rd, 2008 |
| Replies: 6 Views: 2,927 Working off the code sample in my earlier post...
Here would be one way to ensure the checkboxes were checked if they had chosen them previously...
//array to hold checkbox options... |
Forum: PHP Mar 1st, 2008 |
| Replies: 3 Views: 547 mmmmmmm cookies...
<?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,... |
Forum: PHP Mar 1st, 2008 |
| Replies: 1 Views: 1,039 try changing your code like this:
while($row = mysql_fetch_array($resultmoto))
{
$data = $row[1];
$leg = $row[0];
$chart [ 'chart_data' ][ 0 ][ $bar ] = $data;
$chart [ 'chart_data' ][... |
Forum: PHP Mar 1st, 2008 |
| Replies: 3 Views: 13,745 syntax is the same as c. for example:
<?php
for($i=0; $i < 50; $i++)
{
//skip numbers 4
if($i == 4)
{
continue; |
Forum: PHP Feb 27th, 2008 |
| Replies: 6 Views: 680 echo your option tags inside of a select tag like this:
<select name="test" id="test">
<option value="value 1">option 1</option>
<option value="value 2">option 2</option>
<option... |
Forum: PHP Feb 24th, 2008 |
| Replies: 17 Views: 1,277 also, just to make sure we're not missing something obvious here...you are saving the page as .php extension right? |
Forum: PHP Feb 24th, 2008 |
| Replies: 17 Views: 1,277 you only have to use commas if you want commas to appear in the output
what part is not working, Everything seems to work when I run it...what are you trying to do? |
Forum: PHP Feb 23rd, 2008 |
| Replies: 11 Views: 1,220 |
Forum: PHP Feb 16th, 2008 |
| Replies: 3 Views: 547 glad to be of assistance! |
Forum: PHP Feb 16th, 2008 |
| Replies: 3 Views: 547 try these changes...I put some comments where I thought they might help you understand what I changed...
<?php
$accountname = $_POST['accountname'];
$phone = $_POST['phone'];
$fax =... |
Forum: PHP Feb 16th, 2008 |
| Replies: 2 Views: 471 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.... |
Forum: PHP Feb 14th, 2008 |
| Replies: 36 Views: 3,548 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... |
Forum: PHP Feb 14th, 2008 |
| Replies: 9 Views: 2,458 at the top of your config.php you start output buffering, but have commented it out:
//ob_start("ob_gzhandler");
that probably means that the script sends headers throughout it...you may want... |
Forum: PHP Feb 13th, 2008 |
| Replies: 2 Views: 493 have you checked out the igoogle documentation ?
http://code.google.com/apis/gadgets/index.html |
Forum: PHP Feb 13th, 2008 |
| Replies: 17 Views: 1,058 on line 53 you say:
die(echo($errors)[0] );
to take care of the parse error you can change this to :
die($errors[0]); |
Forum: PHP Feb 13th, 2008 |
| Replies: 3 Views: 4,247 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...
foreach ($_POST[status_batch] as $key=>... |
Forum: PHP Feb 13th, 2008 |
| Replies: 9 Views: 2,458 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 files are outputting any content to the page such as... |
Forum: PHP Feb 13th, 2008 |
| Replies: 6 Views: 3,310 i usually just insert the path to the location of the image, so I'm not well versed in storing the actual image data in and retrieving it from the database...I stumbled across this tutorial on... |
Forum: PHP Feb 12th, 2008 |
| Replies: 6 Views: 3,310 something along these lines...you'll need to tweak it to fit your script, but you should get the idea...
//connect to mysql with your variables here...
//execute your sql query(s), store result... |
Forum: PHP Feb 12th, 2008 |
| Replies: 5 Views: 912 if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
change the above code (starts on line 11) so that it looks like this: |
Forum: PHP Feb 12th, 2008 |
| Replies: 6 Views: 2,927 since most people will probably never pick more than a few, it would save space to only have one column.
try this:
<?php
//multi-list boxes post an array of results
//get this array into a... |
Forum: PHP Feb 12th, 2008 |
| Replies: 5 Views: 912 any chance you can post the code? |