Jump to content

helloise

Members
  • Posts

    82
  • Joined

  • Last visited

Everything posted by helloise

  1. jenkins runs cibuild: ./createmysqldb test_traffic test_user password mysql -u test_user --password=password test_traffic < ./phoenix/data/sql/lib.model.schema.sql then createmysqldb: EXPECTED_ARGS=3 E_BADARGS=65 MYSQL=`which mysql` Q1="CREATE DATABASE IF NOT EXISTS $1;" Q2="GRANT ALL ON *.* TO '$2'@'localhost' IDENTIFIED BY '$3';" Q3="FLUSH PRIVILEGES;" SQL="${Q1}${Q2}${Q3}" if [ $# -ne $EXPECTED_ARGS ] then echo "Usage: $0 dbname dbuser dbpass" exit $E_BADARGS fi the console output in jenkins gives this: mysql -u test_user --password=password test_traffic < ./phoenix/data/sql/lib.model.schema.sql ERROR 1045 (28000): Access denied for user 'test_user'@'localhost' (using password: YES) why is this? i dont understand thanks
  2. i have this code: static public function getLastNewMessage($profile_id) { $c = new Criteria(); $subSelect = "rc_message_box_table.profile_id_from NOT IN ( SELECT rc_blocklist_table.profile_id_block FROM rc_blocklist_table WHERE profile_id = $profile_id ) and rc_message_box_table.profile_id_to=$profile_id and opened_once = 0"; $c->add(self::PROFILE_ID_TO, $subSelect, Criteria::CUSTOM); $c->addAsColumn("lastRow", MAX(self::ID)); //$subSelect2 = "max(rc_message_box_table.id)"; //$c->add(self::ID, $subSelect2, Criteria::CUSTOM); return self::doSelect($c); } and get this error: 500 | Internal Server Error | PropelException [wrapped: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS lastRow FROM rc_message_box_table` WHERE rc_message_box_table.profile_id_fro' at line 1] i just want the record of MAX(auto-increment-field) on the rc_message_box_table and this field is ID i have tried the commented out lines as well but nothing works. i dont know how to achieve this..please help? thank you
  3. in my getChat_xml.php: header("Content-Type: text/xml; charset=utf-8"); i did do alert(xmldoc) and it returns null i changed the responsXML to responsText and now have values for xmldoc: <?//xml version="1.0" ?><root><message id="7"><user>Me, ME, me and mE </user><text>dfhdfgdfg</text><time>11:04</time></message></root> dfgdfg yipeee now to get the values.. thanks alot
  4. i have this part of code in JS: var receiveReq = getXmlHttpRequestObject(); function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } } function getChatText() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET","getChat_xml.php?chat=1&last=7", true); receiveReq.onreadystatechange = handleReceiveChat; receiveReq.send(); } } function handleReceiveChat() { if (receiveReq.readyState == 4) { var chat_div = document.getElementById('div_chat'); var xmldoc = receiveReq.responseXML; var message_nodes = xmldoc.getElementsByTagName("message"); } } then in my getChat_xml.php i have: $xml = '<?//xml version="1.0" ?><root>'; $last = 7; $sql = "SELECT message_id, user_name, message, date_format(post_time, '%h:%i') as post_time" . " FROM message WHERE chat_id = " . db_input($_GET['chat']) . " AND message_id = " . $last; $message_query = db_query($sql); while($message_array = db_fetch_array($message_query)) { $xml .= '<message id="' . $message_array['message_id'] . '">'; $xml .= '<user>' . htmlspecialchars($message_array['user_name']) . '</user>'; $xml .= '<text>' . htmlspecialchars($message_array['message']) . '</text>'; $xml .= '<time>' . $message_array['post_time'] . '</time>'; $xml .= '</message>'; } $xml .= '</root>'; echo $xml; i get a "cannot cal a method getElementsByTagName of null" ??? i have no idea whats going on, help please? thanks
  5. thanks, the thing is i inherited the code from some-one else and when the website was first coded, no provision was made for any IE, and the client made it well known that it does NOT show properly on ie9 i will have to build in something like: <?php if ( stristr($_SERVER['HTTP_USER_AGENT'], 'MSIE 9.') ) { echo "<table class='table_format_content_rbc_IE' border='0'>"; } else { echo "<table class='table_format_content_rbc' border='0' >"; } ?>
  6. i need to check if the user is using IE9, and then build a css for it. i have no idea where to start. how do i do this please? the website was developed for viewing in chrome and FF. no provision was made for ie9.. can somebody help please? thank you
  7. i have the following: mysql> show create table rc_profile_table \G; *************************** 1. row *************************** Table: rc_profile_table Create Table: CREATE TABLE `rc_profile_table` ( `id` int(11) NOT NULL auto_increment, `created_at` datetime default NULL, `name` varchar(32) NOT NULL, `surname` varchar(32) NOT NULL, `password` varchar(128) NOT NULL, `unique_code` varchar(16) NOT NULL, `msisdn` varchar(32) NOT NULL, `current_location` varchar(64) NOT NULL, `profile_pic` varchar(255) default NULL, `email` varchar(128) NOT NULL, `age` int(11) NOT NULL, `city_of_birth` varchar(64) NOT NULL, `personality` varchar(128) NOT NULL, `country_id` int(11) NOT NULL, `religious_id` int(11) NOT NULL, `relationship_id` int(11) NOT NULL, `wants_and_needs` varchar(512) default NULL, `hopes_and_aspirations` varchar(512) default NULL, `profession` varchar(128) default NULL, `hobbies_and_interests` varchar(512) default NULL, `skills_and_talents` varchar(512) default NULL, `open_comment` varchar(512) default NULL, `food_and_drinks` varchar(512) default NULL, `activated` int(11) default NULL, `mood_updated_at` datetime default NULL, `mood_color` varchar(32) default NULL, `mood_desc` varchar(64) default NULL, `login_count` int(10) unsigned default '0', `campus_id` int(11) default NULL, PRIMARY KEY (`id`), KEY `rc_profile_table_FI_2` (`country_id`), KEY `rc_profile_table_FI_3` (`religious_id`), KEY `rc_profile_table_FI_4` (`relationship_id`), KEY `rc_profile_table_FI_5` (`campus_id`), CONSTRAINT `rc_profile_table_FK_2` FOREIGN KEY (`country_id`) REFERENCES `rc_country_table` (`id`) ON DELETE CASCADE, CONSTRAINT `rc_profile_table_FK_3` FOREIGN KEY (`religious_id`) REFERENCES `rc_religious_type_table` (`id`) ON DELETE CASCADE, CONSTRAINT `rc_profile_table_FK_4` FOREIGN KEY (`relationship_id`) REFERENCES `rc_relationship_type_table` (`id`) ON DELETE CASCADE, CONSTRAINT `rc_profile_table_FK_5` FOREIGN KEY (`campus_id`) REFERENCES `rc_campus_table` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=159 DEFAULT CHARSET=utf8 1 row in set (0.01 sec) and also: mysql> show create table rc_sent_items_table \G; *************************** 1. row *************************** Table: rc_sent_items_table Create Table: CREATE TABLE `rc_sent_items_table` ( `profile_id_from` int(11) NOT NULL, `profile_id_to` int(11) NOT NULL, `message` varchar(512) default NULL, `subject` varchar(255) default NULL, `opened_once` int(11) default NULL, `message_type_id` int(11) default NULL, `id` int(11) NOT NULL auto_increment, `created_at` datetime default NULL, PRIMARY KEY (`id`), KEY `rc_sent_items_table_FI_1` (`profile_id_from`), KEY `rc_sent_items_table_FI_2` (`profile_id_to`), KEY `rc_sent_items_table_FI_3` (`message_type_id`), CONSTRAINT `rc_sent_items_table_FK_3` FOREIGN KEY (`message_type_id`) REFERENCES `rc_message_type_table` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB AUTO_INCREMENT=159 DEFAULT CHARSET=utf8 1 row in set (0.00 sec) so when i try to do: ALTER TABLE rc_sent_items_table ADD CONSTRAINT `rc_sent_items_table_FK_1` FOREIGN KEY (`profile_id_to`) REFERENCES `rc_profile_table` (`id`) ON DELETE CASCADE; i get this error: ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`traffic2/#sql-1122_5cf`, CONSTRAINT `rc_sent_items_table_FK_1` FOREIGN KEY (`profile_id_to`) REFERENCES `rc_profile_table` (`id`) ON DELETE CASCADE) what am i doing wrong please? thank you
  8. this does not seem to work: $user = $_SESSION['id']; print_r(preg_split("/",$user); can some one help please thanks
  9. thank you so much, i finally got it to work
  10. thank you B) is the exact issue so i have altered my code like this: function showMessageArea(link, id) { document.getElementById('message_id').value = id; var message_area = document.getElementById('message_area'); //if i concatenate id here to message_area it also does not get message area to show message_area = message_area+id; message_area.parentNode.removeChild(message_area); link.parentNode.insertBefore(message_area, link.nextSibling); message_area.style.display="block"; } where id is now the correct value of the link i clicked on and the link that gets paseds is also correct : <a href="<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to; ?>" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this, '<?php echo $id_to; ?>'); return false;" > <?php echo $uniqueCode1;?><span class="pink_text"><?php echo $uniqueCode2;?></span><?php echo $uniqueCode3;?> </a> <form id="message_area" style="display:none" method="post" > <textarea name="message" rows="10" cols="20"></textarea> <input name="Submit" type="submit" value="Send"></input> <input type='hidden' name='id' id='message_id' value=""></input> </form> the last little thing now is to get the message area an submit to show because it is STILL not showing
  11. i have this code in a foreach that lists uniquecode links: <a id="<?php echo $id_to ?>" href="<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this); return false;" > <?php echo $uniqueCode1?><span class="pink_text"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?> </a> <form id="message_area" style="display:none" method="post" action="<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>"> <textarea name="message" rows="10" cols="20"></textarea> <input name="Submit" type="submit" value="Send"></input> </form> this is what i get when i view the page source : <a href="http://www-rainbowcode-mobi/messageSent.php?id=36" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this); return false;" > KUZELJA<span class="pink_text">000</span>RC </a> <form id="message_area" style="display:none" method="post" action="http://www-rainbowcode-mobi/messageSent.php?id=36"> <textarea name="message" rows="10" cols="20"></textarea> <input name="Submit" type="submit" value="Send"></input> </form> <a href="http://www-rainbowcode-mobi/messageSent.php?id=38" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this); return false;" > ALANZIM<span class="pink_text">000</span>RC </a> <form id="message_area" style="display:none" method="post" action="http://www-rainbowcode-mobi/messageSent.php?id=38"> <textarea name="message" rows="10" cols="20"></textarea> <input name="Submit" type="submit" value="Send"></input> </form> the problem is when the action fires and page goes to messageSent and i view page source again $id_to is NOT the id of the link i clicked on..it takes the first link's id regardless of which link i click on??? here the messageSent page source( i clicked on link with id 38 NOT 36): where i have a print_r($_REQUEST) and it gives: Array ( [id] => 36 [message] => bj,nbgj, [submit] => Send ) please urgent help needed... thank you
  12. 1. yes var_dump($id_to) gives correct ids for each link 2. i usually do a js call with onclick and from there do a window.location.href but this particular code is for a mobi site and the same does not work 3. no 4. ok i will post in the php thread thank you for all the help
  13. nope not in messageSent.php i have: $id_to = $_POST['id']; $message = $_POST['message']; then i do this just to see print_r($_SESSION); print_r($_POST); var_dump($_POST); var_dump($_GET); and my output on the screen then gives me: Array ( [image_width] => 200 [user_id] => 64 [user_name] => mimi ) NULL array(1) { ["id"]=> string(2) "36" } i clicked on the user with id 38 not 36 though user_id is correct(this is the id of the user SENDING the message, "id" should be the user the message is going to thus 38
  14. thank you i have done that but it is not passing the id of the user i clicked on though? it passes the wrong one and also how can i append the message please? $id_to = $user['profile_id_contact']; $has_freechat1 = $obj_clean->getFreeChatRow($id_from,$id_to); $has_freechat2 = $obj_clean->getFreeChatRow($id_to,$id_from); if ($has_freechat1 && $has_freechat2) { if (($has_freechat1['confirmed'] == 1) && ($has_freechat2['confirmed'] == 1)) { ?> <a href="#" class="charcoal_link" style="line-height: 20px;" onclick="showMessageArea(this); return false;"> <?php echo $uniqueCode1?><span class="pink_text"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?> </a> <form id="message_area" style="display:none" method="post" action="<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>"> <tr> <td colspan="2"> <input name="message" type="textarea" rows="10" cols="20" value="<?php echo $aCleanPost['message']['value']?>" /> </td> <td> <input name="Submit" type="submit" value="Send" /> </td> </tr> </form> <?php } }
  15. i have a slight problem now: i see it takes the message_area and appends this to my URL, i actually want to go/redirect to another page informing the user that his/her message was sent AND pass on the actual message and useriD to the next page??? my URL looks like this now: www.adress......./freechatcontacts.php?message=testing&Submit=Send&idTo=36 i want it to look like: www.address..../messageSent.php?message=testing&Submit=Send&idTo=36 please help? thank you
  16. absolutely perfect! thank you very much! i will read up on it thank you
  17. thank you i have it like this now my next issue is: i have a foreach loop that displays multiple links, one for each user the textarea and submit button displays is one place,regardless of the user i clicked on i would have liked it to display underneath the user i clicked on???? would this be possible? thank you
  18. thank you all i want is: if i click on the link i want the textarea and the submit button to appear so that the user can type in a message and click submit is JS then not the route to go? how can i then check if i clicked the link or not? i know my JS is not executing because i had an alert and document.write in there and not either "showed" how must i do this then please? i am still new at all this please help?
  19. i have the following code: if (($has_freechat1['confirmed'] == 1) && ($has_freechat2['confirmed'] == 1)) { $was_clicked = 0; ?> <a href="#" value="<?php echo $was_clicked; ?>" class="charcoal_link" style="line-height: 20px;" name="message" id="message" onClick="return sendMessage('<?php echo $was_clicked; ?>')"> <?php echo $uniqueCode1?><span class="pink_text"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?> </a> <?php if ($was_clicked == 1) { ?> <tr> <td><input name="password" type="textarea" rows="10" cols="20" value="<?php echo $aCleanPost['message']['value']?>" /></td> </tr> <tr> <td><br /><input name="cmdSubmit" type="submit" value="Send" /><br/> </td> </tr> <?php } } then i have my JS: <script type="text/JavaScript"> function sendMessage(val) { document.write(val); val = 1; //was clicked return val; } </script> if the link was clicked, i call my JS and set return value = 1 then i check if $was_clicked ==1 if it is i display textarea and a submit button my js is not executing can some one help please? thank you
  20. in my MySql database i have a field "created_at" = now() for ex: 2011-05-23 11:47:28 i need to add two hours to that so i have 2011-05-23 13:47:28 how will i do this please? i have this so far but it is not correct: $currentTime = time($msg->getCreatedAt()); $timeAfterOneHour = $currentTime+60*60; $date=date("Y-m-d H:i:s",$timeAfterOneHour); please help thank you
  21. i have this line of code: <a href="#" id="profilelink" name="profilelink" value="<?php echo $id."/".$block_record;?>" onClick="return viewornot(<?php echo $id; ?>)"><?php echo $uniqueCode; ?></a> so with the onclick i want to pass the id concatenated with a blocked id to my JS: function viewornot() { var val = document.getElementById('profilelink'); var e = confirm('Do you want to view this profile?'); if (e == true) { //for live site window.location.href = "http://www.rainbowcode.net/index.php/profiles/showprofilepersonal?id="+id; return true; } else { //if val contains a 1 then user is blocked //display a message then } return false } the line: var val = document.getElementById('profilelink'); is not giving me what i want it should contain the user id concatenated with a 1(blocked) or 0(not blocked) ($id."/".$blocked_user) can someone help me please? thank you
  22. i had a look on how to do this but it looks too complicated. all i want is to mail a small .txt as an attachment can anyone help please? i have this code: $to = "a mail adress"; $file = "/home/rainbowcode/StatsFile.txt"; $subject = "StatsFile.txt"; $email = "a mail adress"; $message = "Here is your Statsfile; for today"; $headers = "From: $email"; mail($to, $subject, $message, $headers); can anyone help me please? thanks
  23. i have this line in my code: echo '<a href="" onClick="yesnolist()">Free Chat</a>'; then at the top i have: <? php //have some php here ?> <div class="innerContainer"> <head> <script type="text/JavaScript"> function yesnolist(val) { alert("lakjsd"); var e = confirm('Do you want to send a free chat request?'); if (e == true) { window.location.href = "http://www-rainbowcode-mobi/confirmfreechat.php"; window.location('http://www-rainbowcode-mobi/confirmfreechat.php'); return true; } else return false; } </script> </head> <span class="headings2">CONTACTS</span> //and more code after this echo '<a href="" onClick="yesnolist()">Free Chat</a>'; why is it not doing my onClick()?? please help? thanks
  24. how can i do this pls? i just want to display a link "Free Chat" when i click on it, it must display a dropdown with options "yes" and "no" the link must not go anywhere yet, only when yes is selected it must go to a page i have the code: <a href="" id="link" name="link" onClick="yesnolist(1)">Free Chat</a> then i have javascript: <script type="text/JavaScript"> function yesnolist() { var e = document.getElementById("link"); var strUser1 = e.options[e.selectedIndex].value; if (strUser1 == "1") { window.location.href = "http://........."; } return strUser1; } </script> the above is not correct, can some-one help me please? thanks
×
×
  • 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.