Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Then you probably need to use the resize function like so <div class="thumb"> <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php $settings = array("w"=>100,"h"=>100,"crop"=>true); $values = get_post_custom_values("thumbs"); ?> <img src="<?php echo resize($values[0], $settings); ?>" alt="<?php the_title(); ?>" /> </a> </div>
  2. You maybe able to override the php.ini setting using the ini_set function within your php scripts. Or using a .htaccess file using the php_flag directive Example htaccess file php_flag upload_tmp_dir /path/to/tmp/dir/ php_flag upload_max_filesize 50M
  3. What does the function get_post_custom_values() return? What is the source code for that function? You first need to understand what that function does and what type of data it is returning before trying to merge the two functions together.
  4. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=340317.0
  5. Then change echo "<tr style=\"background-color: $bgcolor\">"; // apply the color to the row to echo "<tr class=\"$bgcolor\">"; // apply the class to the row Now set the variables $color1 and $color2 to your two classes. Just place the text after your variables.
  6. This is how you alternate colors $i = 0; // initiate counter variable // set the colors $color1 = '#e1e1e1'; // first color $color2 = '#cccccc'; // secound color while($row = mysql_fetch_array($result)) { // alternate row colors $bgcolor = ($i % 2 == 0) ? $color1 : $color2; echo "<tr style=\"background-color: $bgcolor\">"; // apply the color to the row echo "<td>" . $row['firstname'] . "</td>"; echo "<td>" . $row['lastname'] . "</td>"; echo "</tr>"; $i++; // increment counter }
  7. What error? It would be helpful if you tell us the exact error and on what line(s) it is occurring?
  8. The following line passes the variable you pass to it by reference. function CalculateRatios(&$ValueArray){ passing by reference is explained in the manual here http://php.net/manual/en/language.references.pass.php What is it you are trying to do?
  9. What are you doing when your pattern matches the '$xxx[yyy]' string?
  10. You have left off the curly braces if($state == 'FL') { $price = $prices_array[$size]; // Set Price $tax = number_format($price * .07,2); // Set tax $amount = number_format($price + $tax,2); // Set total amount } else { $price = $prices_array[$size]; // Set Price $tax = number_format($price * .0,2); // Set tax $amount = number_format($price + $tax,2); // Set total amount }
  11. Sort your code out so there is no output before the use of header(). Or use output buffering for a lazy fix. Another option would be to set a html meta redirect or use JavaScript.
  12. You don't use PHP to apply color to text within HTML tags. This is handled by client side language such as CSS. This is not possible with PHP at all. I have answered your earlier question which I moved to CSS Help, as it is the appropriate forum for your question. This thread will be locked/removed soon so post all your replies here http://www.phpfreaks.com/forums/index.php?topic=340099.0
  13. You can't colour individual words within <option></option> tags,
  14. Probably because you have some form of output before the use of that function. You cannot echo/print anything to the screen before the use of header().
  15. This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=340099.0
  16. Why? You'd use CSS for this. You wont be able to color certain parts of text within the <option></option> tags. Example CSS <select> <option value="large blue" style="color: blue">Large Blue T-shirt</option> <option value="large blue" style="color: Green">Small Green T-shirt</option> </select> I'll move this to CSS help
  17. You could reconstruct attack array so each attack level is holds an array of attacks. Example array structure $array ( // level => array of attacks 4 => array('poison', 'tackle'), 6 => array('sleep powder'), 44 => array('giga drain'), // etc ) Then all you need to do to get the all the attacks for level 4 would be if (isset($array[4])) { $attacks[] = $array[4]; }
  18. You can use header to redirect the user to another page header('Location: newpage.php');
  19. What are you trying to do?
  20. That will work so long as the OP is using the mysqli library functions within their code. The functions for mysql and mysqli are not interchangeable. So if you're using mysqli_connect toconnect to mysql but use mysql_query to run a query it wont work.
  21. The only way to pass both the $var2['DID'] and $var2['directory'] values would be as marcelobm suggested to you earlier To get the id and directory within the script that processes the form you'd use something like this list($id, $directory) = explode('_', $_POST['id']);
  22. Why not just do list($newlastname,$newfirstname) = explode(', ',$row['full_name']); Or (untested) list($newlastname, $newfirstname) = preg_split('~,\s+~', $row['full_name']);
  23. So you want to retrieve both the $var2['DID'] and $var2['directory'] values from the <select></select> field when the form has been submitted?
  24. Your query is selecting all the rows within the dle_mylink table, and ordering the results by the size of the title in descending order (ie largest title to smallest title) $SQL = "SELECT * FROM dle_mylinks ORDER BY LENGTH( title ) DESC"; If that table has 83000 rows then it'll return 83000 results. The while loop will iterate over the results 83000 times. while ($db_field = mysql_fetch_assoc($result)) { $row['full_story'] = str_replace ($db_field['title'],"<a href=\"?newsid=" . $db_field['id'] . "\">" . $db_field['title'] . "</a>" ,$row['full_story']); $row['short_story'] = str_replace ($db_field['title'],"<a href=\"?newsid=" . $db_field['id'] . "\">" . $db_field['title'] . "</a>" ,$row['short_story']); } The code within the while loop (between the curly braces { and } ) will be executed for every row the query is returned. So if your query returns 83000 rows then those two lines WILL be executed 83000 times. After the while loop you have this line $mydata =$row['short_story'] . $row['full_story']; Here you are concatenating the $row['short_story'] and $row['full_story'] variables into one value and assigning that to the $mydata variable. The $mydata variable will only store the result from the very last row returned by your query. You are not doing anything with the previous 82999 rows, as the while loop will keep overwriting the $row['short_story'] and $row['full_story'] variables each time it processes the next row.
  25. What code are you using to login the user. And what code are you using check if a user is logged in?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.