Jump to content

siwelis

Members
  • Posts

    135
  • Joined

  • Last visited

Everything posted by siwelis

  1. Awesome! That was perfect. I was going to figure out the 301 later, but you even had that in there. Thank you!!! My only change was for my memory later changing the "&r=0" to "&null=0" so I'll remember when I look at it later. Thanks again!!!
  2. Hello Ladies and Gents, I'm getting back into coding after a year lapse. Got my first big project coming up soon too, but in the meantime, I'm working on my personal site and am LOST on a piece of code (Mod_Rewrite) that I gave up on years ago... Or did I give up?! No! I'm finally seeking help!!! #below masks URL successfully to html RewriteRule ^a/(.*)/(.*)\.html$ /a/$1/?req=read&article_title=$2 [L] #however, when I try to force that old URL to go to the HTML version, absolutely nothing happens RewriteRule ^a/(.*)/?req=read&article_title=(.*)$ /a/$1/$2.html [R] Does anyone see what I did wrong in the "Redirect" code below? Sweet lord almighty! I've tried to figure this out on my own numerous times over the years. Pray ye have the answer? Thank you in advance.
  3. seanlim, I ended up using the function array_key_exists you used. It's the first time I've ever used that function... I was trying to do that with isset but was having a hard time figuring it out... Nice to know there's a function for it already. Thank you for your help everyone!
  4. i think it will mostly depend on how friendly the GPS device is to your needs... this wordpress (php) plugin may give you some insight as far as connectivity to Garmin: http://wordpress.org/extend/plugins/garmin-connect/ Garmins can be pretty cheap sometimes... especially around black Friday. 70 w/ 1 yr maps, 99 for lifetime maps.
  5. how could i better declare $tagArray?
  6. This code seems to work fine in older versions of PHP, but in newer.. I get an error message... $tagArray = $temp = array(); $temp = explode(',', $words); foreach($temp as $tag){ $tagArray[trim($tag)]++; } The error message is: "Notice: Undefined index: 1..." I assume I can just turn off the error reporting, but I'd really rather fix the problem. Does anyone know what's going on? Thank you.
  7. i ended up deleting my database info in the php file, ran a script to see what databases were in there and copy/pasted from there... humbly enough, i must have made a mistake in the name of the database. the snippet of php script i used to list databases was this one: $link = mysql_connect('localhost', 'chexdcom_nhca', 'vdtfDCbZrZL4mnyE'); $db_list = mysql_list_dbs($link); while ($row = mysql_fetch_object($db_list)) { echo $row->Database . "\n"; } to my defense, i think my host may auto-prepend an identifying character set to the database names. thanks for your help fenway.
  8. Ye ol' pconnect access denial has attacked me. I come to you weathered and torn. Do ye have some ale? Ok, so here's what's happening. I'm trying to duplicate a table. No errors from the dump or the recreation of the sql database. $db_server = "localhost"; $db_user = "chio"; $db_db = "chio"; $db_pwd = "wallaBE"; $sql = mysql_pconnect('localhost', $db_db, $db_pwd); mysql_select_db($db_db, $sql) or die (mysql_error()); I know the problem isn't with the user or password, because I gave the new user global privileges and tested it on the original database with the same password. I even tried giving it database-level privileges. No luck. This happens for both my personal server and external web server, where the original tables can be accessed fine and the new ones can't. Anyone have any idea why I can't connect to the DB? Maybe a DB setting? Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'chio'@'localhost' (using password: YES) in /home/chio/public_html/chio/database.php on line 6 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/chio/public_html/chio/database.php on line 7 Access denied for user 'chio'@'localhost' (using password: YES) Local Server Info: Server version: 5.1.53-community-log MySQL client version: mysqlnd 5.0.7-dev - 091210 - $Revision: 304625 $ External Server Info: Server version: 5.0.92-community-log MySQL client version: 4.1.22
  9. Yeah but I didn't find them. It seems like yesterday all I was finding was HTML editors... I searched again and found some! http://www.google.com/search?hl=en&safe=off&client=firefox-a&hs=Pu9&rls=org.mozilla%3Aen-US%3Aofficial&q=WYSIWYG+javascript&aq=f&aqi=g4g-m5&aql=&oq=&gs_rfai=
  10. Also, just to check they are not for whatever reason actually empty, this code insertion just before the form will tell you... echo '<br />Values: '.$nric.' '.$name.' '.$gender; ?> <form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
  11. <input type="text" id="firstname" name="firstname" value="<?php if (!empty($name)) echo $name; ?>" /><br /> <label for="lastname">Last name:</label> <input type="text" id="lastname" name="lastname" value="<?php if (!empty($nric)) echo $nric; ?>" /><br /> <label for="gender">Gender:</label> <select id="gender" name="gender"> <option value="M" <?php if (!empty($gender) && $gender == 'M') echo 'selected = "selected"'; ?>>Male</option> <option value="F" <?php if (!empty($gender) && $gender == 'F') echo 'selected = "selected"'; ?>>Female</option> i think curley brackets are needed. <input type="text" id="firstname" name="firstname" value="<?php if (!empty($name)){ echo $name; } ?>" /><br /> <label for="lastname">Last name:</label> <input type="text" id="lastname" name="lastname" value="<?php if (!empty($nric)){ echo $nric; } ?>" /><br /> <label for="gender">Gender:</label> <select id="gender" name="gender"> <option value="M" <?php if (!empty($gender) && $gender == 'M'){ echo 'selected = "selected"'; } ?>>Male</option> <option value="F" <?php if (!empty($gender) && $gender == 'F'){ echo 'selected = "selected"'; } ?>>Female</option>
  12. Does anyone know of any free GUI or WSIWYG text field scripts? For example; on eBay, the "HTML" view vs "Standard" which renders out HTML while editing on Blogger, the "Edit HTML" vs the "Compose" which even utilized standard hotkeys like CTRL+B for bold and when inserting an image it inserts it after uploading it. Wordpress's form text field is also very similar. Any guidance is much appreciated! Thank you!
  13. LOL! I'm glad PHP has no problem with that! - Thanks a lot guys! This clears up a LOT of issues I've had.
  14. For some reason I have some code like this that executes even when the variable isn't set. Is my syntax wrong? $setting = mysql_real_escape_string($_POST['setting']); //value posted for setting is "yes" if($setting = "correct"){ echo Hello; } //echo's Hello //works right ////OTHER SCENARIO $setting = mysql_real_escape_string($_POST['setting']); //value is not posted for setting if($set = "yes"){ echo Hello; } //Still echo's Hello I know I could just do a check to see if the variable is set and if not exit() or similar, but I really shouldn't have to... right? I don't mind workarounds, but I'd rather work it through.
  15. Has anyone heard of this? When I echo "<table border"... it comes out fine When I put it through mail( it removes the space to be "<tableborder" thus showing up incorrect
  16. What version of PHP are you using? <? phpinfo(); ?> That function has been depreciated and may no longer be supported: http://php.net/manual/en/function.split.php You need to figure out how to accomplish what "split ('-', $date)" would do using either preg_split or explode... I'm not familiar with them enough myself to help you in a timely manner, but you will be on the right path.
  17. Put it right where you did an echo of the sql. If it's not echoing anything, there are probably no POST values being posted from a form at all. Try replacing your submit button code with this: <input name="delete" type="hidden" id="delete" value="delete"> <input type="submit" value="Delete"> I don't think values are submitted the way you were thinking with the submit button, but I could be wrong. I assume the name of this file is insert.php.
  18. I'm sorry I didn't realize you had already posted the SQL statement. Its definitely sounds wrong if it's supposed to be deleting though. It sounds like it's not getting the right $_POST['delete'] information. put this in your code to get all POST's and see if they're whta you expect... while (list ($key,$val) = each ($_POST)) { echo "\$$key = $val"; echo "<br>"; }
  19. It's the actual white spaces between words, unfortunately. It does seem to remove linebreaks too though, but with BR tags therein, I think the line breaks should still show up on the user end. I tried to view it from a webmail service (which shows up completely blank) and from thunderbird, which renders the last quarter of the table or so.
  20. Are the checkbox ID's what you expect them to be? Just before this: $result = mysql_query($sql); I'd to echo $sql to see if it's what you expect it to be.
  21. When I echo $var it works great, however when I mail the $var, it removes some spaces... Content-Type: text/html; charset="windows-1256" Content-Transfer-Encoding: quoted-printable <center><tableborder="0"cellpadding="3"cellspacing="3"style="border-collapse: collapse" bordercolor="#111111" It seems to randomly remove the spaces... No space after table so it doesn't show up right in email... I do this just before inserting the data... $tabledata = nl2br($tabledata); mail($to, $subject, $tabledata, $headers); Anyone have any idea why spaces are dissapearing? Also, I tried without nl2br too... I just can't figure out where the spaces are leaving.
  22. I'm running a while statement to insert rows: i.e. { mysql_query("INSERT INTO Sprites (Sprite, SpriteID, SpriteName, SpriteImg) VALUES ('$spriteid', '$tag', '$tagname', '$firstimage')"); echo mysql_insert_id()."<br />\n"; } It echos: 136 137 138 139 140 141 141 141 141 Yet I check SQL and it's actually correct: It echos: 136 137 138 139 140 141 142 143 144 Anyone know how to fix this?
  23. I'm really not sure what AC is... Unless you're talking about Auto Column (auto-increment?)... Hopefully I'm mistaken, but doesn't Auto Increment force unique ID? Either way, I tried setting it as an auto increment to try experimenting with a non-unique auto-incrementand I was given this error #1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
  24. I need to insert a record with a specific ID, but I have to make sure it doesn't exist... How can I make sure I'm inserting a record with a new ID? It may be helpful to note that in the database the records may be duplicated- just not at this point.
  25. Never mind. Didn't figure it out. Now it's printing something very different. It got rid of the unwanted characters, but the values are different in the array now.
×
×
  • 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.