Jump to content

ThunderAI

Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by ThunderAI

  1. depending on what the iframe is used for an AJAX repopulation of the innerhtml may be a better solution.
  2. I have an include file and a php file in different directories and I can't figure out what I'm doing wrong trying to get them to relate to one another. webhost/website/includes/include.inc webhost/website/modules/module/page.php How do I get the page.php to use the include.inc file? I'd think it would be "../../include.inc", but that isn't working
  3. I have the following code: $str = ($stringcontents[$step+38]); $str1 = ord($str); $bgcolor = convertchar($str1); ?> <td bgcolor='<?php echo $bgcolor;?>'> <span title='<?php echo $fieldname;?>' style='color: <?php echo $fgcolor;?>; font-size: 12pt'><font color="<?php echo $fgcolor;?>"><?php echo $stringcontents[$step];?></font></span> the convertchar function takes the ord value of the ASCII chr and sets a variable for bgcolor and fgcolor using HTML color codes. The background sets correctly, but the foreground ASCII chr is always black and does not use the font color code. What do I need to do to get the ASCII chr to change to a color other than black? Added: I am using a default charset: <META http-equiv="Content-Type" content="text/html; charset=IBM437">
  4. I am trying to make a PHP script that will read the linked file. It essentially is a map array using ASCII charactor codes. It has a 23 offset initial line for the name of the map, and then 76 offset for each row of the map. Half the 76 is for the actual map displaied ASCII chr and the other half for the color. I would think it would be fairly easy to do, but I can't seem to get the code to work. http://cid-b676d7f6bbd68862.office.live.com/self.aspx/.Public/file.map Anyone have some puesdo code to help me out.
  5. I am sure its not the best way of doing what I need to do; however, because of how dynamic this SQL statement has to be i dont know another way of doing it. If there was I'd gladly do it, if i knew how.
  6. I found some odd syntax in there, some of the ' dont have the leading \
  7. <?php SQL = SELECT * FROM tbl_nofly_add_list WHERE ( `ruat_tsa_last_name` LIKE CONVERT( _utf8 '%O\'Dahl%' USING latin1 ) COLLATE latin1_swedish_ci AND `ruat_tsa_first_name` LIKE CONVERT( _utf8 '%Erick%' USING latin1 ) COLLATE latin1_swedish_ci ) OR ( `ruat_tsa_first_name` LIKE CONVERT( _utf8 '%O\'Dahl%' USING latin1 ) COLLATE latin1_swedish_ci AND `ruat_tsa_last_name` LIKE CONVERT( _utf8 '%Erick%' USING latin1 ) COLLATE latin1_swedish_ci ) OR ( `ruat_tsa_first_name` LIKE CONVERT( _utf8 '%Erick%' USING latin1 ) COLLATE latin1_swedish_ci AND `ruat_tsa_last_name` LIKE CONVERT( _utf8 '%O\'Dahl%' USING latin1 ) COLLATE latin1_swedish_ci ) OR ( `ruat_tsa_first_name` LIKE CONVERT( _utf8 '%Erick%' USING latin1 ) COLLATE latin1_swedish_ci AND `ruat_tsa_last_name` LIKE CONVERT( _utf8 '%O'Dahl % ' USING latin1) COLLATE latin1_swedish_ci ) OR (`ruat_tsa_last_name` LIKE CONVERT(_utf8 ' % Alan O \ 'Dahl%' USING latin1 ) COLLATE latin1_swedish_ci OR `ruat_tsa_first_name` LIKE CONVERT( _utf8 '%Erick Alan%' USING latin1 ) COLLATE latin1_swedish_ci ) OR ( `ruat_tsa_first_name` LIKE CONVERT( _utf8 '%Erick Alan%' USING latin1 ) COLLATE latin1_swedish_ci OR `ruat_tsa_last_name` LIKE CONVERT( _utf8 '%Alan O\'Dahl%' USING latin1 ) COLLATE latin1_swedish_ci ) ORDER BY ruat_tsa_sid<?php>
  8. I have echoed the query using all the different methods, but i can not seem to make it work. if i load the information right from the CSV and then into the array the ' goes right into the SQL statement and looks like `ruat_tsa_last_name` LIKE CONVERT(_utf8 '%O'Dahl%' USING latin1) COLLATE latin1_swedish_ci if I call the mysql_strip function without striping the slashes I get this: `ruat_tsa_last_name` LIKE CONVERT(_utf8 '%O\'Dahl%' USING latin1) COLLATE latin1_swedish_ci if I call the strip slashes after I do the Mysql_strip function I get the same result as the first. No where does it add a second ' in the last name
  9. <?php $tmp_last = ($arr[0]); $tmp_first = ($arr[1]); $link = mysql_connect("-----", "-----", "-----", "----"); $tmp_last = mysql_real_escape_string($tmp_last, $link); $tmp_first = mysql_real_escape_string($tmp_first, $link); ---- $nsql = '(`ruat_tsa_last_name` LIKE CONVERT(_utf8 \'%'.$tmp_last.'%\' USING latin1) COLLATE latin1_swedish_ci '; $sql = $sql.$nsql; $nsql = ' AND `ruat_tsa_first_name` LIKE CONVERT(_utf8 \'%'.$tmp_first.'%\' USING latin1) COLLATE latin1_swedish_ci ) '; $sql = $sql.$nsql;
  10. When I test for Magic Quotes the result is 1, so it is on. With it on, since I can't readily turn it off how do I proceed? ALso the SQL line that uses this variable looks like this: $nsql = '(`ruat_tsa_last_name` LIKE CONVERT(_utf8 \'%'.$tmp_last.'%\' USING latin1) COLLATE latin1_swedish_ci ';
  11. I have a few people with ' in their last names and I cant get the SQL statement to work correctly. I have tried adding slashes, but if i manually add another ' in their lastname the SQL statement works, although I cant be certian its doing what its suppose to be doing. What function should I use to parse the lastname to correct for odd chrs and correct them. I have tried: $tmp_last= addslashes($arr[0]); $tmp_first= addslashes($arr[1]); $tmp_last = mysql_real_escape_string($tmp_last, $link); $tmp_first = mysql_real_escape_string($tmp_first, $link); both do the same thing, but neither works. Ideas?
  12. I just dont know how to automate it at all. I can use while to loop through the results array but each new cycle would require an additonal connection to be made into the database. What I am thinking is this: <?php $sql = ""; $objconn_support = mysqli_connect("localhost", "webuser", "limitaces", "dahlweb"); if (mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_error()); exit(); } else { $objrs_support = mysqli_query($objconn_support, $sql); if ($objrs_support) { while ($objfields = mysqli_fetch_array($objrs_support, MYSQLI_ASSOC)) { // Cycle First Level $sql2 = "where ID is equal to this element of First Level"; $objconn_support2 = mysqli_connect("localhost", "webuser", "limitaces", "dahlweb"); if (mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_error()); exit(); } else { $objrs_support2 = mysqli_query($objconn_support, $sql2); if ($objrs_support2) { while ($objfields2 = mysqli_fetch_array($objrs_support2, MYSQLI_ASSOC)) { // Cycle Second Level $sql2 = "where ID is equal to this element of First Level"; $objconn_support3 = mysqli_connect("localhost", "webuser", "limitaces", "dahlweb"); if (mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_error()); exit(); } else { $objrs_support3 = mysqli_query($objconn_support, $sql3); if ($objrs_support3) { while ($objfields3 = mysqli_fetch_array($objrs_support3, MYSQLI_ASSOC)) { // Cycle Second Level ?> You can see how that would be too clunky to do to any serious depth like a family tree. It works for a menu system, but its not realistic for the purpose i need it for.
  13. I am trying to make a family tree application and drawing out the tree has be a little confused as to what migt be the best way to connect to the database. I have two tables, a list of people and another describing the relationships between the people. One way to do this would be to start at a certain point in the tree, create a new connection to display their childern, then create another one to display their childern, and then their childern and so forth. When all layers are done with the first found child, the cycle would start over with whatever other siblings that child had. But this process requies me to manualy create a new connection a set number of times and i dont want 15 layers of connections. Is there some way to automate this process so that one connection can start at the start point, and just continue to cycle through records until it finds so more records to display?
  14. All i mean is that the HTML file is on the server and I want the administrator to load the file be able to edit it and then save it. Loading it into a textox sounds like a good idea, how would i save it?
  15. I know there are many WYSIWYG editors out there, but what would be the best to do the following: I have a PHP script that dynamicaly loads an HTML document using the file_get_contents function. In the administration section I would like to modify that HTML file remotely. What is the best approach to do that?
  16. Here is the full select code: <?php if ($sub_select=='1') { // Display the sub folders of this catalog as a select function and not as indisual lists // TO do this we highjack the normal process and ensure a proper select statement is created // Start by creating the select statement $select = "<FORM NAME='".$r_cat[name]."' style='margin:0; padding:0'>"; $select = $select." •<select name='select' ONCHANGE='goto(this.form)' style='margin:0; padding:0'>"; $select = $select."<option value='#'>--Select ".$r_cat[name]."--</option>"; // Now loop through the information like we normaly would incerting the information into the select statement do{ //LEVEL 2 $category_style1=''; if($cid==$r_cat1[id]){ $category_style1=" id='show_this_category'"; } $mainurl = $mainURL; $flink = friendly_url($r_cat1[name]); $productid = $r_cat1[id]; $name = $r_cat1[name]; $select = $select."<option value='".$mainurl."products.php?cn=".$flink."&cid=".$productid."'>".$name."</option>"; //echo "<select>"; //echo $select; //echo "</select>"; } while($r_cat1=mysql_fetch_assoc($q_cat1)); $select = $select."</select></form>"; $categories_list = $categories_list.$select; } ?>
  17. I am getting the following error: Parse error: syntax error, unexpected T_VARIABLE xxxxxx on line 67 But I only get the error on GoDaddies server not on my own development server. It is very odd. Here is the source close to the problem area: <?php $mainurl = $mainURL; //echo "<br><br>".$mainurl."<br><br>"; $flink = friendly_url($r_cat1[name]); //echo "<br><br>".$flink."<br><br>"; $productid = $r_cat1[id]; //echo "<br><br>".$productid."<br><br>"; $name = $r_cat1[name]; //echo "<br><br>".$name."<br><br>"; $select = $select."<option value='".$mainurl."products.php?cn=".$flink."&cid=".$productid."'>".$name."</option>"; ?> Line 67 is the last line of code
  18. I have a PHP script that does some maintenance on the database that I would like to automate and I am curious what is the best way to do this. I can use windows to schdule an IE link, but how would I close the window once the procedure is done? or is there another way?
  19. Today I find a couple of odd things withthe server. 1). The share on the network drive is gone, and; 2). PHP will no longer create the Excel DOM object like it has soo many times before. As for one I have no idea what caused that, i have fixed it.. i dont understant why number is bad. I get this error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft Office Excel<br/><b>Description:</b> How can i fix this? Excel still works on the computer itself and I see no reason why it shoulnd not work edit: another interesting note. I can start Exel from the Program listings in the start menu, from the direcotry itself, but not from the shortcut that exisits on the Start menu pin on top.
  20. What do i do here. I have a parent table and a child table and I want to delete both at the same time otherwise i get a forgien key error. What is this suppose to look like? $sql = "DELETE FROM tbl_users_searchs, tbl_users_notice INNER JOIN tbl_users_notice ON tbl_users_notice.user_n_sub_id = tbl_users_searchs.user_s_id WHERE user_s_archived_yn = 1 AND user_n_archived_yn = 1";
  21. Although this wont really help you, my personal belief is NEVER pass anything in the URL....never. When i can i pass things to sessions or if i have to POSTS.
  22. So you want the person filling out the forms email address to be a set email adress all the time reguardless of where it actually came from? I'm not sure if that can be done, but you can set the subject of an email to be something like COMMENT FROM WEB - (their comment). Then all you have to do is filter out emails with the subject COMMENT FROM WEB.
  23. It should work just fine for weeks: You will have four rows for each month ID.
×
×
  • 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.