Jump to content

tgeorge06

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by tgeorge06

  1. how would a redirect help? why would i want to redirect http://192.168.1.1 to http://192.168.1.1? just for shits n giggles, I tried the redirect for ya... didn't work.
  2. So I am using these rules RewriteCond %{HTTP_HOST} !^(www.|$) [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] But of course, thats catches everything and its brother, including the plain server ip e.g. http://192.168.1.1 --> http://www.192.168.1.1 Which breaks it SO, i've been messing with this for 2 days, trying diff rules out trying to make up my own little mod_rewrite snipet of genius, BUT to no success... here i am. I leave you, the mod_rewrite wizard, the task of solving the crime of rewriting my server ip to include a www. haha. I would like to force www. for all domain names and leave ip addresses alone.. for instance, domain.com would be forced with www. but http://192.168.1.1 would not. Thanks in advance, much appreciated.
  3. I edited the rewrite code some more and i put this code block inside of httpd.conf, not under a directory or anything. I don't think im understanding the correct path's for this mod_rewrite, but would that not be an absolute path to the page i want/need to go to? <IfModule mod_rewrite.c> RewriteEngine On RewriteRule http://%{HTTP_HOST}/products/([^/]+)-([0-9]+).html http://%{HTTP_HOST}/products.php?productName=$1&id=$2 </IfModule>
  4. Well the rewrite works if i put it under the Vhost block, but i'm trying to do this globally for all 1,500 websites that is on the server with this method of products. Any ideas?
  5. alright, so i've been messing with mod_rewrite for the past few days trying to figure it out on my own and it isn't working out exactly as I had planned. Firstly, I thought mod_rewrite just rewrote the url's based on the regex's and what not that is declared, but I was wrong. So I now understand that when im forming my html links instead of doing products.php?id=$id it should be example.com/products/$id.html and mod_rewrite tells the script that i'm actually saying example.com/products.php?id=$id. At least thats what I think i know as of now. So here is where i'm at, I wrote my url as follows: http://footballbookends.com/products/Football_and_Baseball_Bookends-14238.html and my RewriteRule(inside httpd.conf) as follows: <Directory "/var/apanel/www"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^products/([^/]+)-([^/]+)\.html$ products.php?productName=$1&id=$2 </IfModule> </Directory> Now i'm not sure if it matters but, /var/apanel/www is the base folder for all of our websites so footballbookends.com lives inside /var/apanel/www What am I doing wrong?
  6. I'm trying to import a .xlsx file into mysql database with the newest Navicat. It works, but there is a problem. My longtext field cuts off mid sentence on a few of my rows and replaces everything else with 3 question marks. I've set what i thought was the proper charset...UTF8, not sure where i'm going wrong.
  7. as simple as that.... one day, one day i will help others as you have helped me. phpfreaks recommended is right =) Marking as solved. Thank you for your time!
  8. Ok, thanks for the help...any idea how to keep the selected state in the first dropdown box/form after pressing the submit button?
  9. oh ok, i usually just use single quotes... should i \" from now on?
  10. Made all of your changes, works great thanks! One question, I'd like to understand why you used the slashes echo "<option value=\"$state\">$state</option>"; And one more thing, How do I retain the state I selected in the first dropdown after the submit button has been pressed?
  11. What about using ". ." around the \f $partname = str_replace(".\f.", "", "$partname");
  12. what if you did $partname = str_replace("\f", "", "$partname");
  13. what I am trying to accomplish is for the user to select the state they wish, hit submit. At this point another form should show asking which county based on the state they picked, then hit search. At this point, I'm having an issue having the state variable being passed to the 2nd form also having the state they selected stay selected. <?php $default = "Step 1. Pick Your State"; $select = "<option name='statebox'>$default</option>"; echo "<br/><form method='POST' action=".$_SERVER['PHP_SELF']." >"; echo "<select name='search'>"; echo "$select"; /////////////////////////////////////////////////////////////// //Connect to the database include_once 'phpforms/connect.php'; $sql = mysql_query("SELECT * FROM states"); while($row = mysql_fetch_array($sql)){ $state = $row['states']; echo "<option name='statebox'>$state</option>"; }//End While /////////////////////////////////////////////////////////////// echo "</select>"; echo "<input align='left' type='submit' name='stateboxbutton' value='Ok'> "; echo "</form>"; echo "</td>"; echo "<td>"; if(isset($_POST['stateboxbutton'])){ $statesearch = $_POST['statebox']; $selected = $_POST['statebox']; $select = "<option name='statebox'>$selected</option>"; echo "<br/><form action='../search-results.php' method='POST'>"; echo "<select name='search'>"; echo "<option name='default'>Step 2. Pick Your County</option>"; /////////////////////////////////////////////////////////////// //Connect to the database include_once 'phpforms/connect.php'; $sql = mysql_query("SELECT * FROM counties WHERE state LIKE '$statesearch'"); while($row = mysql_fetch_array($sql)){ $co = $row['counties']; echo "<option name='county'>$co</option>"; }//End While /////////////////////////////////////////////////////////////// echo "</select>"; echo "<input align='left' type='submit' name='button' value='Search'> "; echo "</form>"; }else{ }//End Else ?>
  14. Thank you both of you for the help. Cleaning up my code solved the problem. Trimming white space and also using the wild cards for the mysql query. I can't believe I forgot to use wildcards, I kind of feel dumb. Anyways, it works as I thought it should have worked the first time now. I appreciate the help and sorry for the belated reply with results.
  15. $st = $rowcompany['states']; $statesearch = explode(',', $st); $st has already been declared via mysql query earlier in the document. What I am trying to accomplish here is when a user profile is listed as say "New York, Ohio" or however many states they wish to have on their profile, it will explode the states list that is seperated by commas. Then it should search the mysql database for each state it breaks out via explode. With this code it is stopping at New York and not showing Ohio results in the select list options. <?php foreach($statesearch as $s){ echo "You Searched $s "; } echo "<form action='phpforms/updatecounties.php' method='POST'>"; echo "<select name='counties[]' MULTIPLE SIZE=5>"; foreach($statesearch as $s){ //Connect to the database include_once 'phpforms/connect.php'; $sql = mysql_query("SELECT * FROM counties WHERE state LIKE '$s'"); while($row = mysql_fetch_array($sql)){ $counties = $row['counties']; echo "<option value='$counties'>$counties</option>"; }//End While }//End Foreach echo "</select>"; echo "<input type='submit' name='button' value='Update The Counties You Cover'>"; echo "</form>"; ?>
  16. C)Your server admin is homophobic. *puts on sunglasses*...had to do it.
  17. maybe have a cron job run every 24 hours to update value of $x by 1?
  18. I'm not an expert, but I used something like you are talking about to check and make sure my username was unique before having people register. $query = mysql_query ("SELECT * FROM table WHERE comment='$comment'"); $numrows = mysql_num_rows($query); if ($numrows == 0) { //Do whatever }else{ //Comment Not unique! }
  19. Not quite sure the exact name of which i'm looking for but... I have everything working where you can register a user and login...What I forgot to do and trying to do now is setup a "time to live" value for the user starting at 365 and depleting 1 per day. guessing i could just use an if/else statement for the login to check to see if they "time to live" >=1. What do you guys think would be the best approach for this? Also how would i get the time to live to deplete 1 per day in the mysql db?
  20. I know ubuntu 9.04 isnt directly supported by Dell.com, but what good is linux if you can't work around things? =) I am still pretty new to linux, but I have a very good working knowledge of computers. The issue im dealing with is my card seems to have its drivers installed right, but I do not think it is working at its full potential. The card is a Matrox MGA G200eW WPCM450 The max resolution i can get to at the moment is 1024x768. At this resolution the screen lags when you scroll and the mouse lags a bit.. That is why I do not think its working as it should. The computer is a Dell Server PowerEdge T410, just bought it brand new a week ago. I have been researching about the graphics problem by myself on free time, but as I am short on time, I'm asking those of you to help me out. Thanks, feel free to email me at tgeorge06@gmail.com where I can instantly get your email, and reply (iphone).
×
×
  • 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.