Jump to content

dragon_sa

Members
  • Posts

    520
  • Joined

  • Last visited

Everything posted by dragon_sa

  1. putting this in your url works but the code your page is generating is this with no values for w and h so the problem is happening somehow sending the variables to your image links the $new_width variable is independent of $newWidth variable and does not affect each other directly
  2. mod rewrite for htaccess no database entry needed simply code your links as html links and let htaccess convert them to the real pages for your applications eg htaccess Options +FollowSymLinks RewriteEngine On RewriteRule ^([^/-]+).html$ /$1.php [R=301,L] so you would make your link products.html for example and that htaccess will convert that to product.php, it is also possible to pass variables to the pages with this method aswell.
  3. <img src="http://www.minimlpress.com/wp-content/themes/_minpress/scripts/timthumb.php?src=http://www.minimlpress.com/i/jasmine.jpg&h=&w=&zc=1" alt="jasmine" /> is what it is printing in the browser on loading the page which has no variable set for h & w so the timthumb script sets it to 200 & 180 if ($new_width == 0 && $new_height == 0) { $new_width = 200; $new_height = 180; } I cant see where your changing the style sheet for this page but looking at that url echo the $newWidth & $newHeight variable tpwards the top of your page that changes the style sheet and see if the variables are getting set
  4. the users configured for ownership in the server of those files and directories you create, as when you create a file or directory the server assigns ownership to a user of that server, the default owner being assigned to the files might not have permission there.
  5. The variable need to be in the php for them to change from the variable name to the variable, also you have a typo. you have <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=$newHeight&w=$=$newWidth&zc=1" alt="<?php the_title(); ?>" /> it should be like this <img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&<?php echo "h=".$newHeight."&w=".$newWidth; ?>&zc=1" alt="<?php the_title(); ?>" /> See how that goes
  6. if your not wanting to reload entire page you can put the content section in a div tag and use ajax to change the conents of the div tag, this way your content will still get referenced by bots. Content placed inside frames or iframes does not get indexed.
  7. I am assuming you have an if statement for each of those style sheets, just add the 2 variables there in each section for the coresponding size so if mp_960 is supposed to have image 200w and 180h would be <?php if ($mp_960 == "true") { $newHeight="180"; $newWidth="200"; ?> <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/960.css" type="text/css" media="screen,projection" /> <?php }?> so when that if statement is true so to are the settings for your timthumb script
  8. you could append them directly to the link that changes the stylesheet itself, if you use a form make them hidden variables, if you use a href link put them on the end depends how you r changing the stylesheet, then its just a matter of declaring the sizes you want for each style sheet type
  9. check to see who the owner and group of the directory are make sure it is skoobi aswell
  10. shared hosting may be another reason where you have no control of the cookie expiration times, which I have experienced a couple of times
  11. perfect exactly what I was look for thank you
  12. any particular reason you didnt just put 600 instead of 60 * 10?
  13. in you config page put a current time stamp and add 10 minutes to it, add this into a session variable, then everytime the page gets loaded you can then use config to check the time stamp variable, if it is within 10 minutes reset it to the new time stamp plu 10 mins if it is past 10 mins then kill the session variables and redirect to login page.
  14. maybe this will help more unless you only want 4 menu items echo "<ul>"; while($info = mysql_fetch_array( $page_name )) { $page = $info[page_name]; echo "<li><a href='".$page.".html'>$page</a></li>"; } echo "</ul>";
  15. if I am correct, you appear to be sending the size variable for your images to timthumb.php if u change it to h=$newHeight&w=$=$newWidth and delete width="200" height="180" as I believe the script does the image sizing for you you can then define $newWidth and $newHeight then based on the style sheet selected and no need to change timthumb.php at all
  16. I am reading a directory and getting a list of folders in the directory, I want to display the folders in a table which is 6 columns of results across by how ever may rows, here is the code I am using now which gets the folders and displays the table correctly, but it is currently only displaying the first result in an infinite loop. <?php $d='action'; #define which dir you want to read $dir = opendir($d); #open directory while ($f = readdir($dir)) { /* echo '<a href="'.$f.'/index.htm" target="_parent"><img src="'.$d.'/'.$f.'/folder.jpg" border="0"></a><br>'; */ if ($f!="." && $f!=".." && (!is_file($f))) { echo '<table cellspacing="5" cellpadding="4" align="center">'; $tdcount = 1; while ($f) { if($tdcount % 6 == 1) echo "<tr>"; echo '<td><font face="arial" size="1">'; echo '<a href="'.$f.'/index.htm" target="_parent"><img src="'.$d.'/'.$f.'/folder.jpg" border="0"></a></td>'; if($tdcount % 6 == 0) echo "</tr>"; $tdcount++; } echo "</table>"; } } ?> How do i make it display each result instead of only the first result. cheers
  17. It seems to explode the option tag in firefox after it inserts the variable for some reason, while I cannot figure out what is causing this, I have modified the code to look for a posted state and print that as the selected option outside the while loop. This works now in firefox but the only downside is it repeats the statename at the bottom of the list, this doest happen in internet explorer. no biggy as it selects what the user had previously anyway. I would love to know what is causing the code to blow out in fire fox if anyone has any ideas?? below is my subscribe page <?php session_start(); require('req/definitions.php'); include("data_connect.php"); $page = ('Subscribe'); // start error array $arrErrors = array(); //Only validate if the Submit button was clicked. if (!empty($_POST['submit'])) { // declare all variables $username =($_POST['name']); $useremail = ($_POST['email']); $usercountry = ($_POST['country']); $userstate = $_POST['state']; $usercode = $_POST['code']; $useradded = $_POST['added']; $validcode = $_SESSION['code']; // email and data input check $emailquery = "SELECT email FROM subscribers WHERE email='$useremail'"; $resultemail = mysql_query($emailquery); $selectemail = mysql_fetch_array($resultemail); $emailexist = $selectemail["email"]; if (!empty($emailexist)) $arrErrors['exist'] = $useremail . ' already exists'; if ($username=='') $arrErrors['name'] = 'Please enter a name'; if ($useremail=='') $arrErrors['email'] = 'Please enter valid email'; if ($usercountry=='--Please Select Country--') $arrErrors['country'] = 'Please select a country'; if ($userstate=='--Please Select State/Province--') $arrErrors['state'] = 'Please select a state'; if ($validcode!=$usercode) $arrErrors['code'] = 'Missing or Incorrect Code'; // convert country code to country name $querycnty = "SELECT name FROM countries WHERE ccode='$usercountry'"; $resultcnty = mysql_query($querycnty); $selectcnty = mysql_fetch_array($resultcnty); $namecnty = $selectcnty["name"]; // if no errors add to database if (count($arrErrors) == 0) { $sql = "INSERT INTO subscribers (name, email, country, state, added) VALUES ('" . $username . "', '" . $useremail . "', '" . $namecnty . "','" . $userstate . "', '" . $useradded . "')"; $result = mysql_query($sql); header("Location: thanks.php?thanks=subscribe&n=$username&e=$useremail"); } else { $strError = '<div class="formerrorf"><br/><p><img src="/images/triangle_error.gif" width="16" height="16" hspace="5" alt="Represents missing information"><b>Please check the following Errors:</b></p><ul>'; // Get each error and add it to the error string as a list item. foreach ($arrErrors as $error) { $strError .= "<li class='indent'><b>$error</b></li>"; } $strError .= '</ul></div>'; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo LOGO_ALT ?></title> <meta name="keywords" content="<?php echo KEYWORDS ?>" /> <link href="site.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" language="javascript" src="scripts/noEnter.js"></script> <script language="javaScript" type="text/javascript"> function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getState(codeId) { var strURL="statecall.php?countrycode="+codeId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('statediv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } </script> </head> <body> <table width="970px" border="0" cellspacing="0" cellpadding="5" align="center"> <tr> <td width="170px" align="center" valign="top"><br /> <?php $sql = "SELECT * FROM images WHERE name='subleft'"; $result = mysql_query($sql); $result_row = mysql_fetch_array($result); echo "<img src='site_images/" . $result_row["image"] . "' border='0' width='160' alt='" . LOGO_ALT . "'/>"; ?></td> <td rowspan="2" class="contact" width="450px" align="left" valign="middle"> <form name="subscribe" method="post" action="subscribe.php"> <table width="450" border="0" cellspacing="0" cellpadding="0"> <tr><td height="100px" class="contact" align="left" valign="middle"><b>Fill out the form below to join our mailing list.<br />Receive the latest goss and be the first to see the latest range.</b><br /></td></tr> <tr> <td><label for="name"> Your Name: </label><input name="name" type="text" size="35" id="name" value="<?php echo $username; ?>"/></td> </tr> <tr> <td><label for="email"> Email Address: </label><input name="email" type="text" size="35" id="email" value="<?php echo $useremail; ?>"/></td> </tr> <tr> <td><label for="country">Country: </label><select name="country" id="country" onchange="getState(this.value);"> <option value="--Please Select Country--">--Please Select Country--</option> <?php // print category combo box $sql = "SELECT name,ccode FROM countries ORDER BY name ASC"; $result = mysql_query($sql); while ($result_row = mysql_fetch_array($result)) { $cname = $result_row["name"]; $cid = $result_row["ccode"]; echo "<option value='$cid'"; if ($usercountry==$cid) { echo " selected='selected'"; $valueName==$cname; } echo ">$cname</option>\n"; } ?> </select></td> </tr> <tr> <td><label for="state"> State: </label><div id="statediv"><?php include('statecall.php'); ?></div></td> </tr> <tr> <td><input type="hidden" size="35" name="added" value="<?php echo date("d-m-Y H:i:s");?>"/></td> </tr> <tr> <td align="center"><br /> <label for="code">VERIFY CODE</label><img src="check/CaptchaSecurityImages.php" class="bw1" alt="VERIFY CODE" align="middle"/></td> </tr> <tr> <td align="center"><label for="submit"> </label><input name="code" type="text" id="code" size="6" maxlength="6" onkeypress="return noEnter(this, event)"/> <input name="submit" id="submit" type="submit" value="Subscribe"/></td> </tr> </table></form> </td> <td width="350" height="280" align="center" valign="middle" class="contact"><br /> <?php if (!empty($strError)) { echo $strError; } else { $sql = "SELECT * FROM images WHERE name='subright'"; $result = mysql_query($sql); $result_row = mysql_fetch_array($result); echo "<img src='site_images/" . $result_row["image"] . "' border='0' width='340' alt='" . LOGO_ALT . "'/>"; } ?></td> </tr> <tr> <td valign="bottom" align="center" class="pagetitle"><?php echo $page ?><br /><br /></td> <td width="350" align="center" valign="top"><iframe width="300px" height="120px" allowtransparency="true" name="go" frameborder="0" scrolling="no" src="none.html">This page uses iframes please upgrade your web browser, we apologise for any inconvenience.</iframe></td> </tr> <tr> <td height="50px" colspan="3" align="center" class="men"><?php include('menu_bottom.php'); ?></td> </tr> </table> </body> </html> and below is the statecall.php file to populate the state list <select name="state" id="state"> <option value='--Please Select State/Province--'>--Please Select State/Province--</option> <?php include('data_connect.php'); // print state select box // convert country code to country name if (!$countrycode) { $countrycode = $usercountry; } $getcnty = "SELECT * FROM countries WHERE ccode='$countrycode'"; $resultcnty = mysql_query($getcnty); $selectcnty = mysql_fetch_array($resultcnty); $cntyname = $selectcnty["name"]; $querystate = "SELECT * FROM states WHERE code='$countrycode' ORDER BY nameorder"; $result = mysql_query($querystate); while($row_result = mysql_fetch_array($result)) { $statename = $row_result["name"]; if ($statename) { if ($statename!=$userstate) { echo "<option value='$statename'>$statename</option>\n"; } } } if (!empty($userstate)) { echo "<option value='$userstate' selected='selected'>$userstate</option>\n"; } if (!$statename) { if (!empty($cntyname)) { echo "<option value='$cntyname' selected='selected'>$cntyname</option>\n"; } } ?> </select>
  18. someone has mentioned about using get_defined_constants() which will list all define( 'LABEL', 'value' ); but not sure how to use it Form page reading file and listing seleced defines values in text area box, which can be changed, on submit it updates the definition.php file with the new values for the selected LABELS, any help on this please
  19. I have seen how to change an existing file using the text area, but how would you just extract and edit the variables of the defines tags in file of php defines statements, for use for example to modify site logos and heading texts that are defined in such files? Any help would be much apreciated thank you
×
×
  • 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.