Jump to content

Search the Community

Showing results for tags 'fatal error'.

  • 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 (Dreamweaver, Zend, 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

Found 16 results

  1. I'm a newb, getting this fatal error when i push a submit button (I've replaced my site name with [root]): Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2053 ' in /home/[root]/public_html/includes/class_db_handle.php:140 Stack trace: #0 /home/[root]/public_html/includes/class_db_handle.php(140): PDOStatement->fetch(4) #1 /home/[root]/public_html/includes/functions_global.php(178): db_handle->result() #2 /home/[root]/public_html/feedback.php(88): global_class->filter('Great job') #3 {main} thrown in /home/[root]/public_html/includes/class_db_handle.php on line 140 I've attached the 3 files referenced. I'm really new to this so it may be something really simple but I don't see it. i'd appreciate any help I can get. class_db_handle.php feedback.php functions_global.php
  2. I keep getting the following error: Fatal error: Function name must be a string in /home/dmyers53/public_html/Projects/Chisese_Zodiac_for_loop.php on line 34 I dont have a function named, where am I going wrong? <body> <img src="images/rat.jpg"></img><!--test the source. WORKS--> <?php error_reporting(E_ALL); ini_set('display_errors', 'on'); echo "<p>This line works</p>\n";//yes it does $zodiacPictures = array( "images/rat.jpg", "images/ox.jpg", "images/tiger.jpg", "images/rabbit.jpg", "images/dragon.jpg", "images/snake.jpg", "images/horse.jpg", "images/sheep.jpg", "images/monkey.jpg", "images/rooster.jpg", "images/dog.jpg", "images/pig.jpg"); for ($imgCounter = 0; $imgCounter <= 12; ++$imgCounter){ echo '<img src="' . $zodiacPictures($imgCounter) . '"></img>';// line 34 } ?> </body> </html>
  3. I have an application that loads several xml files, and then outputs some of the data from the file. The problem is that every once in a while, the service that provides the xml file does maintenance (or has an error in the file), and my application gives a "Fatal error: Call to a member function children() on a non-object in..." I would like to handle the error differently, by displaying "unavailable" instead of the error. I know that this is usually not the appropriate way of handling errors, because there is a reason for a fatal error. Any ideas on how to appropriately handle this error? // Node 217 (GGB) $xml = simplexml_load_file("http://services.my511.org/traffic/API_KEY_REMOVED_FOR_EXAMPLE"); foreach($xml->children() as $traveltime) { $ggb = "$traveltime->currentTravelTime"; } ​echo "GGB:" , $ggb , " Minutes";
  4. Hey , I've just started doing PHP again after a long time of sitting it out. I wasn't the best back then so I'm hoping to improve myself now. I've got a simple script in which it apparently has errors which I'm unsure of and Google didn't exactly help me with. First of all, some odd reason when I try to include an file in my config file its saying no such file or directory even when there is. <?php// connect to DB include ("../includes/functions.php"); $Username = "*****";$Password = "******";$Database = "******";$Server = "localhost"; that is in the folder called includes. And my main problem is about functions. I keep getting a fatal error saying "Unable to call undefined function" in my config file which is: $YourIp = yourip(); In my functions that is: function yourip(){$client = @$_SERVER['HTTP_CLIENT_IP'];$foward = @$_SERVER['HTTP_X_FORWARDED_FOR'];$remote = $_SERVER['REMOTE_ADDR']; if (filter_var($client, FILTER_VALIDATE_IP)){$ip = $client;}elseif (filter_var($foward, FILTER_VALIDATE_IP)){$ip = $foward;}else{$ip = $remote;}return $ip;} (Yes I had help from online with the IP function, but I've got other functions which are exactly the same error) For what I thought that was all fine, but some reason it isnt. Any help getting me pass these error will be grateful. Thanks
  5. Hi guys, I'm having this every day: In my opinion, 256MB of memory shouldn't exhausted so soon, as I only have less than 100 visitor every day... Could this totally my PHP code faulty ? Thanks
  6. hi! My developer made me this php file. http://omenaa.ws/matrix.php he doesnt work for me anymore.I have uploaded the php to my site, but i get this error and this is my php code: <?php /* Page set in Affiliate Panel has to containt a URL parameter ref - just add ?ref={$refid} to the URL The page have to be PHP so the PHP code works... */ require_once('/affiliate/api/PapApi.class.php'); // include API file so we can work with it // check if we have to save any of the values from each form function processFormRequest(Pap_Api_Affiliate $affiliate) { $save = false; if (!empty($_POST['pm']) && ($_POST['pm'] != $affiliate->getData(10))) { // if a value was set and the value is different from the one we already stored before $affiliate->setData(10,$_POST['pm']); $save = true; } if (!empty($_POST['gdi']) && ($_POST['gdi'] != $afcfiliate->getData(11))) { $affiliate->setData(11,$_POST['gdi']); $save = true; } if (!empty($_POST['mca']) && ($_POST['mca'] != $affiliate->getData(12))) { $affiliate->setData(12,$_POST['mca']); $save = true; } if (!empty($_POST['ila']) && ($_POST['ila'] != $affiliate->getData(13))) { $affiliate->setData(13,$_POST['ila']); $save = true; } if (!empty($_POST['opro']) && ($_POST['opro'] != $affiliate->getData(14))) { $affiliate->setData(14,$_POST['opro']); $save = true; } if (!empty($_POST['znzo']) && ($_POST['znzo'] != $affiliate->getData(15))) { $affiliate->setData(15,$_POST['znzo']); $save = true; } $error = ''; if ($save) { // if any previous check changed $save to true, we will save it try { $affiliate->save(); } catch (Exception $e) { $error = "Error saving data: ".$affiliate->getMessage(); } } return $error; } // authenticate as merchant $session = new Gpf_Api_Session("http://omenaa.ws/affiliate/scripts/server.php"); if(!$session->login("api@api.com", "v6gcGH5whd")) { die("Cannot load any info from the application, please contact your Affiliate Manager. Error Message: ".$session->getMessage()); } // --------------- // load affiliate based on the ref param sent from the affiliate panel $refid = $_GET['ref']; $affiliate = new Pap_Api_Affiliate($session); $affiliate->setRefid($refid); try { $affiliate->load(); $error = processFormRequest($affiliate); // call the processFormRequest function // load values to be set in the page froms $pm = $affiliate->getData(10); $gdi = $affiliate->getData(11); $mca = $affiliate->getData(12); $ila = $affiliate->getData(13); $opro = $affiliate->getData(14); $znzo = $affiliate->getData(15); $parent = new Pap_Api_Affiliate($session); $parent->setUserid($affiliate->getParentUserId()); try { // load parent values $parent->load(); // load parent values to be set in the page froms $p_pm = $parent->getData(10); $p_gdi = $parent->getData(11); $p_mca = $parent->getData(12); $p_ila = $parent->getData(13); $p_opro = $parent->getData(14); $p_znzo = $parent->getData(15); } catch (Exception $e) { // no parent affiliate } // if any of the parent values are empty, set the default one there if (empty($p_pm)) $p_pm = 'omenaa'; if (empty($p_gdi)) $p_gdi = 'omas'; if (empty($p_mca)) $p_mca = 'omenaa'; if (empty($p_ila)) $p_ila = 'omenaa'; if (empty($p_opro)) $p_opro = 'omenaa'; if (empty($p_znzo)) $p_znzo = '195262'; } catch (Exception $e) { die("We could not load your affiliate account, please contact your Affiliate Manager. Error Message: ".$affiliate->getMessage()); } // --------------- // the HTML page starts here, we will fill in the proper values inside of it ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>OMENA | Forced Matrix Downline Builder</title> <meta name="robots" content="noindex, nofollow"> <meta name="description" content="Network Marketing Group"> <script src="javascript/ga.js" ></script> <style> body { background:#036; font-family:verdana; } .wrapper { width:976px; background:white; margin:0 auto; text-align:center; padding-top:5px; border-radius:10px; margin-top:20px; border:2px solid black; } .header { border-top:1px solid black; border-bottom:1px solid black; } .button { font-size:16px; color:white; background:#063; padding:5px 20px 5px 20px; border-radius:20px; text-decoration:none; text-align:center; border:0px; } .maintitle { font-size:30px; color:white; background:#900; padding:10px; width:450px; margin:0 auto; border-radius:10px; border:2px solid white; box-shadow:0px 0px 3px black; text-align:center; } .maintextbox { width:700px; margin:0 auto; text-align:justify; line-height:1.5em; } .title { font-size:20px; color:white; background:#C60; padding:5px 20px 5px 20px; width:300px; border-radius:10px; border:2px solid white; box-shadow:0px 0px 3px black; font-weight:bold; } .box { margin:0 auto; width:600px; margin-top:20px; text-align:center; border:5px solid black; box-shadow:0px 0px 20px grey; } .form { margin-bottom:10px; } .form tbody tr td { padding:5px 10px 5px 10px; text-align:right; } .in { background:#f2f2f2; width:240px; border:2px solid silver; padding:3px; border-radius:5px; } </style> </head> <body> <form method="post" name="pm_form"> <div class="wrapper" style="width: 1024px; height: 3203px"> <p> </p> <div class="maintextbox" style="width: 979px; height: 374px"> <blockquote> <h1 style="text-align: center"><font color="#0000FF">Forced Matrix Allies</font> </h1> <div style="padding:5px"> Online Mentoring Associates & Allies, OMENAA, is dedicated to helping its members build successful internet businesses. We network, build teams and introduce our members to business opportunities that offer high returns with little investments. In addition, we provide the resources every entrepreneur needs to succeed. <p>Listed below are the income opportunities we market. Each business is available online and is consolidated to build multiple streams of income simultaneously. The chosen programs are the most lucrative opportunities on the internet and does not drain the pockets of members. By joining these programs and updating your links, everyone you refer to OMENAA will upgrade under YOUR links. <br /><br />You choose the opportunities you want to join. The total monthly cost for all of the programs listed below is $76.91 per month at the recommended levels, but you don't have to join them all. If a new member chooses not to join a program, YOUR links will pass down until the next member joins. </p> <p>Take your time and join all programs when you desire to do so. But don't put all your eggs in one basket, select two (2) or more of the programs below to build your income simultaneously with one effort. We <u><i><b>highly recommend </b></i></u>that GDI is always on of the business members join. You'll understand why as you set up your downline builder. <p>Lets get started. <p> <table border="1" cellpadding="0" cellspacing="0" width="95%" id="table1"> <tr> <font face=verdana size=2> <td colspan=2> <p align="left"><u><b><font face=verdana color=red>Recommended Programs</font></b></u> </td> </font> </tr> <tr> <font face=verdana size=2> <td height="61" width="41%"> <blockquote> <p style="margin-top: 0; margin-bottom: 0"><b><font size="2"> <a style="color:blue" target="_blank" href="https://www.website.ws/orderflow/index.dhtml?sponsor=<?php echo $p_gdi;?>">Join Global Domains International </a></font></b> </blockquote> </td> <td height="61" width="59%"> <blockquote> <p style="margin-top: 0; margin-bottom: 0"><font size="2">http://www.website.ws/</font><input type="text" id="gdi" style="width:172; height:28" name="gdi" size="20" value="<?php echo (($gdi != '')?$gdi:'');?>"/> <p style="margin-top: 0; margin-bottom: 0"> <i><font size="1">ex: https://www.website.ws/orderflow/index.dhtml?sponsor=<b>omas</b></font></i> </blockquote> </td> </font> </tr> <tr> <font face=verdana size=2> <td colspan=2 height="184"> <blockquote> <p style="margin-top: 0; margin-bottom: 0" align="justify"> </p> <p style="margin-top: 0; margin-bottom: 0" align="justify"> <span style="font-weight: 400"><font size="2">Global Domains International offers a global opportunity to sell domains and hosting service on a large scale to an international community and earn a substantial income to support you and your family for years to come. This opportunity is not a traditional Forced Matrix Program. However, you can move you new affiliates in your downlwine within their first 7 days.</font></span> </p> <p style="margin-top: 0; margin-bottom: 0" align="justify"> </p> <p style="margin-top: 0; margin-bottom: 0" align="justify"> <font size="2" color="#FF0000">All business owners, network marketers, entrepreneurs etc. should have their very own domain name. This program is a must have and is <b>Highly Recommended.</b></font> </p> </blockquote> <p style="margin-top: 0; margin-bottom: 0" align="center"><b> <font size="2" color="#008000" face="verdana">Free 7 Day Trial </font></b> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"><b> <font size="2" color="#008000">Monthly Fee: $10.00 </font></b> </p> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"> <input type="submit" value="Build my GDI Downline" /> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"> </td> </font> </tr> <tr> <font face=verdana size=2> <td height="55" width="41%"> <blockquote> <p align="left"><font size="2" color="#0000FF"> <span style="font-weight: 700"> <a href="http://omenaa.ws/affiliate/sites/mentor/<?php echo $p_opro;?>/">Join OMENAA PRO</a></span></font> </p> </blockquote> </td> <td height="55" width="59%"> <blockquote> <p style="margin-top: 0; margin-bottom: 0"><font size="2">http://omenaa.ws/affiliate/sites/mentor/</font><input type="text" id="opro" style="width:172; height:28" name="opro" size="20" value="<?php echo (($opro != '')?$opro:'');?>"/><font size="2"> </font> </p> <p style="margin-top: 0; margin-bottom: 0" align="left"><i><font size="1">ex: http://omenaa.ws/affiliate/sites/mentor/<b>omenaa</b></font></i> </blockquote> </td> </font> </tr> <tr> <font face=verdana size=2> <td colspan=2 height="201"> <blockquote> <p align="justify" style="margin-top: 0; margin-bottom: 0"> <font size="2">Upgrade your OMENAA account to the Pro Membership and add up to 5 additional business to your portfolio. Receive 50% more commissions than free members, get 20% off onsite advertising and save up to 20% on co-op prices.</font> </p> </blockquote> <p align="justify" style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"><b> <font size="2" color="#008000">Monthly Fee: $10.00</font></b> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"> <input type="submit" value="Upgrade to OMENAA PRO" /> <p align="center" style="margin-top: 0; margin-bottom: 0"> <p align="center" style="margin-top: 0; margin-bottom: 0"> </td> </font> </tr> <tr> <font face=verdana size=2> <td height="55" width="41%"> <blockquote> <font size="2"> <a style="color:blue; font-weight:700" target="_blank" href="http://www.pennymatrix.com/<?php echo $p_pm; ?>">Join Penny Matrix</a></font> </blockquote> </td> <td height="55" width="59%"> <blockquote> <p style="margin-top: 0; margin-bottom: 0"><font size="2">http://pennymatrix.com/</font><input type="text" id="pm" style="width:172; height:28" name="pm" size="20" value="<?php echo (($pm != '')?$pm:'');?>"/><font size="2"> </font> </p> <p style="margin-top: 0; margin-bottom: 0" align="left"><i><font size="1">ex: http://pennymatrix.com/<b>omenaa</b></font></i> </blockquote> </td> </font> </tr> <tr> <font face=verdana size=2> <td colspan=2 height="201"> <blockquote> <p align="justify" style="margin-top: 0; margin-bottom: 0"> <font size="2">Join the fastest growing ebook club in America today. Turn $7 into </font><strong style="color: #F00; font-weight: 400"><font size="2">$19,659.60 </font></strong><strong style="font-weight: 400"> <font size="2">per month. Get in this Exploding Program Now! You get to pick out a valuable ebook every month from their huge library. You will get an early spot (Permanent, yes your spot will never go away - even if you are inactive for a while!) in a powerful newly designed and unique 2 x 14 forced company matrix that is currently exploding in the U.S. and now in other countries around the world... "a Book-of-the-Month Club on Steroids!"</font></strong><font size="2"> </font> </p> </blockquote> <p align="justify" style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"><b> <font size="2" color="#008000">Monthly Fee: $7.00</font></b> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"> <input type="submit" value="Build my Penny Matrix Downline" /> <p align="center" style="margin-top: 0; margin-bottom: 0"> <p align="center" style="margin-top: 0; margin-bottom: 0"> </td> </font> </tr> <tr> <font face=verdana size=2> <td height="73" width="41%"> <blockquote> <p style="margin-top: 0; margin-bottom: 0"><font size="2"> <a style="color:blue; font-weight:700" target="_blank" href="https://www.tvcmatrix.com/<?php echo $p_mca; ?>">Join Motor Club of America</a></font> </blockquote> </td> <td height="73" width="59%"> <blockquote> <p style="margin-top: 0; margin-bottom: 0"><font size="2">https://www.tvcmatrix.com/</font><font size="3"><input type="text" id="mca" style="width:172; height:28" name="mca" size="20" value="<?php echo (($mca != '')?$mca:'');?>"/></font><font size="2"> </font> <p style="margin-top: 0; margin-bottom: 0"><i><font size="1">ex: </font> <font size="1" face="verdana">https://www.tvcmatrix.com/<b>omenaa</b></font></i> </blockquote> </td> </font> </tr> <tr> <font face=verdana size=2> <td colspan=2 height="453"> <blockquote> <p style="margin-top: 0; margin-bottom: 0" align="justify"> <font face="Verdana" size="2">If you don't know much about motor clubs you might think that they only deal with your vehicle, or that it's just another form of auto insurance. If you find the right one though, a motor club can be much more than that. Imagine having a plan that perfectly compliments your existing auto and health insurance. That's what Motor Club of America Rewards services can do for you! Their complete line of benefits can ensure that you're covered at home, work and play - wherever you are and whatever the situation. The true story below is one of many where Motor Club of America benefits could have been extremely helpful.</font> </p> </blockquote> <p align="center"><b><font size="2" color="#008000">Monthly Cost: </font></b> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><b><font size="2" color="#008000">Free - Builds Residual Income Only</font></b> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><b><font color="#008000" size="2">$19.95 - Builds Residual Income + Bonuses</font></b> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><b><font color="#008000" size="2">$39.99 - Builds Residual Income + Bonuses + Forced Matrix Plan </font> <font size="2" color="#FF0000">*Recommended</font></b> </p> <blockquote> <p align="justify"> <font color="#FF0000" size="2"><b>This opportunity is for U.S. & Canada residents ONLY! Please do not use your prepaid card when initially joining. Upfront bonuses are not paid on prepaid card holders. However, you can add a prepaid card, after your initial purchase.</b></font> </p> </blockquote> <p style="text-align: center"> <input type="submit" value="Build my MCA Downline"/> </p> </td> </font> </tr> <tr> <font face=verdana size=2> <td height="54" width="41%"> <blockquote> <p style="text-align: left"><font size="2"> <a style="color:blue; font-weight:700" target="_blank" href="http://www.iLivingApp.com/<?php echo $p_ila; ?>">Join The Inspired Living Application</a></font> </p> </blockquote> </td> <td height="54" width="59%"> <font face=verdana size=2> <blockquote> <p style="margin-top: 0; margin-bottom: 0"> http://www.iLivingApp.com/<input type="text" id="ila" style="width:172; height:28" name="ila" size="20" value="<?php echo (($ila != '')?$ila:'');?>"/><font color="#FF0000"> </font> </font> <font face=verdana size=1> <p style="margin-top: 0; margin-bottom: 0"><i>ex: http://www.iLivingApp.com/<b>omenaa</b></i></blockquote> </td> </font> </tr> <tr> <td colspan=2 height="353"> <blockquote> <font size="2">iLA (The Inspired Living Application) is a one of a kind, cutting edge mobile application that makes it possible for the average person to profit from the exploding mobile application industry.</font> </blockquote> <p align="center"><b> <font size="2" color="#008000">Monthly Fee: </font></b> </p> <p align="center"><b><font size="2" color="#008000">Free - Access to library</font></b> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><b> <font color="#008000" size="2">$6.95 - Retail Customer No Income. </font></b> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><font size="2">You must refer two (2) customers to become an associate</font> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><b> <font color="#008000" size="2">$9.95 - Builds Residual Income + Bonuses + Forced Matrix Plan </font> <font size="2" color="#FF0000">*Recommeded</font><font size="2"> </font></b> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"><font size="2">After there are 12 people in your downline, your membership is <b><font color="#FF0000">Free!</font></b></font> </p> <p align="center"> <input type="submit" value="Build iLA Downline" /> </p> </td> </tr> </table> <p> </div> </blockquote> </div> <p> </p> <p></p> <p> </p> </div> <p align="center"> </p> <p align="center"> <span style="font-family: georgia, palatino; background-color: #FFFFFF"> <strong> <font size="1"><a href="http://omenaa.ws/terms%20of%20service.htm">Terms </a> | <a href="http://omenaa.ws/privacy%20policy.htm">Privacy</a> </font><span style="font-family:georgia, palatino; font-size:14pt"> <font size="1"> | <a href="http://omenaa.ws/Disclaimer.htm">Disclaimer</a></font></span></strong></span> </p> <p align="center"> </p> <p align="center"><b><font size="1" color="#FFFFFF">© Copyright OMENAA, LLC All Rights Reserved </font></b> </p> <p align="center"> </p> </form> </body> </html>
  7. I am trying to run the following: $sqlErrors = ""; $query = "SELECT `name` FROM company WHERE id=".$_POST['companyID']; $result = $mysqli->query($query); $row = $result->fetch_assoc(); $company = $row['name']; $sqlErrors = $mysqli->error ? "Selecting company, id: ".$_POST['companyID'].". Error: ".$mysqli->error : ""; And am getting the following output: Fatal error: Call to undefined method mysqli::SELECT `name` FROM company WHERE id=3() I have no idea where the trailing brackets are coming from, and even tried $result = $mysqli->query("SELECT `name` FROM company WHERE id=3"); ... but get the same result. The questionable piece of code is contained within the following, in the "what company are we regestering the agent to?" section. $all_query_ok = true; $sqlErrors = ""; /* connect to the db */ $mysqli = new mysqli('localhost','riski296_dbuser','7FJTCJyMARer90oCKmyek5Cw36wXYG1etWJcOGjYONn53liYEHkTb0v74WqpVV3O', 'riski296_taxi_pim') or die('Cannot select the DB'); /* * what company are we regestering the agent to? */ $query = "SELECT `name` FROM company WHERE id=".$_POST['companyID']; $result = $mysqli->query($query); $row = $result->fetch_assoc(); $company = $row['name']; $sqlErrors = $mysqli->error ? "Selecting company, id: ".$_POST['companyID'].". Error: ".$mysqli->error : ""; /* grab the first available agnet for that company */ $agentID = -1; if ($result = $mysqli->query("SELECT id FROM agent WHERE is_active=0 AND companyID=".$_POST['companyID']." LIMIT 1")) { if($result->num_rows == 1){ /* fetch object array */ $row = $result->fetch_assoc(); $agentID = $row['id']; } else { echo "There is no agents currently entered for ".$company; exit(); } $sqlErrors .= $mysqli->error ? ". Getting agent, company id: ".$_POST['companyID'].". Error: ".$mysqli->error : ""; } /* determine what kind of connection device is being used */ $connectionDeviceID = -1; switch($_POST['connectionDeviceType']) { case "Cellular": $connectionDeviceID = $_POST['cellularConnectionDeviceID']; break; case "LAN": $connectionDeviceID = $_POST['lanConnectionDeviceID']; break; } $mysqli->autocommit(FALSE); /* * INSERT connection device being used with this PIM */ $mysqli->$query(" INSERT INTO connection_device (idDevices, device_type, idPlan) VALUES (".$connectionDeviceID.", ".$_POST['connectionDeviceType'].", ".$_POST['planID'].")") ? null : $all_query_ok = false; $sqlErrors .= $mysqli->error ? ". Inserting connection_device, connection device id: ".$connectionDeviceID.", Connection device type: ".$_POST['connectionDeviceType'].", and Plan ID: ".$_POST['planID'].". Error: ".$mysqli->error : ""; /* * INSERT PIM and associate the connection device with the PIM */ $mysqli->$query(" INSERT INTO device (idDevices, idAgent, idConnectionDevice) VALUES (".$_POST['pimID'].", NULL, ".$mysqli->insert_id.")") ? null : $all_query_ok = false; $sqlErrors .= $mysqli->error ? ". Inserting PIM, PIM id: ".$_POST['pimID'].", agent ID: NULL, and Plan ID: ".$_POST['planID'].". Error: ".$mysqli->error : ""; /* * associate the device with the company. make note of install date */ $install_date = date("Y-m-d H:i:s"); $mysqli->$query(" INSERT INTO compay_device_relation (idCompany, idDevice, install_date, location, removal_date) VALUES (".$_POST['companyID'].", ".$mysqli->insert_id.", ".$install_date.", NULL, NULL)") ? null : $all_query_ok = false; $sqlErrors .= $mysqli->error ? ". Inserting company_device_relation, idCompany: ".$_POST['companyID'].", idDevice: ".$mysqli->insert_id.", install_date: ".$install_date.", location: NULL, and removal_date: NULL. Error: ".$mysqli->error : ""; /* * check for any pre-existing errors */ if($sqlErrors != "") { echo $sqlErrors; exit(); } /* * update agent - this makes sure that the agent is still available */ $mysqli->query("UPDATE agent SET is_active=1 WHERE id=".$agentID) ? null : $all_query_ok = false; $mysqli->affected_rows == 1 ? null : $all_query_ok = false; $all_query_ok ? $mysqli->commit() : $mysqli->rollback(); $mysqli->autocommit(TRUE); $mysqli->close(); echo $all_query_ok ? "Agent added to ".$company : "failure:"; Any help is most appreciated! Thanks, Dave.
  8. Getting the following error after doing a test relocation of a website to a new shared server. Fatal error! Your request can not be executed! Fatal error: Cannot use object of type PEAR_Error as array in /data/19/3/11/99/3011262/user/3343466/htdocs/HTJ/system/ext/I18N/LangData.php on line 66 checked the LangData file and here's the 'offending' code, from line 62-72 public static function createLangDataFromServer($lang_data) { $langData = new LangData(); $langData->setID($lang_data['lang_id']); $langData->setCaption($lang_data['name']); $langData->setMeta($lang_data['meta']); $langData->setErrorText($lang_data['error_text']); return $langData; } Stumped as to what might be causing this. Keep in mind he site was originally built on a Smarty php basis.
  9. Hey there guys ! so i have finally finished my register log-in page , and with that i have created a couple functions pages , as i am sure you can assume all the functions for logic will be called from these pages. now i have one called users , i.e for login , registration , check if active, etc.. and i have one for more general functions page called general , i.e for redirects, and input sanitation. anyway my register login page works flawless ( well i guess more 90 % done 90 % left to go ). and now when im on the index page or my main page essentially i now see a fatal error: now i see that it is telling me exactly where the error is , yet i dont understand as to why i am seeing this . im not quite sure as to how the function is being declared already , when the function is only being called once or twice on the register page. just to show you guys what im talking about my code: general.php ( FUNCTIONS ARE STORED) function email($to, $subject, $body){mail($to, $subject, $body, 'From: support@j.m.com'); } function email_to_activate($to, $subject, $body){ mail($to, $subject, $body, 'From: activate@j.m.com'); } function email_user_for_recovery($to, $subject, $body){ mail($to, $subject, $body, 'From: recovery@j.m.com'); } function logged_in_redirect(){ if (logged_in() === true ) header("Location: index.php"); } function protect_page() { // redirects if user is not logged in .. user gets no access page if (logged_in() === false ) { header('Location: no_permission.php'); exit(); } } function admin_access() { global $user_data; if (has_access($user_data['user_id'], 1) === false) { header('Location: index.php'); exit(); } } function page_redirect() { // if user not logged in redirect goes to index page if (logged_in() === false ) { header('Location: index.php'); exit(); } } function redirect(){ // redirects regardless of logged in or not header('Location: index.php'); exit(); } function array_sanitize(&$item){ $items = strip_tags(htmlentities(mysql_real_escape_string($item))); } function sanitize($data) { return strip_tags(htmlentities(mysql_real_escape_string($data))); } function output_errors($errors){ $output = array(); foreach($errors as $error){ $output[] = $error ; } return '<ul>' . implode($output) . '</ul>'; } and index.php // CORE FUNCTIONS - DATABASE CONNECT - SESSIONS & COOKIES include('include/init.php'); // HEADER INFO - META TAGS - LINKS - SCRIPTS include('include/header.php'); // LOG USER IN if (logged_in() === true){ include ('include/widgets/loggedin.php'); } else { include('include/widgets/login.php'); } // WEBSITE LOGO include('include/logo_head.php'); // NAVIGATION BAR include('include/navbar.php'); // MAIN PAGE include('include/topbanner.php'); include('include/topbanner2.php'); <----- Error shows up here and cuts off the rest of the page. include('include/mainbody.php'); // FOOTER include('include/footer.php'); as i mention in the code above, the page spits about half the output then cuts off and displays that error message. This confuses me a bit more actually. any suggestions as to why this is happening ? EDIT : to add init.php ( CORE FILE ) if(!isset($_SESSION)) { session_start(); } error_reporting(E_ALL| E_STRICT); ini_set('display_errors', 1); require ('core/database/dbconnect.php'); require ('core/functions/general.php'); require ('core/functions/users.php'); require 'core/queries/dbqueries.php'; $current_file = explode('/', $_SERVER['SCRIPT_NAME']); $current_file = end($current_file); if (logged_in() === true) { $session_user_id = $_SESSION['user_id']; $user_data = user_data($session_user_id, 'user_id', 'username', 'password', 'email', 'gender', 'country', 'month' ,'date' , 'year', 'pass_recover', 'type'); if (user_active($user_data['username']) === false){ session_destroy(); header('Location: index.php'); exit(); } if($current_file !== 'change_password.php' && $current_file !== 'logout.php' && $user_data['pass_recover'] == 1 ){ header('Location: change_password.php?force'); exit(); } } $errors = array();
  10. Wow! First, what an awesome place this is! I was searching for exactly something of this sort! A place where people can talk about PHP and ask questions and receive great support. To the founders of phpfreaks, my hat off to you all! Here is my issue. I installed the RokBridge Joomla extension that will bridge my website with my phpBB forums to synchronize user registrations, log in sessions, and log out sessions. This way registration processes are cut down in addition to the user only having to log in/out at one place but be logged in/out in the other applications (in my case, the forums and website). Everything is installed and configured correctly. I have no issues whatsoever as far as backend Joomla access and rokbridge application performance with phpBB. The only issue I'm having is a fatal error when trying to access my homepage. That error is: Line 34 of rokbridge.php is: I understand that the php code in line 34 is trying to find the installation of Joomla on my directory, hence the JFolder, at least to my understanding. I'm not certain, however, what location php code line 34 is referencing to look for JFolder, but based off the error message I know whatever reference location is in the code, Jfolder is not there. Can any php expert of any type help me correctly reference my Joomla installation? Joomla was unpacked into public_html so when users went to www.mysite.com they would see the Joomla website instead of the default installation of www.mysite.com/joomla What do I need to edit in line 34 to reference my Joomla installation in public_html? P.S. I have considered RokBridge support but RokBridge provides this Joomla extension for free but requires you to pay $30+ to ask a question about it which I do not think is appropriate. If I have an answer, I want to be able to help someone but unfortunately RokBridge does not share my perspective. So hopefully I've come to the right place for support!
  11. I have a bit of an interesting problem concerning the configuration of php and mysql. I cannot configure them to work together. Whenever try to connect to a mysql database, I get the following error: Fatal error: Call to undefined function mysql connect( ) . I am currently using the latest version of mysql and php and am using a Windows 7 box as the server. Due to certain restrictions, I cannot use a preconfigured web server or package (no xampp, apache or easyphp). Therefore, I am pretty much restricted to using the built-in development server that comes with php. So far, I have done the editing to the php.ini file, removed the semicolon from php_mysql.dll to remove the ; and changed extension_dir = "C:\PHP\ext" to reflect my extension folder. I guess the two questions I have are: A) can the php 5.4 included development server even connect to a mysql database B) if so, can anyone provide me with some possible fixes to this configuration problem? Any help given is appreciated.
  12. Hi Gang, New forum user here... I'm using a wordpress build which has broken and I'm getting an error log of "String could not be parsed as XML" on the twitter.php doc that comes with the theme. Here is the error log: And here is the code section in question: The "$xml = new SimpleXMLElement($data);" line is line 86 referenced in the error log. I don't care about having twitter embedded on my site, so disabling anything is fine, but I need help! Thanks! Greg
  13. Hi, i am new to php and i am trying to build a contact form in xhtml and a action link to php. when i click the submit button on the form, i keep getting this message Fatal error: Call to undefined function check_input() in /home/beernice/public_html/truffles.php on line 6 the xhtml code is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Beer Nicessities-contactus</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <link href="sugar.css" rel="stylesheet" type="text/css"/> </head> <body> <div class="placement"></div> <div id="header">Welcome to Beer Niccessties.com</div> <div class="nav"> <a href="index.html">Home</a>| <a href="aboutus.html">About Us</a>| <a href="gallery.html">Gallery</a>| </div> <div id="content"> <p>Please contact us using the form below</p> <form action="truffles.php" method="post" class="contact"> <fieldset> <div> <label for="name" class="fixedwidth">Name:</label> <input type="text" name="name" id="name"/> </div> <div> <label for="email" class="fixedwidth">Email Address:</label> <input type="text" name="email" id="email"/> </div> <div> <label for="barberbok">Barber Bok</label> <input type="checkbox" name="options_0" id="barberbok" value=""/> <label for="ammount">ammount</label> <select name="ammount" id="ammount"> <option>5</option> <option>10</option> <option>15</option> <option>20</option> </select> </div> <br/> <div class="buttonarea"> <input type="submit" value="Submit Order" /> <input type="reset" value="reset" /> </div> </fieldset> </form> </div><!-- end of content div--> <div class="socialmedia"> <a href="http://twitter.com/sugarplumpdairy"><img src="images/twitter.png" title="By TwitterButtons.org" width="100" height="101" alt="follow us on twitter"/></a> <a href="http://facebook.com//pages/Sugarplumpdairy-beer-and-chocolate-truffles/142162515884033?ref=hl"><img src="images/facebook.png" title="By SocialMediaButtons.com" height="101" width="100" alt="like us on facebook"/></a> </div> <!--end of socialmedia--> </body> </html> and the php is as follows <?php /* Set e-mail recipient */ $myemail = "forlannumber10@hotmail.com"; $name = $_POST['name']; $email = $_POST['email']; $barberbok = $_POST['barberbok']; $ammount = $_POST['ammount']; ?> <DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR//xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://w3.org/1999.xhtml"> <head> <title>Beer Nicessities-thanks!</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8"/> <link href="sugar.css" rel="stylesheet" type="text/css"/> </head> <body> <div class="placement"></div> <div id="header">Welcome to Beer Niccessties.com</div> <div class="nav"> <a href="aboutus.html">About Us</a>| <a href="gallery.html">Gallery</a>| <a href="contactus.html">Contact Us</a>| </div> <div class="thanks"> <h1>Thank you for contacting us.</h1> <p>We will get back to you as soon as possible</p> </div> <div class="socialmedia"> <a href="http://twitter.com/sugarplumpdairy"><img src="images/twitter.png" title="By TwitterButtons.org" width="100" height="101" alt="follow us on twitter"/></a> <a href="http://facebook.com//pages/Sugarplumpdairy-beer-and-chocolate-truffles/142162515884033?ref=hl"><img src="images/facebook.png" title="By SocialMediaButtons.com" height="101" width="100"/></a> </div> <!--end of socialmedia--> </body> </html> what am i doing wrong? Please help!
  14. hello everyone. i'm trying to make an mvc website based on this example http://anantgarg.com...amework-part-1/ Instead of using a common sql connection i have extend the model with a PDO. i made a class called PDOconnection and extends the model. When i load the page i'm getting this error message Fatal error: Call to a member function render() on a non-object in /Applications/MAMP/htdocs/project/library/controller.class.php on line 47 and when i made comment the model is loading the template. what my doing wrong? where is my code controller.class.php <?php class Controller { protected $_model; protected $_controller; protected $_action; protected $_template; function __construct($model, $controller, $action) { $this->_controller = $controller; $this->_action = $action; $this->_model = $model; //& = & $this->$model = new $model; $this->_template = new Template($controller,$action); } function set($name,$value) { $this->_template->set($name,$value); } function __destruct() { print_r($this->_template->render()); } } model.class.php <?php class Model extends PDOconnection { protected $_model; protected $_PDOconnection; protected $_result; private $_connection; function __construct() { $this->_PDOconnection = $this->PDO_connect(DB_HOST,DB_USER,DB_PASSWORD); $this->_model = get_class($this); $this->_table = strtolower($this->_model)."s"; } function __destruct() { } } pdoconnection.class.php <?php class PDOconnection { protected $_dbh; protected $_result; /** Connects to database **/ function PDO_connect($host, $username,$password) { try { $this->_dbh = new PDO($host, $username, $password); $this->_dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); print_r($this->_dbh); } catch (PDOException $e) { /** * If any error occur will trying to connect to the database it will store it on the errorlog file. * **/ error_log("Database is down!".date("d-F-Y h:i:s a", time()), 0); die(); } return $this->_dbh; } /** Disconnects from database **/ function disconnect() { $this->_dbh = null; } } template.class.php <?php class Template { protected $variables = array(); protected $_controller; protected $_action; function __construct($controller,$action) { $this->_controller = $controller; $this->_action = $action; } /** Set Variables **/ function set($name,$value) { $this->variables[$name] = $value; } /** Display Template **/ function render() { extract($this->variables); if (file_exists(ROOT . DS . 'application' . DS . 'views' . DS . $this->_controller . DS . 'header.php')) { include (ROOT . DS . 'application' . DS . 'views' . DS . $this->_controller . DS . 'header.php'); } else { include (ROOT . DS . 'application' . DS . 'views' . DS . 'header.php'); } include (ROOT . DS . 'application' . DS . 'views' . DS . $this->_controller . DS . $this->_action . '.php'); if (file_exists(ROOT . DS . 'application' . DS . 'views' . DS . $this->_controller . DS . 'footer.php')) { include (ROOT . DS . 'application' . DS . 'views' . DS . $this->_controller . DS . 'footer.php'); } else { include (ROOT . DS . 'application' . DS . 'views' . DS . 'footer.php'); } } }
  15. Hello World! My first post here. I have a weird problem with "bbPress User Ignore" plugin for WordPress. I am using wampserver (clean install) for coding a quick mod needed for a website. Installed the latest version of WP, bbPress and bbPress Ignore User. In WP Dashboard, could not activate the plugin. Throws a fatal error. The exact error shown: Plugin could not be activated because it triggered a fatal error. Parse error: syntax error, unexpected 'endforeach' (T_ENDFOREACH) in C:\wamp\www\wordpress\wp-content\plugins\bbpress-ignore-user\bbpress-ignore-user.php on line 169 ​ Have I missed turning on/off or editing a simple required option in one of the configuration files? Apache Version: 2.4.2 PHP Version: 5.4.3 MySQL Version: 5.5.24
  16. im trying to build simple login form with some if functions(currently without database) but i got stuck on line 77 if (isset($korisnickoIme)!=='admin' && isset(sha1($lozinka))!=='7110eda4d09e062aa5e4a390b0a572ac0d2c0220') { echo "Molimo unesite ispravne podatke."; } when i erase isset from isset(sha1($lozinka)).... then it works but i get error for variable not defined - any ideas? call if you need all code but rest of it works fine (notice that i have isset at $korisnickoIme and there it works
×
×
  • 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.