kenrbnsn
-
Posts
8,234 -
Joined
-
Last visited
Posts posted by kenrbnsn
-
-
Thanks for that explanation. I never knew of that RFC and I've been using/managing/programing computers since the days of the punch cards!
Ken
-
-
Sorry, it's
<?php $rma_year_issued=(int)$_GET['year']; ?>
instead of
<?php $rma_year_issued=int($_GET['year']); ?>
Ken
-
You are doing absolutely no error checking and no validation of your input paramenters. Never trust user data.
Here's how I would re-write your code:
<?php elseif($_GET['rma']=="calender"){ $sql101010="SELECT DISTINCT rma_year_issued FROM $tbl_name4 WHERE rma_issued='y' ORDER BY rma_year_issued"; $result101010=mysql_query($sql101010); while($row101010=mysql_fetch_array($result101010)){ extract($row101010); $content.='<a href="./acp_admincp.php?rma=calender&year='.$rma_year_issued.'">'.$rma_year_issued.'</a> <br />'; } if(isset($_GET['year'])){ $content=""; $logout.=' | <a href="./acp_admincp.php?rma=calender">Back to RMA Calender</a>'; $rma_year_issued=int($_GET['year']); $sql111010="SELECT DISTINCT rma_month_issued FROM $tbl_name4 WHERE rma_year_issued='$rma_year_issued' ORDER BY rma_month_issued"; $result111010=mysql_query($sql111010) or die("Problem with the query: $$sql111010<br>" . mysql_error()); $months = array('', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); while($row111010=mysql_fetch_array($result111010)){ $rma_months_issued2 = $months[$row111010['rma_month_issued']]; $content.="<a href='./acp_admincp.php?rma=calander&year=$rma_year_issued&month=$rma_month_issued'>$rma_month_issued2</a><br />"; } if(isset($_GET['month'])){ $content=""; $logout.=' | <a href="./acp_admincp.php?rma=calender&year='.$rma_year_issued.'">Back to RMA Calender Year</a>'; $rma_month_issued=int($_GET['month']); $sql211010="SELECT * FROM $tbl_name4 WHERE rma_year_issued='$rma_year_issued' AND rma_month_issued='$rma_month_issued' ORDER BY rma_date_issued"; $result211010=mysql_query($sql211010) or die("Problem with the query: $sql211010<br>" . mysql_error()); while($row211010=mysql_fetch_array($result211010)){ $content.="<a href='./acp_admincp.php?rma=calander&year=$rma_year_issued&month=$rma_month_issued&id=$rma_id'>$rma_number</a><br />"; } } } } ?>
Also, in the last loop, you're not using anything from the results of the query.
Ken
-
-
You put your statements in a file with the extension ".php" in the htdocs directory or in a directory in htdocs.
Ken
-
The short tag "<?=" is equivalent to "<?php echo", so
<?=$var?>
should be replaced with
<?php echo $var; ?>
Ken
-
run the cron job for every 2 seconds or 3 seconds
The minimum interval for a cronjob is 1 minute.
Ken
-
If you don't mind using a little bit of Javascript, you can do this in a few lines of jQuery. Put these lines at the just before the </head> tag:
<script type="text/javascript"> google.load("jquery", "1.6.1", {uncompressed:true}); </script> <script type="text/javascript"> $(document).ready(function() { $('.div_class_to_change').css('color','<?php echo $color['headers']; ?>'); // change all divs with class 'div_class_to_change' to the color defined $('#div_id_to_change').css('color','<?php echo $color['headers']; ?>'); // change all divs with id 'div_id_to_change' to the color defined }); </script>
Ken
-
-
Do a "show source", there you will see that the characters are replaced. If they hadn't been, you would have seen nothing, since the browser would have eaten any thing the looks like an HTML tag.
Ken
-
PHP is just used to write the correct HTML or Javascript code to show the playlists. One package you can use is Flowplayer. I use generate Flowplayer code with PHP all the time.
Ken
-
What makes you think it's not working?
Ken
-
You never terminate the <form> with a </form>, so your form may not work in all browsers.
Also, the $_POST array is only set once the form is submitted, so you need some logic in you code to only do the validation if the form was submitted.
Ken
-
The "+" character has special meaning when used in a URL. It will replaced by a space. Pick another character for your deliminator, such as a "~" or "`" or "|" or any character that you're not expecting to be in a keyword.
Ken
-
What is the value of the variable $keywords?
Post the result of
<?php echo '<pre>' . print_r($keywords,true) . '</pre>'; ?>
If $keywords is an array, you can create the query like this:
<?php $q = "SELECT product_id FROM $tbl_name2 WHERE keyword like '%" . implode("%' or keyword like '%",$keywords) . "%'"; ?>
Ken
-
First replace all the "smart quotes" with normal quotes:
“ ” is not the same as " "
That error is usually caused by mis-matched curly braces "{ }" or mis-matched quotes.
Ken
-
Try
<?php if (in_array($news['companyid'], $own_company[0])) ?>
Ken
-
Don't put the query in the while statement. When you do that, you're re-executing the query every time. Do something like
<?php $getpin=sprintf("SELECT * FROM users WHERE UserEmail='%s' AND UserPassword='%s'", mysql_real_escape_string($email) , mysql_real_escape_string($password)); $rs = mysql_query($getpin); while($row=mysql_fetch_assoc($rs)){ ?>
Ken
-
Use the function parse_str
<?php $str = 'api=somerandomkeyhere&user=someuser&password=somehashvaluehere&type=somethingelse'; parse_str($str,$ary); print_r($ary); ?>
Ken
-
Haha, I just sat back while Ken did all the work... sorta like management.
That's ok -- I like hands-on better than management
Ken
-
-
-
This line
<?php $content [$word[0]] => array('img_path' => $word[1], 'description' => $word[2], 'price' => $word[3]); ?>
is where the error is. You probably want
<?php $content[$word[0]] = array('img_path' => $word[1], 'description' => $word[2], 'price' => $word[3]); ?>
Ken
Need help with PHP code - ob_get_contents() and ob_start()
in PHP Coding Help
Posted
Why do you think that function, which is a Javascript function, has anything to do with the string you're trying to change.
I looked at the code you posted and I didn't see anything in there that would generate that string. Is there another PHP script?
Ken