Jump to content

Mod-Jay

Members
  • Posts

    155
  • Joined

  • Last visited

    Never

Everything posted by Mod-Jay

  1. Hello, i made a text site, so you can text from a website. i was making a database of the texted numbers and i found that the mysql line is not inserting the correct number, its going to the max php one. Here the code: if (array_key_exists($carrier, $carriers)) { $correctCarrier = $carriers[$carrier]; $i = 0; while($i < $_POST['amount']){ $i++; $formatted_number = $to.$correctCarrier; $result = ("$i of Your Messages Has been sent to the number ". $_POST['to'] . ".<br>" . mail("$formatted_number", "$subject", "$message") . ""); } mysql_query("INSERT INTO `msgssent` (`number`, `numberofmsg`, `subject`, `message`) VALUES (". $_POST['to'] .", '". $i ."', '". $subject ."', '". $message ."')") Or die(mysql_error()); Echo $result; }
  2. Well he didnt say what line and i didnt bother to look at the others, Thanks!
  3. Uhm? Someone must be seeing different because theres a ';' there
  4. The line the Error is : $result = mail("" . $formatted_number. "", "" . $subject . "", "". $message .""); In the code: if (array_key_exists($carrier, $carriers)) { $correctCarrier = $carriers[$carrier]; $i = 0; while($i < $_POST['amount']){ $i++; $formatted_number = $to.$correctCarrier $result = mail("" . $formatted_number. "", "" . $subject . "", "". $message .""); $resultmsg = "Your Message Has been sent to the number ". $formatted_number. ".<br>"; } Echo $result; Echo $resultmsg; Echo "You have Sent $_POST['amount'] Messages to the number $_POST['to']."; }
  5. Mod-Jay

    Arrays

    Okay uhm Let me explain it better, Atm im using 8 different if statements to get all the correct carriers the line "else if ($carrier == "carrier") {" is being used. I want to make it so it only uses 1 If statement.
  6. Mod-Jay

    Arrays

    Hello! i want to store data in a array (as seen in the code). Im trying to make it so that a php code search through the arrays and find the correct one. once it does it tells me. I dont know if im close, How ever this is what i have. $carrier = $_POST['carrier']; $carriers = array( array("verizon","tmobile","sprint","att","virgin","textnow","metro","unknown"), array("@vtext.com","@tomomail.net","@messaging.sprintpcs.com","@txt.att.net","@vmobl.com","@textnow.me","@mymetropcs.com","@teleflip.com") ); If ($carrier =
  7. Cleared it up. So according yo skeps, script where would i add you lines. Your script dont check is the id= is empty And about the Making sure if the notification is yours.
  8. Skep, what do the Rows mean. Pika, You confused me
  9. Lol =P, This is my Notification script for viewing a notification. Okay The lines of code should block Nulls Unfortunately it doesn't. I don't know what's wrong with it. if($_GET['id'] == null or $_GET['id'] == 0){ die("You have reached a Null Page. <a href=\"index.php\">Go back home</a>"); } Now, When its not their own I have, The following lines, It does not work efficiently. It should block them from seeing the users Notification if the $userid doesn't equal to $msgreciever. However that doesn't work either. if($userid == $msgreciever) { //The code in side it } else { echo "This Message does not Belong to you"; }
  10. Hello, I want this to Block NULLS and When its not there own. Please help. <?php if($_GET['usercp'] == 'vinbox' && $_GET['id']) { ?> <?php $id="{$_GET['id']}"; if($_GET['id'] == null or $_GET['id'] == 0){ die("You have reached a Null Page. <a href=\"index.php\">Go back home</a>"); } $view_a = mysql_query("SELECT * FROM notifications WHERE id='$id'"); while($view_b = mysql_fetch_array($view_a)){ $msgid = $view_b['id']; $msgname = $view_b['title']; $msgdate = $view_b['sent']; $msgsender = $view_b['senderid']; $msgreciever = $view_b['msgreciever']; $msgtext = $view_b['text']; $msgread = $view_b['read']; } $msgdatee = date('D, M d, Y h:i A', strtotime($msgdate)); $recieverfind = mysql_query("SELECT * FROM users WHERE id='$msgsender'"); While($recieverfound = mysql_fetch_assoc($recieverfind)) { $username = $recieverfound['username']; $userid = $recieverfound['id']; } if($userid == $msgreciever) { if($msgread <= 0){ mysql_query("UPDATE notifications SET `read`='1' WHERE `id`='".$id."'"); } ?> <div class="usercp_body"><!-- UserCP Notification Sent Start --> <div id="dash_chart" class="notifications" style="width:100%;margin: 0 auto;"> <div class="notifications-header"> <h4><center>Viewing Message: <?php echo ucfirst($msgname); ?></center></h4> </div> <div class="notifications-content" style="padding:10px 10px 10px 10px;"> <i><b>Sent From: </b></i><?php echo $username; ?><br> <i><b>Date Sent: </b></i><?php echo $msgdatee ;?><br> <i><b>Message: </b></i><br><hr><?php echo ucfirst($msgtext); ?> <br><hr><br> <i><b>Reply: </b></i><textarea> </textarea> </div></div></div><!-- UserCP Notification Sent End --> <?php } else { echo "This Message does not Belong to you"; } } Sorry for short explanation. I'm very tired
  11. Nevermind, It dont Get the username, $sendToID.
  12. Thanks, the script works flawlessly
  13. Im storing it by userid as the sender. i dont know how to set it up like that
  14. Hello , i need some help on this line. Line: $compose_a = mysql_query("SELECT * FROM users WHERE username LIKE '%". realEscape($sendto) ."%' LIMIT 1") or die(mysql_error()); From the code : <?php if(isset($_GET['usercp']) && $_GET['send'] == 'true') { if($_POST['sendtitle'] == "") { echo "You need to have a message title."; } else { if($_POST['sendto'] == "") { echo "You must enter the username of the user you wish to send a message to."; } else { if($_POST['sendtext'] == "") { echo "You have not entered anything to send"; } else { $sendto = str_replace('_', ' ' , $_POST['sendto']); $compose_a = mysql_query("SELECT * FROM users WHERE username LIKE '%". realEscape($sendto) ."%' LIMIT 1") or die(mysql_error()); if(mysql_num_rows($compose_a) >= 1) { While($compose_b = mysql_fetch_array($compose_a)) { $sendto = $compose_b['id']; } mysql_query("INSERT INTO `notifications` (ipaddress, senderid, recieverid, sent, title, text) VALUES ('". $_SERVER['REMOTE_ADDR'] ."', '". $_SESSION['id'] ."', '" . $sendto . "', NOW(), '". htmlspecialchars($_POST['sendtitle']) ."', '". htmlspecialchars($_POST['sendtext']) ."')") or die(mysql_error()); echo "Message has been sent."; } else { echo "The username you entered does not Exist"; } } } } } ?> The $sendto is a username. i want to make it so if a user puts a Uppercase letter or a lowercase letter or a space where a '_' should be. it still matchs whats in the database. if you find a better way of doing this please post it
  15. I was wrong, it didnt work. well it did but it needs to be in the loop otherwise it wont show every one
  16. I am making a script that has a Notification/Inbox system in it. Right know it's close to being done, but I have one problem.. My problem is that if a user has >= 1 message in their inbox it shows what it should, but if the user has nothing in the inbox it shows nothing instead of the simple error "You have no message in your inbox". Code 1: $inbox_a = mysql_query("SELECT * FROM notifications WHERE recieverid='". $_SESSION['id'] ."'") or die(mysql_error()); Code 2: <?php if(!mysql_num_rows($inbox_a) <= 0) { ?> <tr class="table"> <td class="name"><a href="usercp.php?usercp=inbox&id=<?php echo $msgid; ?>"><h3><?php echo ucFirst($msgname); ?></h3></td> <td class="revision"><h3><a href="#"><?php echo $msgsendername ?></a></h3></td> <td class="votes"><h3><?php echo date('D, M d, Y h:i A', strtotime($msgdate)) ?></h3></td> </tr> <?php } else { ?> <tr class="table"> <td class="name">You have no messages in your inbox.</td> <td class="revision"></td> <td class="votes"></td> </tr> <?php } ?>
  17. Its a MySQL Error, Whats line 14?
  18. Error: [sat Feb 05 20:08:08 2011] [alert] [client ::1] C:/Users/cory j/Desktop/xampp/htdocs/NoXiP/toplist/.htaccess: Invalid auth file type: j/Desktop/xampp/htdocs/NoXiP/toplist/inc/.htpasswd, referer: http://localhost/NoXIp/toplist/index.php
  19. Hello im trying to put Authentication on one of my directory and i type in the password and username and it goes to error 500 <Files members.php> AuthName "Prompt" AuthType Basic AuthUserFile /inc/.htpasswd Require valid-user </Files>
  20. Its supposed to Expand And collopse my Tables and It dont, I took out some code that does nothing to that and it stopped working.
  21. var Cookie = { get: function(name) { cookies = document.cookie; name = cookiePrefix+name+"="; cookiePos = cookies.indexOf(name); if(cookiePos != -1) { cookieStart = cookiePos+name.length; cookieEnd = cookies.indexOf(";", cookieStart); if(cookieEnd == -1) { cookieEnd = cookies.length; } return unescape(cookies.substring(cookieStart, cookieEnd)); } }, set: function(name, value, expires) { if(!expires) { expires = "; expires=Wed, 1 Jan 2020 00:00:00 GMT;" } else { expire = new Date(); expire.setTime(expire.getTime()+(expires*1000)); expires = "; expires="+expire.toGMTString(); } if(cookieDomain) { domain = "; domain="+cookieDomain; } else { domain = ""; } if(cookiePath != "") { path = cookiePath; } else { path = ""; } document.cookie = cookiePrefix+name+"="+escape(value)+"; path="+path+domain+expires; }, unset: function(name) { Cookie.set(name, 0, -1); } }; var expandables = { init: function() { expanders = $$('img.expander'); if(expanders.length > 0) { expanders.each(function(expander) { if(!expander.id) { return; } Event.observe(expander, "click", this.expandCollapse.bindAsEventListener(this)); if(NoXiP.browser == "ie") { expander.style.cursor = "hand"; } else { expander.style.cursor = "pointer"; } expander.controls = expander.id.replace("_img", ""); var row = $(expander.controls); if(row) { Event.observe(row, "dblclick", this.expandCollapse.bindAsEventListener(this)); row.controls = expander.id.replace("_img", ""); } }.bind(this)); } }, expandCollapse: function(e) { element = Event.element(e) if(!element || !element.controls) { return false; } var expandedItem = $(element.controls+"_e"); var collapsedItem = $(element.controls+"_c"); if(expandedItem && collapsedItem) { if(expandedItem.style.display == "none") { expandedItem.show(); collapsedItem.hide(); this.saveCollapsed(element.controls); } else { expandedItem.hide(); collapsedItem.show(); this.saveCollapsed(element.controls, 1); } } else if(expandedItem && !collapsedItem) { if(expandedItem.style.display == "none") { expandedItem.show(); element.src = element.src.replace("collapse_collapsed.gif", "collapse.gif"); element.alt = "[-]"; element.title = "[-]"; this.saveCollapsed(element.controls); } else { expandedItem.hide(); element.src = element.src.replace("collapse.gif", "collapse_collapsed.gif"); element.alt = "[+]"; element.title = "[+]"; this.saveCollapsed(element.controls, 1); } } return true; }, saveCollapsed: function(id, add) { var saved = new Array(); var newCollapsed = new Array(); var collapsed = Cookie.get("collapsed"); if(collapsed) { saved = collapsed.split("|"); saved.each(function(item) { if(item != id && item != "") { newCollapsed[newCollapsed.length] = item; } }); } if(add == 1) { newCollapsed[newCollapsed.length] = id; } Cookie.set("collapsed", newCollapsed.join("|")); } }; I cannot figure out whats wrong with it. Please take a look.
  22. I was on a proxy and it didnt detect it, idk why. if(!empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_SERVER['HTTP_X_FORWARDED']) || !empty($_SERVER['HTTP_FORWARDED_FOR']) || empty($_SERVER['HTTP_CONNECTION']) || $hostaddr == "." || stripos($hostaddr, "tor-exit") || !empty($_SERVER['HTTP_VIA']) || empty($_SERVER['HTTP_ACCEPT_ENCODING']) || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554)) ) { die('on Proxy');
×
×
  • 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.