Jump to content

blue-genie

Members
  • Posts

    69
  • Joined

  • Last visited

Profile Information

  • Gender
    Female
  • Location
    JHB, SA

blue-genie's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi. so i've googled and I found some posts about sending a whatsapp message. I'm trying to implement this for a simple notification when a service is not running. I'm not a php developer, and i'm trying to follow the bits and pieces i find online with little success. Does anyone here have a step by step example of how to achieve this using the most current whatsapp API. I've seen this update but I don't have access to a python server to exceute https://github.com/venomous0x/WhatsAPI/issues/238 any help and pointers will be greatly appreciated. tx.
  2. I'm trying to extend some code generator code. in my add function i'm adding a url in my database, and then doing a file (thumbnail) upload to that location. now i have an edit page to allow the user to change the thumbnail. so i have code to display the previous file, then some code to locate a new file. but the file is not being updated, and the code that is actually going into the database is incorrect. i've attached 2 files. I've commented random bits out to try different things, if someone can point out what I've done wrong, I'll be very grateful. thanks. newsfeed_edit_func.php newsfeed_edit.php
  3. i can get the create attachment part to work but sending it.. this is not familiar to me --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit all these -PHP-alt- are they supposed to be there? if i leave them there it complains, if i take it out no syntax errors but it says mail failed.
  4. i'm using a flash frontend, and i need help with a script that will take all the files in a folder (up to 6) and mail it to someone. i can do it as a zip or not. can anyone help please.
  5. I'm doing a flash app where i save webcam images to a folder on the server. I'm able to make this work when running of xampp on my machine, I create the required folder structure and I'm able to read from that folder and display the images, however once i move the stuff onto a live server, it fails to create the folders and it seems to be a permission problem. Is it server specific? i've tried chmod etc but I don't think i'm doing it right. any help, pointers for a non php developer would be most helpful. here's my code snippet <?php //This project is done by vamapaull: http://blog.vamapaull.com/ //The php code is done with some help from Mihai Bojin: http://www.mihaibojin.com/ $uid = $_GET[uid]; $structure = './images/' . date("Ymd") .'/' . $uid. '/'; // To create the nested structure, the $recursive parameter // to mkdir() must be specified. if(is_dir($structure)) { echo "Exists!"; } else { echo "Doesn't exist" ; if (!mkdir($structure,'0777', true) ) { die('Failed to create folders...'); } } if(isset($GLOBALS["HTTP_RAW_POST_DATA"])){ $jpg = $GLOBALS["HTTP_RAW_POST_DATA"]; $img = $_GET["img"]; $filename = 'images/' . date("Ymd"). "/" .$uid. "/img_". mktime(). ".jpg"; file_put_contents($filename, $jpg); } else{ echo "Encoded JPEG information not received."; } ?>
  6. I have to merge some existing asp files with some php files and run them on IIS. I'm installing on IIS6 on Windows 2003. i need my asp files and the php to work. What i'm hoping to do is from my aspx page create a link to my php page and have that do its thing. but its not working. I don't know how to get errors to show etc or where to get debug messages from but I'm getting "the specified module could not be found.." thanks.
  7. Hi phpchamp. thanks for that. makes sense but why is the update not actually happening? anything jump out at you?i'm not getting any errors but the update is just not happening with the variables i've passed through.
  8. it is affecting 0 rows but i'm trying to figure out why. the variables exist (have echo'd to check) and if i hard code the values in there they work.
  9. i keep getting the problem message. function update(){ $result2 = mysql_query("UPDATE gamedetails SET gameName = '".$newGameName."', startDate = '".$newStart."', endDate = '".$newEnd."', turnsPerDay = '".$newTurnsPerDay."', numAttempts = '".$newNumAttempts."', gameIsActive = '".$newActiveState."' WHERE gameID = ".$editGameID); if(mysql_affected_rows() <> 1){ echo "There is a problem with update"; } else { echo '<?xml version="1.0"?>'; echo '<dataxml>'; echo '<row type="success">'; echo "<resMsg>Updated.</resMsg>"; echo "</row>"; echo '</dataxml>'; } }
  10. I've been at this for a couple of hours now and I'm not winning. i have a table with gameID and startDate and endDate (the date fields are date type) i'm trying to edit a game. but when i edit it i need to check the new start and end dates that it doesn't conflict with any other existing games, ie. on any given day only 1 game instance can exist. i'm not a php developer but the next best thing we've got right now so i'm really struggling with this. could someone please help. <?php session_start(); include 'config.php'; include 'opendb.php'; $newGameName = $_REQUEST['newGameName']; $newStartDate = $_REQUEST['newStartDate']; $newEndDate = $_REQUEST['newEndDate']; $newTurnsPerDay = $_REQUEST['newTurnsPerDay']; $newActiveState = $_REQUEST['newActiveState']; $newNumAttempts = $_REQUEST['newNumAttempts']; $editGameID = $_REQUEST['editGameID']; // $result = mysql_query("select count(*) as count FROM gamedetails WHERE gameID <> ".$editGameID." AND startDate<=Date('$newStartDate') AND endDate>=DATE('$newStartDate') OR startDate<=DATE('$newEndDate') AND endDate>=DATE('$newEndDate')"); $result = mysql_query("select count(*) as count FROM gamedetails WHERE gameID <> ".$editGameID." AND date('$newStartDate') BETWEEN startDate AND endDate OR date('$newEndDate') BETWEEN startDate AND endDate"); $num_rows = 0; //'2010-5-26' BETWEEN startDate AND endDate //$result = mysql_query("select count(*) as count FROM gamedetails WHERE gameID <> '".$editGameID."' AND startDate<=Date('$newStartDate') AND endDate>=DATE('$newStartDate') AND startDate<=DATE('$newEndDate') AND endDate>=DATE('$newEndDate')"); $row = mysql_fetch_array($result, MYSQL_ASSOC); $num_rows = $row[count]; if ($num_rows > 0) { echo '<?xml version="1.0"?>'; echo '<dataxml>'; echo '<row type="error">'; echo "<errorMsg>Cannot update game: ".$newGameName." \nThe new dates conflict with an existing game.</errorMsg>"; echo "</row>"; echo '</dataxml>'; } else { $result2 = mysql_query("UPDATE gamedetails SET gameName = '".$newGameName."', startDate = '".$newStartDate."', endDate = '".$newEndDate."', turnsPerDay = ".$newTurnsPerDay.", numAttempts =".$newNumAttempts.", gameIsActive = '".$newActiveState."' WHERE gameID = '".$editGameID."'"); echo '<?xml version="1.0"?>'; echo '<dataxml>'; echo '<row type="success">'; echo '<result>success</result>'; echo '</row>'; echo '</dataxml>'; } ?>
  11. i found the problem (bar the typos) but I don't understand why. when i hard coded the values as strings it worked but when i ran it through the browser with querystring or via flash it didn't work because I was casting the values in flash as Numbers - in the database they were varchars. changed them to strings in flash and bobs my uncle it works - strange! any thoughts?
  12. I managed to change it to now throw an error anymore $result = mysql_query("SELECT COUNT(*) as count FROM gamestats WHERE statsGameID = '".$gameid."' AND statsPlayerID = '".playerid."'") or die ('Error: '.mysql_error ()); what is odd though is that if I hard code my variables into this query it returns 2 but if i use my variables as above it returns 0. i am highly confused. (not a php developer - do flash but am trying to fix this)
  13. i've been using request all along. someone told me to use request (cant' remember why) just tried changing it to GET - same error
  14. here's my select statement SELECT COUNT(*) as count FROM gamestats WHERE statsPlayerID=1 AND statsGameID = 119 if i run this in the sql window of xampp returns 2 - which is correct then i try do this <?php session_start(); include 'config.php'; include 'opendb.php'; $playerid = $_REQUEST['pID']; $gameid = $_REQUEST['gID']; //"SELECT COUNT(*) as played FROM gamestats WHERE statsPlayerID = '".$player."' AND gamestats.statsGameID = '".$gameid."'")) { $result = mysql_query("SELECT COUNT(*) as count FROM gamestats WHERE statsPlayerID=".$playeridID." AND statsGameID = '".$gameid."'") or die ('Error: '.mysql_error ()); $row = mysql_fetch_array($result,MYSQL_ASSOC); echo $row[count]; ?> and the result is Error: 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 'AND statsGameID = ''' at line 1
  15. ah the magic word is between - 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.