Jump to content

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. I am trying to insert multiple rows to a column in mysql like this: INSERT INTO `sportsapp`.`exercises` (`id`, `image_path`, `name`, `category`) VALUES ('3', 'exercises/biceps/barbell_curls_lying_against_an_incline.jpg', 'Barbell Curls Lying Against An Incline', 'Biceps'), ('4','exercises/biceps/cable_hammer_curls_-_rope_attachment','Cable hammer Curls - Rope Attachment','Biceps'); I am getting an error in return: I tried to google and understand what's the reason for it, but I dont get it. I do have already a primary key, and I don't know why it generates another primary key, Could you please try to help with this?
  2. Hi I'm trying to use my countdown timer to do a certain action when time is reach in this example I want to point users to another page, but seems like I'm going wrong somewhere along the way. When it reaches 0 it just starts counting up from 0 <html> <?php define('TIMEZONE', 'Africa/Harare'); date_default_timezone_set(TIMEZONE); $targetDate = new DateTime('2016-09-29 23:00:00'); $remaining = $targetDate->diff(new DateTime()); // not done if( $remaining > 0 ) { echo $remaining->format('%a D - %H:%I:%S'); //--> 86 D - 19:44:24 } // done else { header("Location: testlogin.php"); exit(); } ?> </html>
  3. i have a student register for attendance, down the side will be their names, across the top i will be showing each single day (example tuesday) from three month date range currently the code just echoes out all the Tuesdays as an array from the three month date range. i need to be able to use the individual date to add them to the database based on weather they student has attended. i know how to do this i just need to know how i can use the dates individually. function getDatesFromRange($start, $end) { $interval = new DateInterval('P1D'); $realEnd = new DateTime($end); $realEnd->add($interval); $period = new DatePeriod( new DateTime($start), $interval, $realEnd ); foreach($period as $date) { $array[] = $date->format('Y-m-d'); } return $array; } // Call the function $dates = getDatesFromRange('2016-04-01', '2016-07-01'); // Print the output print_r($dates);
  4. Hi everyone, I'm new here and i'm also new with coding in PHP. I have written one Restful Api based on one tutorial and i need Restful Api for connecting my Android application to server. I need some help with making this to work. I need to update user details. This is the code i'm using: class DbHandler { public function updateUser($id, $name) { $stmt = $this->conn->prepare("UPDATE users SET name = ? WHERE id = ?"); $stmt->bind_param("is", $id, $name); $stmt->execute(); $num_affected_rows = $stmt->affected_rows; $stmt->close(); return $num_affected_rows > 0; } } This is preparation statement for updating a existing user. Now here is a fragment of code from index.php where i'm calling all methods: $app->put('/user/:id', 'authenticate', function($id) use($app) { verifyRequiredParams(array('name')); global $id; $name = $app->request->put('name'); $db = new DbHandler(); $response = array(); $result = $db->updateUser($id, $name); if ($result) { $response["error"] = false; $response["message"] = "User updated successfully"; } else { $response["error"] = true; $resopnse["message"] = "User failed to update. Please try again"; } echoRespnse(200, $response); }); When i try to send request, i'm getting only this: { "error": true } Any help would be appreciated. Thanks.
  5. Hello guys! I have literally started learning how to code. And I have come to the point when I got to deal with elseif syntax which is not working properly and messes up everything I have done so far. Here's the script $password = "tulip"; if ($password == "tulip") { echo '<b>Hello!</b><br> Welcome to the website Blaise!'; } else { echo '<b> The password or login is incorrect <br> Please try again </b>'; } elseif ( $password == "daisy") { echo '<b> Welcome Kate! </b>; } When I type in "daisy" nothing goes on and everything just gets stuck. Any help or explanation? Thanks
  6. When you upload a file I am trying to display it in a HTML table in one column and then transform it into another file in another column automatically so you only need to upload one file instead of two. I can transform it into the same format but I don't know how to convert it to the other format when you have uploaded it. The code below transforms the XML file and displays it into the table once you have uploaded a file. This is a link to the page so you can see what it does. http://projectassignment.esy.es/project%20Assignment/test3.php The other link to the other transformed xml page is this. http://projectassignment.esy.es/project%20Assignment/cgx2.php <?php error_reporting(1); $dom = new DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; $dom->preserveWhiteSpace = false; $name = $_FILES['file']['name']; $dom->load($name); //$cogxml = simplexml_load_file($name); $extension = strtolower(substr($name, strpos($name, '.') + 1)); #$size = $_FILES['file']['size']; # $type = $_FILES['file']['type']; $tmp_name = $_FILES['file']['tmp_name']; if (isset($name)) { if (!empty($name)) { if (($extension == 'cogxml' || $extension == 'cgx')) { $location = ''; if (move_uploaded_file($tmp_name, $location . $name)) { echo 'uploaded'; } else { echo 'There was an error'; } } else { echo 'File must be cogxml or cgx.'; } } } $newdom = new DOMDocument('1.0', 'utf-8'); $newdom->formatOutput = true; $newdom->preserveWhiteSpace = false; $xpath = new DOMXPath($dom); ?> <html> <head></head> <body> <form action="test3.php" method="POST" enctype="multipart/form-data"> <input type="file" name="file" multiple><br><br> <input type="submit" value="Upload"> </form> <table border=1> <tr><th width='5%'>Concept Name</th><th width='5%'>Relation Type</th><th width='44%'>CoGui XML</th><th width='46%'>CharGer XML</th></tr> <?php foreach ($dom->getElementsByTagName("ctype") as $ctype) { ?> <tr><td> <?php echo $ctype->getAttribute('label') ?></td><td></td> <?php $newdom->loadXML("<cogxml><support><conceptTypes /><relationTypes /></support></cogxml>"); $newnode = $newdom->importNode($ctype, true); $newdom->getElementsByTagName("conceptTypes")->item(0)->appendChild($newnode); $id = $ctype->getAttribute('id'); foreach ($xpath->query("//cogxml/support/conceptTypes/order[@id1='$id']") as $order) { $newnode = $newdom->importNode($order, true); $newdom->getElementsByTagName("conceptTypes")->item(0)->appendChild($newnode); } foreach ($xpath->query("//cogxml/support/relationTypes/rtype[contains(@idSignature, '$id')]") as $rtype) { $newnode = $newdom->importNode($rtype, true); $newdom->getElementsByTagName("relationTypes")->item(0)->appendChild($newnode); } ?> <td><xmp><?php echo $newdom->saveXML(); ?> </xmp></td><td></td></tr><?php } ?> </table> </body> </html> $name is the file you upload. An example file is this. <?xml version="1.0" encoding="UTF-8" standalone="no"?> <cogxml> <namespace name="http://www.lirmm.fr/cogui#" prefix=""/> <support name="vocabulary"> <conceptTypes> <ctype id="http://www.lirmm.fr/cogui#ct_043ea910-5f86-4150-b0f1-1418acf4db39" label="Junior Employee" x="250" y="10"> <translation descr="" label="Junior Employee" lang="en"/> </ctype> <ctype id="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" label="Employee" x="130" y="60"> <translation descr="" label="Employee" lang="en"/> </ctype> <ctype id="http://www.lirmm.fr/cogui#ct_feeca670-2f1c-433e-9271-4cffeda1e929" label="Director" x="250" y="110"> <translation descr="" label="Director" lang="en"/> </ctype> <ctype id="http://www.lirmm.fr/cogui#ct_710bed80-a33e-4a13-b916-15fbb3357e8d" label="Manager" x="250" y="60"> <translation descr="" label="Manager" lang="en"/> </ctype> <ctype id="http://www.lirmm.fr/cogui#ct_cd84c648-ef22-4854-8e8c-a6654c0386be" label="Senior Employee" x="255" y="190"> <translation descr="" label="Senior Employee" lang="en"/> </ctype> <ctype id="http://www.lirmm.fr/cogui#_ct_a12bacc5-bc88-429e-a7b1-45e143591288" label="Top" x="10" y="60"> <translation descr="" label="Top" lang="en"/> </ctype> <order id1="http://www.lirmm.fr/cogui#ct_cd84c648-ef22-4854-8e8c-a6654c0386be" id2="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00"/> <order id1="http://www.lirmm.fr/cogui#ct_feeca670-2f1c-433e-9271-4cffeda1e929" id2="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00"/> <order id1="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" id2="http://www.lirmm.fr/cogui#_ct_a12bacc5-bc88-429e-a7b1-45e143591288"/> <order id1="http://www.lirmm.fr/cogui#ct_043ea910-5f86-4150-b0f1-1418acf4db39" id2="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00"/> <order id1="http://www.lirmm.fr/cogui#ct_710bed80-a33e-4a13-b916-15fbb3357e8d" id2="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00"/> </conceptTypes> <relationTypes> <rtype id="http://www.lirmm.fr/cogui#_rt_c42a5ce6-2f20-491d-8c91-501ae178a36c" idSignature="http://www.lirmm.fr/cogui#_ct_a12bacc5-bc88-429e-a7b1-45e143591288 http://www.lirmm.fr/cogui#_ct_a12bacc5-bc88-429e-a7b1-45e143591288" label="Link" x="10.0" y="10.0"> <translation descr="" label="Link" lang="en"/> </rtype> <rtype id="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" idSignature="http://www.lirmm.fr/cogui#_ct_a12bacc5-bc88-429e-a7b1-45e143591288 http://www.lirmm.fr/cogui#_ct_a12bacc5-bc88-429e-a7b1-45e143591288" label="senior" x="70.0" y="10.0"> <translation descr="" label="senior" lang="en"/> </rtype> <order id1="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" id2="http://www.lirmm.fr/cogui#_rt_c42a5ce6-2f20-491d-8c91-501ae178a36c"/> </relationTypes> <nestingTypes> <ntype id="http://www.lirmm.fr/cogui#_nt_4d626655-02b5-496e-b19c-f4cdb72ee70a" label="Nesting"> <translation descr="" label="Nesting" lang="en"/> </ntype> </nestingTypes> <conformity> <marker id="http://www.lirmm.fr/cogui#i_435d513c-1b39-43b1-9b6d-310fa0ee46d3" idType="http://www.lirmm.fr/cogui#ct_710bed80-a33e-4a13-b916-15fbb3357e8d" label="Lucy"/> <marker id="http://www.lirmm.fr/cogui#i_80311575-7d72-4af7-bdbe-a19c4bbcf248" idType="http://www.lirmm.fr/cogui#ct_cd84c648-ef22-4854-8e8c-a6654c0386be" label="Simon"/> <marker id="http://www.lirmm.fr/cogui#i_d1a8babc-3d35-4580-b4d5-d3cd4c323c98" idType="http://www.lirmm.fr/cogui#ct_043ea910-5f86-4150-b0f1-1418acf4db39" label="Robyn"/> <marker id="http://www.lirmm.fr/cogui#i_efbef15b-d6e2-4c0a-8155-ecaae75cc673" idType="http://www.lirmm.fr/cogui#ct_feeca670-2f1c-433e-9271-4cffeda1e929" label="Richard"/> </conformity> <modules/> </support> <localeTypes name="undefined_vocabulary"> <conceptTypes/> <relationTypes/> <nestingTypes/> <conformity/> <modules/> </localeTypes> <graph id="_g1" label="seniorities" nature="fact" set="default_set"> <concept id="c_f55e1936-7842-4518-b460-bb34a9000871" idMarker="http://www.lirmm.fr/cogui#i_d1a8babc-3d35-4580-b4d5-d3cd4c323c98" idType="http://www.lirmm.fr/cogui#ct_043ea910-5f86-4150-b0f1-1418acf4db39" referent="individual" x="0" y="0"/> <concept id="c_f081c276-57ff-4650-94ec-6e40dfd38023" idMarker="http://www.lirmm.fr/cogui#i_80311575-7d72-4af7-bdbe-a19c4bbcf248" idType="http://www.lirmm.fr/cogui#ct_cd84c648-ef22-4854-8e8c-a6654c0386be" referent="individual" x="185" y="70"/> <concept id="c_f0229ed1-c913-4373-af9c-361a90a56e90" idMarker="http://www.lirmm.fr/cogui#i_435d513c-1b39-43b1-9b6d-310fa0ee46d3" idType="http://www.lirmm.fr/cogui#ct_710bed80-a33e-4a13-b916-15fbb3357e8d" referent="individual" x="330" y="170"/> <concept id="c_dbe5b7cb-7d00-44f1-8b9a-832d5b61a126" idMarker="http://www.lirmm.fr/cogui#i_efbef15b-d6e2-4c0a-8155-ecaae75cc673" idType="http://www.lirmm.fr/cogui#ct_feeca670-2f1c-433e-9271-4cffeda1e929" referent="individual" x="445" y="260"/> <relation id="r_10008dd3-5426-4c87-8651-049045f98376" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="90" y="70"/> <relation id="r_8ef0b4bf-3cb6-4dde-9c83-903cb459872a" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="235" y="135"/> <relation id="r_563d1804-04eb-45d4-81c9-f4bd4782e0b1" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="355" y="260"/> <edge cid="c_f55e1936-7842-4518-b460-bb34a9000871" label="1" rid="r_10008dd3-5426-4c87-8651-049045f98376"/> <edge cid="c_f081c276-57ff-4650-94ec-6e40dfd38023" label="2" rid="r_10008dd3-5426-4c87-8651-049045f98376"/> <edge cid="c_f081c276-57ff-4650-94ec-6e40dfd38023" label="1" rid="r_8ef0b4bf-3cb6-4dde-9c83-903cb459872a"/> <edge cid="c_f0229ed1-c913-4373-af9c-361a90a56e90" label="2" rid="r_8ef0b4bf-3cb6-4dde-9c83-903cb459872a"/> <edge cid="c_f0229ed1-c913-4373-af9c-361a90a56e90" label="1" rid="r_563d1804-04eb-45d4-81c9-f4bd4782e0b1"/> <edge cid="c_dbe5b7cb-7d00-44f1-8b9a-832d5b61a126" label="2" rid="r_563d1804-04eb-45d4-81c9-f4bd4782e0b1"/> </graph> <graph id="_query1" label="Richard senior to Robyn" nature="query" set="default_set"> <concept id="c_90dc1159-1d02-4707-a444-2e95817d8667" idMarker="http://www.lirmm.fr/cogui#i_d1a8babc-3d35-4580-b4d5-d3cd4c323c98" idType="http://www.lirmm.fr/cogui#ct_043ea910-5f86-4150-b0f1-1418acf4db39" referent="individual" x="30" y="165"/> <concept id="c_4af4cf1c-5383-413b-bee2-7a4c513fd37e" idMarker="http://www.lirmm.fr/cogui#i_efbef15b-d6e2-4c0a-8155-ecaae75cc673" idType="http://www.lirmm.fr/cogui#ct_feeca670-2f1c-433e-9271-4cffeda1e929" referent="individual" x="45" y="25"/> <relation id="r_c51c5a9c-3cf5-4402-a356-03c9882f6b78" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="75" y="95"/> <edge cid="c_90dc1159-1d02-4707-a444-2e95817d8667" label="1" rid="r_c51c5a9c-3cf5-4402-a356-03c9882f6b78"/> <edge cid="c_4af4cf1c-5383-413b-bee2-7a4c513fd37e" label="2" rid="r_c51c5a9c-3cf5-4402-a356-03c9882f6b78"/> </graph> <rule id="_rule1"> <hypt> <graph id="_rule1_hypt" label="seniority rule" nature="rule" set="default_set"> <concept id="c_591883b6-ca82-42ee-bd35-b4ce29ffd286" idType="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" x="30" y="45"/> <concept id="c_f765dff9-1cd4-42f1-bf95-87cbda00257d" idType="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" x="30" y="173"/> <concept id="c_669f89c9-eb93-4caa-aa90-f8e31be92245" idType="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" x="30" y="293"/> <relation id="r_93ecba23-873d-490c-8ce3-40611158006b" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="45" y="113"/> <relation id="r_257f3815-2ac4-4b9e-8b8c-7d9ae6259b52" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="53" y="233"/> <edge cid="c_591883b6-ca82-42ee-bd35-b4ce29ffd286" label="1" rid="r_93ecba23-873d-490c-8ce3-40611158006b"/> <edge cid="c_f765dff9-1cd4-42f1-bf95-87cbda00257d" label="2" rid="r_93ecba23-873d-490c-8ce3-40611158006b"/> <edge cid="c_f765dff9-1cd4-42f1-bf95-87cbda00257d" label="1" rid="r_257f3815-2ac4-4b9e-8b8c-7d9ae6259b52"/> <edge cid="c_669f89c9-eb93-4caa-aa90-f8e31be92245" label="2" rid="r_257f3815-2ac4-4b9e-8b8c-7d9ae6259b52"/> </graph> </hypt> <conc> <graph id="_rule1_conc"> <concept id="c_fe469224-c26a-49dc-a17a-697faa20aca3" idType="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" x="173" y="53"/> <concept id="c_656473af-5b41-4ed7-b4fc-be3af9ce544d" idType="http://www.lirmm.fr/cogui#ct_d7a78641-722f-4609-8f5a-90affc111e00" x="180" y="293"/> <relation id="r_3b36e657-bc62-4050-baad-c3a04ade3af2" idType="http://www.lirmm.fr/cogui#rt_af40394c-9e62-4e92-b05b-352de5db876f" x="203" y="158"/> <edge cid="c_fe469224-c26a-49dc-a17a-697faa20aca3" label="1" rid="r_3b36e657-bc62-4050-baad-c3a04ade3af2"/> <edge cid="c_656473af-5b41-4ed7-b4fc-be3af9ce544d" label="2" rid="r_3b36e657-bc62-4050-baad-c3a04ade3af2"/> </graph> </conc> <conPts> <couple idC1="c_591883b6-ca82-42ee-bd35-b4ce29ffd286" idC2="c_fe469224-c26a-49dc-a17a-697faa20aca3"/> <couple idC1="c_669f89c9-eb93-4caa-aa90-f8e31be92245" idC2="c_656473af-5b41-4ed7-b4fc-be3af9ce544d"/> </conPts> </rule> </cogxml> The other transformed php file looks like this. <?php error_reporting(1); $dom = new DOMDocument('1.0', 'utf-8'); $dom->formatOutput = true; $dom->preserveWhiteSpace = false; $name = $_FILES['file']['name']; $dom->load($name); $extension = strtolower(substr($name, strpos($name, '.') + 1)); #$size = $_FILES['file']['size']; # $type = $_FILES['file']['type']; $tmp_name = $_FILES['file']['tmp_name']; if (isset($name)) { if (!empty($name)) { if (($extension == 'cogxml' || $extension == 'cgx')) { $location = ''; if (move_uploaded_file($tmp_name, $location . $name)) { echo 'uploaded'; } else { echo 'There was an error'; } } else { echo 'File must be cogxml or cgx.'; } } } $newdom = new DOMDocument('1.0', 'utf-8'); $newdom->formatOutput = true; $newdom->preserveWhiteSpace = false; $xpath = new DOMXPath($dom); ?> <html> <head> <title>Parsing CharGer and CoGui</title> <link rel="stylesheet" type="text/css" href="myStyle.css" /> </head> <body> <form action="cgx2.php" method="POST" enctype="multipart/form-data"> <input type="file" name="file"><br><br> <input type="submit" value="Submit"> </form> <?php echo "<table border=1> <tr><th width='5%'>Concept Name</th><th width='5%'>Relation Type</th><th width='44%'>CoGui XML</th><th width='46%'>CharGer XML</th></tr>"; foreach ($dom->getElementsByTagName("concept") as $concept) { echo '<tr><td></td><td>' . $concept->getAttribute('label') . '</td><td></td>'; $newdom->loadXML("<conceptualgraph><graph><concept /><relation /></graph></conceptualgraph>"); $newnode = $newdom->importNode($concept, true); $newdom->getElementsByTagName("concept")->item(0)->appendChild($newnode); $id = $concept->getAttribute('id'); foreach ($xpath->query("//conceptualgraph/graph/relation[contains(@owner, '$id')]") as $rtype) { $newnode = $newdom->importNode($rtype, true); $newdom->getElementsByTagName("relation")->item(0)->appendChild($newnode); } echo '<td><xmp>' . $newdom->saveXML() . '</xmp></td><td></td></tr>'; } echo '</table>'; ?> </body> </html> An example of the file you upload would be this. <?xml version="1.0" encoding="UTF-8"?> <conceptualgraph editor="CharGer" version="4.1.0" created="Jan 4, 2016 12:06:58 AM" modified="Jan 4, 2016 12:36:07 AM" user="Charli" wrapLabels="false" wrapColumns="30"> <graph id="401e8946:15209f3d481:-7fd9" owner="0"> <type> <label>Proposition</label> </type> <layout> <rectangle x="5.00" y="5.00" width="1200.00" height="900.00"/> <color foreground="0,94,192" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> <relation id="401e8946:15209f3d481:-7f98" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Child Of Adult</label> </type> <layout> <rectangle x="341.00" y="114.00" width="40.00" height="24.00"/> <color foreground="0,0,0" background="255,231,100"/> <font name="SansSerif" style="1" size="12" /> </layout> </relation> <relation id="401e8946:15209f3d481:-7fcc" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Parent Of Child</label> </type> <layout> <rectangle x="172.00" y="70.00" width="40.00" height="24.00"/> <color foreground="0,0,0" background="255,231,100"/> <font name="SansSerif" style="1" size="12" /> </layout> </relation> <relation id="401e8946:15209f3d481:-7faa" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Mother Of Child</label> </type> <layout> <rectangle x="317.00" y="310.00" width="40.00" height="24.00"/> <color foreground="0,0,0" background="255,231,100"/> <font name="SansSerif" style="1" size="12" /> </layout> </relation> <relation id="401e8946:15209f3d481:-7fa0" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Gender Of Child</label> </type> <layout> <rectangle x="278.00" y="270.00" width="40.00" height="24.00"/> <color foreground="0,0,0" background="255,231,100"/> <font name="SansSerif" style="1" size="12" /> </layout> </relation> <relation id="401e8946:15209f3d481:-7fc5" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Gender of Adult</label> </type> <layout> <rectangle x="79.00" y="218.00" width="40.00" height="24.00"/> <color foreground="0,0,0" background="255,231,100"/> <font name="SansSerif" style="1" size="12" /> </layout> </relation> <concept id="401e8946:15209f3d481:-7fd4" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Girl</label> </type> <layout> <rectangle x="92.00" y="298.00" width="40.00" height="30.00"/> <color foreground="255,255,255" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> </concept> <concept id="401e8946:15209f3d481:-7fd5" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Female</label> </type> <layout> <rectangle x="358.50" y="201.00" width="49.00" height="30.00"/> <color foreground="255,255,255" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> </concept> <concept id="401e8946:15209f3d481:-7fb3" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Woman</label> </type> <layout> <rectangle x="148.00" y="262.00" width="52.00" height="30.00"/> <color foreground="255,255,255" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> </concept> <concept id="401e8946:15209f3d481:-7fd6" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Adult</label> </type> <layout> <rectangle x="162.00" y="129.00" width="40.00" height="30.00"/> <color foreground="255,255,255" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> </concept> <concept id="401e8946:15209f3d481:-7fd7" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Child</label> </type> <layout> <rectangle x="37.00" y="148.00" width="40.00" height="30.00"/> <color foreground="255,255,255" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> </concept> <concept id="401e8946:15209f3d481:-7fd8" owner="401e8946:15209f3d481:-7fd9"> <type> <label>Human</label> </type> <layout> <rectangle x="181.00" y="11.00" width="48.00" height="30.00"/> <color foreground="255,255,255" background="0,94,192"/> <font name="SansSerif" style="1" size="12" /> </layout> </concept> <arrow id="401e8946:15209f3d481:-7f96" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7f98" to="401e8946:15209f3d481:-7fbb"> <layout> <rectangle x="396.48" y="128.66" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fca" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fcc" to="401e8946:15209f3d481:-7fd8"> <layout> <rectangle x="193.77" y="53.12" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7f97" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7f9b" to="401e8946:15209f3d481:-7f98"> <layout> <rectangle x="314.23" y="169.88" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fcb" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fd6" to="401e8946:15209f3d481:-7fcc"> <layout> <rectangle x="183.48" y="106.05" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7f99" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7f9c" to="401e8946:15209f3d481:-7fd6"> <layout> <rectangle x="207.00" y="160.54" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fab" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fb0" to="401e8946:15209f3d481:-7fd8"> <layout> <rectangle x="274.59" y="47.60" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fac" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fbb" to="401e8946:15209f3d481:-7fb0"> <layout> <rectangle x="384.85" y="99.96" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fad" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fb2" to="401e8946:15209f3d481:-7fd8"> <layout> <rectangle x="235.08" y="53.19" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fae" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fd5" to="401e8946:15209f3d481:-7fb2"> <layout> <rectangle x="316.05" y="140.06" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fc2" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fc5" to="401e8946:15209f3d481:-7fd7"> <layout> <rectangle x="76.19" y="195.99" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fc3" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fd4" to="401e8946:15209f3d481:-7fc5"> <layout> <rectangle x="101.07" y="264.73" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fa1" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fa3" to="401e8946:15209f3d481:-7fd6"> <layout> <rectangle x="165.23" y="172.76" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fa2" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fb3" to="401e8946:15209f3d481:-7fa3"> <layout> <rectangle x="161.91" y="233.11" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fa4" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fa7" to="401e8946:15209f3d481:-7fbb"> <layout> <rectangle x="414.30" y="251.12" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fc7" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fc9" to="401e8946:15209f3d481:-7fd6"> <layout> <rectangle x="140.08" y="113.96" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fa5" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fc1" to="401e8946:15209f3d481:-7fa7"> <layout> <rectangle x="224.84" y="350.58" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fc8" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fd7" to="401e8946:15209f3d481:-7fc9"> <layout> <rectangle x="85.27" y="122.84" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fa8" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7faa" to="401e8946:15209f3d481:-7fd5"> <layout> <rectangle x="354.68" y="268.04" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fa9" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fd4" to="401e8946:15209f3d481:-7faa"> <layout> <rectangle x="222.14" y="313.57" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fbc" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fbf" to="401e8946:15209f3d481:-7fd7"> <layout> <rectangle x="49.28" y="211.56" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fbd" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fc1" to="401e8946:15209f3d481:-7fbf"> <layout> <rectangle x="51.13" y="296.73" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7f9a" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7f9b" to="401e8946:15209f3d481:-7f9c"> <layout> <rectangle x="242.69" y="195.83" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7f9d" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fa0" to="401e8946:15209f3d481:-7fd5"> <layout> <rectangle x="330.90" y="249.35" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7f9e" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fb3" to="401e8946:15209f3d481:-7fa0"> <layout> <rectangle x="236.58" y="275.68" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fb4" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fb7" to="401e8946:15209f3d481:-7fd8"> <layout> <rectangle x="131.39" y="43.42" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> <arrow id="401e8946:15209f3d481:-7fb5" owner="401e8946:15209f3d481:-7fd9" label="-" from="401e8946:15209f3d481:-7fd7" to="401e8946:15209f3d481:-7fb7"> <layout> <rectangle x="62.59" y="107.31" width="8.00" height="8.00"/> <color foreground="0,0,0" background="255,255,255"/> <font name="SansSerif" style="1" size="12" /> <edge arrowHeadWidth="5" arrowHeadHeight="5" edgeThickness="1.5" /> </layout> </arrow> </graph> </conceptualgraph>
  7. Can some one help to generate a unique Doctor Appointment ID when some one save the registration form, I am trying to make online doctor appoint booking system, I want something like for each doctor, each date, it will generate a unique id, that may be something like following Dr_ID-Date-Auto increment number( DR001-03-23-2016-0001 ) If any one have better idea to generate a short and unique id, please suggest me. I am a beginner in PHP, please help me guys
  8. Hello im new to PHP and i have problems getting PHP working for my websites contac form Here the HTML form code <form action="" method="post"> <div class="form_settings"> <p><span>Name</span><input class="contact" type="text" name="your_name" value="" /></p> <p><span>Email Address</span><input class="contact" type="text" name="your_email" value="" /></p> <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="your_enquiry"></textarea></p> <p style="padding-top: 15px"><span> </span><input class="submit" type="submit" name="contact_submitted" value="submit" /></p> </div> </form> Heres the PHP code <?php $field_name = $_POST['cf_name']; $field_email = $_POST['cf_email']; $field_message = $_POST['cf_message']; $mail_to = 'example@gmail.com'; $subject = 'Message from '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Message: '.$field_message; $headers = 'From: '.$field_email."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript"> alert('Sent'); window.location = 'kontakt.html'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('Error'); window.location = 'kontakt.html'; </script> <?php } ?> I would be really thankful if someone could fix the PHP code for me and make it work with the html above.
  9. I had successfully set up and integrated a third party payment integration system on WHMCS. Inorder to Validate callback authenticity, the gateway provides a method of verifying that a callback originated from them as shown in code below: $mertid ='secretmerchantID'; $amt = '10000'; $tranxid = 'gtPay130958397220820'; $hashkey ='secretclientkey'; $hash = hash('sha512', $mertid . $tranxid . $hashkey); $url = 'https://ibank.gtbank.com/GTPayService/gettransactionstatus.xml?mertid='.$mertid.'&amount='.$amt.'&tranxid='.$tranxid.'&hash='.$hash; $xmlString = file_get_contents($url); if($xmlString === false) { echo "Response Description: GTPAY Verification service failed to open. } else { $xml = simplexml_load_string($xmlString ); var_dump($xml); } I am using the file_get_contents function to read the API response into a string, then simplexml_load_string function to Interprets the string of XML into an object with properties containing the data held within the xml string. On each successful transaction run $xml=simplexml_load_string($jString), returns FALSE. However when I call this code in a file directly in a browser on WAMP using the same transaction values, then $xml=simplexml_load_string($jString), returns the string of XML into an object as expected. Also when I place the file on a different remote host and call it in browser, it also returns the string of XML into an object. Strangely, when I place this code in a file within the WHMCS root folder and I attempt to call directly in a browser using the same successful transaction values used above, then $xml=simplexml_load_string($jString), returns FALSE again. What may be restricting this call to the Third party API call within the WHMCS install? Thanks.
  10. Hello! I hope someone can help me with an issue I'm having. Recently, I have had an issue displaying my banner on my website, which is has a .php file source. I have had any known changes to my php version (currently on 5.6, and considering to switch to 7.0); also, I am hosted through Dreamhost. If someone could look at the following code and offer any advice, I'd be greatly appreciative! My link on the design: <img src= "http://hayalkarga.com/theme/10/images/banner/banner.php" alt= "" /> The Image Code: <?php $dir = ''; $file = ''; $num = 0; $count = 0; $array = array(); $allowedExtensions = array('jpeg', 'jpe', 'jpg', 'gif', 'png', 'bmp'); mt_srand((double)microtime()*1000000); $dir = opendir('.'); while (false !== ($file = readdir($dir))) { if(!is_dir($file) && in_array(strtolower(substr(strrchr($file,'.'), 1)), $allowedExtensions)){ $array[] = $file; } } $count = count($array); $num = mt_rand(0, $count-1); if($count > 0) { $size = getimagesize($array[$num]); $stream = fopen($array[$num], 'rb'); if(is_array($size) && $stream !== false){ header('Content-type: '.$size['mime']); fpassthru($stream); exit(); } } else { echo 'Error: No Images'; } ?> I should note that the image works in my browser at http://www.hayalkarga.com/theme/10/images/banner/banner.php, but does not incorporate into the design when utilizing the link in HTML. Thank you in advance!
  11. Hello,recently, the company needed an PHP script to capture error,i try to use “set_error_handler”,but it can’t capture fatal error,like redeclare a function,then I try to change a way that use “register_shutdown_function”,but I found it that also unable to capture above mentioned errors at the end of the script. my php version is 7.0.1
  12. I feel like this should be easy but I am stuck. I am attempting to create a form that will dynamically update rows using radiobuttons selected by the user. It is a questionnaire. Next will be figuring out the best way to use pagination and update only the records displayed on that page. Thanks in advanced Assessment.php <form action="Process/Process.php" method="post"> <?php do { ?> <label><?php echo $row_Questions['Questions']; ?></label> <label> <input <?php if (!(strcmp($row_Questions['Value'],"1"))) {echo "checked=\"checked\"";} ?> type="radio" name="Value[<?php echo $row_Questions['QuestionID']; ?>]" class="icheck" data-radio="iradio_square-blue" value="1"> Strongly Disagree </label> <label> <input <?php if (!(strcmp($row_Questions['Value'],"2"))) {echo "checked=\"checked\"";} ?> type="radio" name="Value[<?php echo $row_Questions['QuestionID']; ?>]" class="icheck" data-radio="iradio_square-blue" value="2"> Disagree </label> <label> <input <?php if (!(strcmp($row_Questions['Value'],"3"))) {echo "checked=\"checked\"";} ?> type="radio" name="Value[<?php echo $row_Questions['QuestionID']; ?>]" class="icheck" data-radio="iradio_square-blue" value="3"> Neutral </label> <label> <input <?php if (!(strcmp($row_Questions['Value'],"4"))) {echo "checked=\"checked\"";} ?> type="radio" name="Value[<?php echo $row_Questions['QuestionID']; ?>]" class="icheck" data-radio="iradio_square-blue" value="4"> Agree </label> <label> <input <?php if (!(strcmp($row_Questions['Value'],"5"))) {echo "checked=\"checked\"";} ?> type="radio" name="Value[<?php echo $row_Questions['QuestionID']; ?>]" class="icheck" data-radio="iradio_square-blue" value="5"> Strongly Agree </label> <input type="hidden" name="AnswerID[]" value="<?php echo $row_Questions['AnswerID']; ?>"> <input type="hidden" name="QuestionID[]" value="<?php echo $row_Questions['QuestionID']; ?>"> <input type="hidden" name="UserID[]" value="User"> <?php } while ($row_Questions = mysql_fetch_assoc($Questions)); ?> <input type="submit" name="ValueAssessmen" value="Submit"> </form> Process.php if(isset($_POST['ValueAssessment'])) { $AnswerID = count($_POST['AnswerID']); $i = 0; while ($i < $AnswerID) { $AnswerID= $_POST['AnswerID'][$i]; $Value= $_POST['Value'][$i]; $QuestionID= $_POST['QuestionID'][$i]; $UserID= $_POST['UserID'][$i]; $query = "UPDATE answer SET Value = '$Value', QuestionID = '$QuestionID', UserID = '$UserID' WHERE AnswerID = '$AnswerID'"; mysql_query($query) or die ("Error in update query: $query"); ++$i; } }
  13. I would like to fill a combobox from my data in a table of my postgresql database. Here is my code: but I'm getting the combobox empty. <html> <body> <select> <?php $db = pg_connect('host=localhost dbname=test user=myusername password=mypassword') or die ("Could not connect to DB"); $sql = pg_query(sprintf("SELECT City FROM Cities")); while ($row = pg_fetch_assoc($sql)) { echo "<option value=$row[City]>$row[City]</option>"; } pg_close($db); ?> </select> </body> </html>
  14. I am attempting to use the croppic, http://www.jqueryrain.com/?S4PWDcPG, to modify images and want to be able to control the name of the file being produced. I also want to be able to save the name to my database. My quess is that I have to pass a variable to the img_save_to_file.php but not sure how to do that, I've tried using sessions but could not get that to work. Is there any other way that I could try but am not thinking of. A bit confused any direction would be appreciated. <?php /* * !!! THIS IS JUST AN EXAMPLE !!!, PLEASE USE ImageMagick or some other quality image processing libraries */ $imagePath = "temp/"; $allowedExts = array("gif", "jpeg", "jpg", "png", "GIF", "JPEG", "JPG", "PNG"); $temp = explode(".", $_FILES["img"]["name"]); $extension = end($temp); //Check write Access to Directory if(!is_writable($imagePath)){ $response = Array( "status" => 'error', "message" => 'Can`t upload File; no write Access' ); print json_encode($response); return; } if ( in_array($extension, $allowedExts)) { if ($_FILES["img"]["error"] > 0) { $response = array( "status" => 'error', "message" => 'ERROR Return Code: '. $_FILES["img"]["error"], ); } else { $filename = $_FILES["img"]["tmp_name"]; list($width, $height) = getimagesize( $filename ); move_uploaded_file($filename, $imagePath . $_FILES["img"]["name"]); $response = array( "status" => 'success', "url" => $imagePath.$_FILES["img"]["name"], "width" => $width, "height" => $height ); } } else { $response = array( "status" => 'error', "message" => 'something went wrong, most likely file is to large for upload. check upload_max_filesize, post_max_size and memory_limit in you php.ini', ); } print json_encode($response); ?>
  15. Hi I'm trying to run a cron here to remove profile pictures delete users delete private messages delete messages but I need some help to make my code more clean and effective <?php include("chat_code_header.php"); //// Delete profile pictures and users id older than 30 days//// $querybd = "SELECT Username, last_online, pprofilepic FROM Users2 WHERE last_online < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 30 DAY))"; $resultbd = mysql_query($querybd) or die(mysql_error()); $users = array(); while($rowbd = mysql_fetch_array($resultbd)){ if ($rowbd['Username'] != '') $users[] = $rowbd['Username']; if($rowbd['pprofilepic'] == ""){}else{ $pprofilepic = realpath($rowbd['pprofilepic']); print "\n Pictures Removed:\n" . $pprofilepic . "\n"; unlink($pprofilepic); } } $list = implode('; ', $users); if($list == ""){printf ("Nobody Removed\n");}else{ print "\n Users Removed:\n" . $list . "\n"; } printf("Users Deleted: %d\n", mysql_affected_rows()); $sqldel = "DELETE Users2, StringyChat, pm, namechanges, kicksamount, broadcast, timeban FROM Users2 LEFT JOIN StringyChat ON Users2.mxitid = StringyChat.StringyChat_ip LEFT JOIN pm ON Users2.mxitid = pm.mxitid LEFT JOIN namechanges ON Users2.mxitid = namechanges.userid LEFT JOIN kicksamount ON Users2.mxitid = kicksamount.mxitid LEFT JOIN broadcast ON Users2.mxitid = broadcast.mxitid LEFT JOIN timeban ON Users2.mxitid = timeban.mxitid WHERE Users2.last_online < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 30 DAY))"; mysql_query($sqldel) or die("Error: ".mysql_error()); //// end of removal/// //// removal of messages//// $query = "DELETE FROM StringyChat WHERE StringyChat_time < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))"; mysql_query($query); printf("Messages deleted: %d\n", mysql_affected_rows()); //// removal of private messages//// $query1 = "DELETE FROM pm WHERE time < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))"; mysql_query($query1); printf("Private Messages deleted: %d\n", mysql_affected_rows()); ?>
  16. So i made a login page, but whenever i enter right, wrong, or no password at all, it always displays wrong password. I've been trying to fix it for hours, but I just can't seem to find the error. It's like it's skipping if the password is right statement and goes straight through the else statment. <?php $connection = mysql_connect("com-db-02.student-cit.local","***","***") or die (mysql_error()); if ($connection) echo "Connection successful"; else echo "Connection failed"; $db = mysql_select_db("TEAM20") or die (mysql_error()); ?> <?php $_SESSION['customeremail'] = $_POST['user']; $_SESSION['password'] = $_POST['password']; function signIn() { session_start(); if(!empty($_POST['user'])) { $query = mysql_query("SELECT * FROM customer where customeremail = '$_POST[user]' AND password = '$_POST[password]'"); $row = mysql_fetch_array($query); if(!empty($row['customeremail']) AND !empty($row['password'])) { $_SESSION['customeremail'] = $row['customeremail']; getCustDetails(); echo "Successfully login to user profile page.."; echo "<a href=userlogin.php>Profile</a>"; } else { echo "Sorry... YOU ENTERED WRONG ID AND PASSWORD"; echo "<a href=login.html>Try Again</a>"; } } } function getCustDetails() { $queryId = mysql_query("SELECT customerID, firstname FROM Customer WHERE customeremail = '$_POST[user]'"); while($rowId = mysql_fetch_array($queryId)) { $_SESSION['customerID'] = $rowId['customerID']; $_SESSION['firstname'] = $rowId['firstname']; } echo "Code: ".$_SESSION['customerID']; echo "Name: ".$_SESSION['firstname']; } if(isset($_POST['submit'])) { signIn(); } ?>
  17. I'm trying to out put all Crelly Slider Alias's within Redux Framework Options in a Dropdown Select. I must confess i'm a novice at PHP ... I've attached the code from within Crelly Slider to show how it outputs the Alias names and i've also attached the Redux Code for the dropdown with an existing select .. I somehow need to output a list of all Crelly Alias's into 'options' => array( 'asc' => 'Ascending', 'desc' => 'Descending' ), Obviously replacing the exisiting options. Here is the full Crelly Output <?php global $wpdb; $sliders = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'crellyslider_sliders'); if(!$sliders) { echo '<div class="cs-no-sliders">'; _e('No Sliders found. Please add a new one.', 'crellyslider'); echo '</div>'; echo '<br /><br />'; } else { ?> <table class="cs-sliders-list cs-table"> <thead> <tr> <th colspan="5"><?php _e('Sliders List', 'crellyslider'); ?></th> </tr> </thead> <tbody> <tr class="cs-table-header"> <td><?php _e('ID', 'crellyslider'); ?></td> <td><?php _e('Name', 'crellyslider'); ?></td> <td><?php _e('Alias', 'crellyslider'); ?></td> <td><?php _e('Shortcode', 'crellyslider'); ?></td> <td><?php _e('Actions', 'crellyslider'); ?></td> </tr> <?php foreach($sliders as $slider) { echo '<tr>'; echo '<td>' . $slider->id . '</td>'; echo '<td><a href="?page=crellyslider&view=edit&id=' . $slider->id . '">' . $slider->name . '</a></td>'; echo '<td>' . $slider->alias . '</td>'; echo '<td>[crellyslider alias="' . $slider->alias . '"]</td>'; echo '<td> <a class="cs-edit-slider cs-button cs-button cs-is-success" href="?page=crellyslider&view=edit&id=' . $slider->id . '">' . __('Edit Slider', 'crellyslider') . '</a> <a class="cs-delete-slider cs-button cs-button cs-is-danger" href="javascript:void(0)" data-delete="' . $slider->id . '">' . __('Delete Slider', 'crellyslider') . '</a> </td>'; echo '</tr>'; } ?> </tbody> </table> <?php } ?> <br /> <a class="cs-button cs-is-primary cs-add-slider" href="?page=crellyslider&view=add"><?php _e('Add Slider', 'crellyslider'); ?></a> And my Redux Option array( 'id' => 'alias_select', 'type' => 'select', 'title' => __( 'Alias Select', 'ultra-web-admin' ), 'desc' => __( 'Select Slider Alias.', 'ultra-web-admin' ), 'options' => array( 'asc' => 'Ascending', 'desc' => 'Descending' ), 'default' => 'asc' ), I would be really grateful if anyone could assist me . Thank you !
  18. I am making a Railway Search website for University Project and i want to implement advanced Search functionality but as i am new to this field i need help from you guys please help me to create that function here i am describing : I have 3 Database with relevant fields one is Station db one is Train db and third is train timetable Db, Trains i have added using Station ID with arrival departure timings. now how can i implement search code to get In-between all trains results which user queried for example we have 5 stations A B C D E, 3 train going to A to E one is without any stopping between A to E second is stopping only C and third is stopping all. if any one have queried about A to E then all 3 trains should be displayed, if A to C queried then 2 trains should be displayed and if A to D then only one train should be displayed. Please help me to sort out this search Thanks.
  19. Hello, I'm having a bit of trouble interpolating Bootstrap HTML from database rows. It's coming out kind of right, but I have font-awesome flags popping up everywhere, and my footer doesn't stretch the entire screen. Kind of like a div isn't being closed. I'd appreciate any help offered. Every three items is a row. There are three columns per row. PHP CODE foreach($retrievedListings as $key => $val) { if($key === 0) { echo '<div class="row"> <div class="col-lg-4"> <div class="column-1"> <h4 style="color:darkblue;"><i style="color:yellow;" class="fa fa-star"></i> '.htmlentities($retrievedListings[$key]['title']).'</h4> <p>By <strong>'.$retrievedListings[$key]['username'].'</strong><br/> '.htmlentities($retrievedListings[$key]['intro']).'</p> <p class="word"><i class="fa fa-flag flag-button"></i>'; $tagsArr = explode(',', $retrievedListings[$key]['tags']); foreach($tagsArr as $tag) { echo '<span class="label label-default label-buffer"><a>'.htmlentities($tag).'</a></span>'; } echo '</p> </div> </div>'; }elseif($key % 3 != 0) { echo '<div class="col-lg-4"> <div class="column-1"> <h4 style="color:darkblue;"><i style="color:yellow;" class="fa fa-star"></i> '.htmlentities($retrievedListings[$key]['title']).'</h4> <p>By <strong>'.$retrievedListings[$key]['username'].'</strong><br/> '.$retrievedListings[$key]['intro'].'</p> <p class="word"><i class="fa fa-flag flag-button">'; $tagsArr = explode(',', $retrievedListings[$key]['tags']); foreach($tagsArr as $tag) { echo '<span class="label label-default label-buffer"><a>'.htmlentities($tag).'</a></span>'; } echo '</p> </div> </div>'; }else{ echo '</div> <div class="row"> <div class="col-lg-4"> <div class="column-1"> <h4>'.htmlentities($retrievedListings[$key]['title']).'</h4> <p>By <strong>'.$retrievedListings[$key]['username'].'</strong> <br/> '.htmlentities($retrievedListings[$key]['intro']).'</p> <p class="word"><strong>Tags :</strong> <span>One,Two,Three</span></p> </div> </div>'; } } What I'm trying to interpolate: <div class="row"> <div class="col-lg-4"> <div class="column-1"> <h4 style="color:darkblue;"><i style="color:yellow;" class="fa fa-star"></i> Lorem Ipsum</h4> <p>By <strong>Ipsum is simply</strong><br/> dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took.</p> <p class="word"><i class="fa fa-flag flag-button"></i><span class="label label-default label-buffer">playstation 4</span> <span class="label label-default label-buffer">playstation 4</span><span class="label label-default label-buffer">playstation 4</span> </p> </div> </div> <div class="col-lg-4"> <div class="column-1"> <h4 style="color:darkblue;"><i style="color:yellow;" class="fa fa-star"></i> Lorem Ipsum</h4> <p>By <strong>Ipsum is simply</strong><br/> dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took.</p> <p class="word"><i class="fa fa-flag flag-button"></i><span class="label label-default label-buffer">playstation 4</span> <span class="label label-default label-buffer">playstation 4</span><span class="label label-default label-buffer">playstation 4</span> </p> </div> </div> <div class="col-lg-4"> <div class="column-1"> <h4 style="color:darkblue;"><i style="color:yellow;" class="fa fa-star"></i> Lorem Ipsum</h4> <p>By <strong>Ipsum is simply</strong><br/> dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took.</p> <p class="word"><i class="fa fa-flag flag-button"></i><span class="label label-default label-buffer">playstation 4</span> <span class="label label-default label-buffer">playstation 4</span><span class="label label-default label-buffer">playstation 4</span> </p> </div> </div> </div> Thanks, Jeremy.
  20. Hi Mate, i need help with my mysql query.. SELECT * FROM `schedules` WHERE `clientID`=''; it doesn't select any values having an empty clientID... there are rows on my database that i need to select that has an empty clientID and using this statement does not return any value... but if i use `clientID`!='' it works fine, it returns all the data having clientID. Any help is highly appreciated. Thank you in advance. Neil
  21. I am getting this error: syntax error, unexpected '}' @extends('layouts.master') @section('scripts') <script type="text/javascript" src="{!! asset('js/status.min.js') !!}"></script> @stop @section('content') {!! csrf_field() !!} @if (count($errors) > 0) <div class="alert alert-danger"> <strong>Whoops!</strong> There were some problems with your input.<br><br> <ul> @foreach ($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> @endif <!-- Using laravel session --> @if(Session::has('message')) <!-- Checking if session has a variable called message. --> <div class="alert alert-info"> <li> {{ Session::get('message') }} </li> <!--if true -print the message from the insert_posts variable. --> </div> @endif {{-- You have a $user variable available representing the current Auth::user(); --}} <p>Hello, {{ $user->name }}.</p> {{-- This user has a profile whose properties you can also display --}} <p>Goals: {{ $user->profile->goals }}</p> {{-- You can also drill down to the profile's expectations --}} <p>Expectations</p> <ul class="profile-list"> @foreach($user->profile->expectations as $expectation) <li class="profile-list-item">{!! $expectation->name !!}</li> @endforeach </ul> <p><b> this is other users you may want to follow: </br></p> <ul> @foreach($mutuals as $mutual) <!-- hub/{{$mutual->user->id}} It goes to the user that matches the value of $mutual criteria. and then it goes and gets its id.This is sent to the controller for further handling.Check page source to see id's numbers. --> <!-- In the href - Passing the user to your controller --> <br><li><a href="{{URL::to('hub', [$mutual->user->id])}}" class="button button-3d" name="make_follow">Follow User</a> {!! $mutual->user->name; !!} <!-- I access the user's name property --> </li> @endforeach </ul> <form action="{{ route('createPost') }}" method="post"> <!--the form action is the method in a route called createPost --> @if(isset($message)) <!-- if the var exist and have a value it would be printed. It is used for all the notifications in this page.--> {{ $message }} @endif <br> <!-- only when a post has been submitted the varible value will show. --> <!-- telling the form the info go to this route (url). almost equal form action ="samePage" --> {!! Form::hidden('post') !!} {!! csrf_field() !!} <div class=contentWrap> <div class="test" placeholder="How's your fitness going?..." contenteditable="true"></div> </div> <div class=icons> <img alt="heart" src="http://icons.iconarchive.com/icons/succodesign/love-is-in-the-web/512/heart-icon.png"> </div> <button> Post to profile </button> <div class="errors"> </div> </form> <!-- script to check if user typed anything in the textbox before submit. both .text() and .html() return strings. It's testing if the string length is zero. trim is for removing whitespaces before and after a string. the 'submit' event is needed since it's a submit button. --> <div class="own_posts"> <p> here are your latest posts:</p> <!-- I think I should create foreach loop to iterate over each post and show it here. --> </div> <br><br> <div class="following_posts"> <p> Posts from people you're following: <p> <!-- Iterate over the followee's posts with a foreach loop: the first parameter the foreach gets is the array expression. Second element: On each iteration, the value of the current element (which is a post) is assigned to $value (second element) and the internal array pointer is advanced by one. Next: within these: {{!! !!}} --> @foreach ($get_followee_posts as $post) <form action="/html/tags/html_form_tag_action.cfm" method="post"> <textarea name="comments" id="comments" style="width:96%;height:90px;background-color:white;color:black;border:none;padding:2%;font:22px/30px sans-serif;"> {!! $post->full_post !!} </textarea> </form> @endforeach </div> @stop I tried with 2 editors and netbeans to figure why. I also use blade syntax of laravel.
  22. Trying to add a product search bar to Wordpress admin bar backend that will do Woocommerce product search. It will be located in the backend Admin Menu bar a top so that no matter where you are in back end it will allow to search woo's products. I am close but faulting at small stumbling block. When trying to use the search it is defaulting to post search instead of products. //Add Search To Admin Bar function boatparts_admin_bar_form() { global $wp_admin_bar; $wp_admin_bar->add_menu(array( 'id' => 'boatparts_admin_bar_form', 'parent' => 'top-secondary', 'title' => '<form method="get" action="'.get_site_url().'/wp-admin/edit.php?post_type=product"> <input name="s" type="text" style="height:20px;margin:5px 0;line-height:1em;"/> <input type="submit" style="height:18px;vertical-align:top;margin:5px 0;padding:0 2px;" value="Search Products"/> </form>' )); } add_action('admin_bar_menu', 'boatparts_admin_bar_form'); Have it in my child theme's function.php. Driving me nuts trying to figure it out.
  23. Hello there.. I have a problem when loading comment from my database.. Here are working scripts which does not query the message/comment from database.. <?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "responder"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } //query the user table $sql = "SELECT * FROM user"; $result = $conn->query($sql); //get comment from array $comment = $_GET['comment'] + 1; //I want to replace below array comment with my database comment $ar = array( "Hello there.", "How are you?" ); require_once("facebook.php"); $config = array(); $config['appId'] = 'myapp'; $config['secret'] = 'mysecret'; $config['fileUpload'] = false; $fb = new Facebook($config); if ($result->num_rows > 0) { foreach ($result as $key) { $params = array( //long-live-token "access_token" => $key['offense_token'], //comment //need to replace this from database "message" => $ar[$comment], ); if($comment<10) { try { $ret = $fb->api('/my-comment-id/comments', 'POST', $params); echo 'Successfully posted to Facebook'; sleep(5); header('Location: set-comment.php?comment='.$comment); } catch(Exception $e) { echo $e->getMessage(); } } else{ echo "done"."<br>"; } } } ?> Above scripts working fine without querying from my database So my issues now, how do I query and loop each comment from database? Here my comment/message table.. TQ
  24. I am building a website about Doctor who, and I want to post various quotes from a database, when I wrote the select-query, I got the following error: Quotes Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /customers/e/a/c/doctorwhofans.be/httpd.www/test/Content/Quotes.php on line 106 (which is the one with the while expression). <?php //verbinding met de database require("./connect.php"); //select-query schrijven en uitvoeren $sql = " select * from QuotesTabel"; $result = mysql_query($sql); //alle records weergeven (terwijl er rijen gevonden worden. while ($row = mysql_fetch_assoc($result)) { //toon foto met info require("./ToonFoto.php"); } ?> Can someone help me please?
  25. Hi! i want show my project designed as a ORM that directly manipulate Database Schema aim a class as model https://github.com/Javanile/SchemaDB please give me more feedback and test reports thkx
×
×
  • 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.