
ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
Is the double case really necessary? case ($str_item === '"' || $str_item === "'") && !$indoublequotes:
-
This is possibly done better and faster without regex. Regex would require you to regex twice. Once for everything between " and once for everything that is not between ".
-
I found two posts that requested this from 2008 and some posted a few possible solutions, but they are from 2008 http://forums.phpfreaks.com/index.php?topic=215609.msg985474 http://forums.phpfreaks.com/index.php?topic=230395.msg1067248 Since there are a lot more options now for code highlighting could this be considered again? Personally I would like to see a code highlighter that also format's the inputted text since most people here who post code tend to write evertything against the border. EDIT: What's up with the editor injecting automagically?
-
This should tell you what the error is: <?php // DATABASE CONNECTION require("/config.php"); // LEAD DETAILS PAGE - PAGE ID function leaddetailspgid() { global $mysqli; $stmt = $mysqli->prepare("SELECT ID,date,firstname,lastname,spousefirst,spouselast,primarybday,spousebday,phonecell,phonehome,phoneoffice,spousecell,phoneother,email,emailspouse,emailother,emailspouseother,address,suite,city,state,zipcode,addressother,suiteother,cityother,stateother,zipcodeother,agentassigned,contacttype,status,contactsource,timing,password,subscribesearches,subscribedrips FROM contacts"); $stmt->bind_result($ID, $date, $firstname, $lastname, $spousefirst, $spouselast, $primarybday, $spousebday, $phonecell, $phonehome, $phoneoffice, $spousecell, $phoneother, $email, $emailspouse, $emailother, $emailspouseother, $address, $suite, $city, $state, $zipcode, $addressother, $suiteother, $cityother, $stateother, $zipcodeother, $agentassigned, $contacttype, $status, $contactsource, $timing, $password, $subscribesearches, $subscribedrips); $stmt->execute(); $stmt->fetch(); $space = (!empty($firstname) && !empty($lastname)) ? ' ' : ''; $name = $firstname . $space . $lastname; $name .= (!empty($spousefirst)) ? " & {$spousefirst}" : ''; $name .= (!empty($spouselast)) ? " {$spouselast}" : ''; $cell = (!empty($phonecell)) ? " {$phonecell} (cell)" : ''; $home = (!empty($phonehome)) ? " {$phonehome} (home)" : ''; $email = (!empty($email)) ? " {$email} (email)" : ''; $pbday = date("F jS", strtotime($primarybday)); $sbday = date("F jS", strtotime($spousebday)); echo ' <ul id="secondary"> <li class="pageid">DETAILS:</a></li> <li class="pageid">' . $name . '</li> <li class="pageid">' . $home . '</li> <li class="pageid">' . $cell . '</li> <li class="pageid">' . $email . '</li> </ul>'; $stmt->close(); $mysqli->close(); } // LEAD DETAILS PAGE - DETAILS function leaddeatails() { global $mysqli; $stmt = $mysqli->prepare("SELECT ID,date,firstname,lastname,spousefirst,spouselast,primarybday,spousebday,phonecell,phonehome,phoneoffice,spousecell,phoneother,email,emailspouse,emailother,emailspouseother,address,suite,city,state,zipcode,addressother,suiteother,cityother,stateother,zipcodeother,agentassigned,contacttype,status,contactsource,timing,password,subscribesearches,subscribedrips FROM contacts"); if ($stmt === false) { echo 'SQL ERROR: ', $mysqli->error; exit; } $stmt->bind_result($ID, $date, $firstname, $lastname, $spousefirst, $spouselast, $primarybday, $spousebday, $phonecell, $phonehome, $phoneoffice, $spousecell, $phoneother, $email, $emailspouse, $emailother, $emailspouseother, $address, $suite, $city, $state, $zipcode, $addressother, $suiteother, $cityother, $stateother, $zipcodeother, $agentassigned, $contacttype, $status, $contactsource, $timing, $password, $subscribesearches, $subscribedrips); $stmt->execute(); $stmt->fetch(); echo ' <table class="view-detail" id="view-detail"> <tbody> <tr> <td colspan="2"><h2>Details</h2></td> </tr> <tr> <td>Partner: </td><td>' . $spousefirst . ' ' . $spouselast . '</td> </tr> <tr> <td>Cell: </td><td>' . $phonecell . '</td> </tr> <tr> <td>Partner Cell: </td><td>' . $spousecell . '</td> </tr> <tr> <td>Home: </td><td>' . $phonehome . '</td> </tr> <tr> <td>Office: </td><td>' . $phoneoffice . '</td> </tr> <tr> <td>Email: </td><td>' . $email . '</td> </tr> <tr> <td>Partner Email: </td><td>' . $emailspouse . '</td> </tr> <tr> <td>Password: </td><td>' . $password . '</td> </tr> <tr> <td>Other Email: </td><td>' . $emailother . '</td> </tr> <tr> <td colspan="2"><h2>Mailing Address</h2></td> </tr> <tr> <td>Address: </td><td>' . $address . ' Suite: ' . $suite . '</td> </tr> <tr> <td>City: </td><td>' . $city . '</td> </tr> <tr> <td>State: </td><td>' . $state . '</td> </tr> <tr> <td>Zip Code: </td><td>' . $zipcode . '</td> </tr> <tr> <td colspan="2"><h2>Investment Property</h2></td> </tr> <tr> <td>Address: </td><td>' . $addressother . ' Suite: ' . $suiteother . '</td> </tr> <tr> <td>City: </td><td>' . $cityother . '</td> </tr> <tr> <td>State: </td><td>' . $stateother . '</td> </tr> <tr> <td>Zip Code: </td><td>' . $zipcodeother . '</td> </tr> <tr> <td colspan="2"><h2>Birthdays</h2></td> </tr> <tr> <td>Birthday: </td><td>' . $pbday . '</td> </tr> <tr> <td>Partner Birthday: </td><td>' . $sbday . '</td> </tr> <tr> <td colspan="2"><h2>Other Details</h2></td> </tr> <tr> <td>Agent: </td><td>' . $agentassigned . '</td> </tr> <tr> <td>Type: </td><td>' . $contacttype . '</td> </tr> <tr> <td>Status: </td><td>' . $status . '</td> </tr> <tr> <td>Groups: </td><td>Groups Checkboxes Go Here!</td> </tr> <tr> <td colspan="2"><h2>Subscriptions</h2></td> <tr> <td>Searches: </td><td>' . $subscribesearches . '</td> </tr> <tr> <td>Email Drips: </td><td>' . $subscribedrips . '</td> </tr> </tbody> </table>'; $stmt->close(); $mysqli->close(); }
-
RESTful means you use HTTP verbs GET/POST/DELETE. So Is both restful. Even foo.php?bar=bat is restful.
-
There is a difference between using a simple Image object to display a model (that said without a vector image it will always go blurry), and using an actual model renderer like THREE with WebGL to display it in 3D. A quick search on Google revealed: http://forums.bukkit.org/threads/web-html5-skin-viewer.4428/ Where you can download the code to view your model in 3D. EDIT: going through the code revealed it assumes register_globals = On ! 0h n03s !!
-
How do you go about adding a small addition to a big system?
ignace replied to cs.punk's topic in Miscellaneous
That is not specific to your client. That is how every businessman thinks: cut costs wherever possible while maintaining the same level of quality. It's probably because you allow this kind of pressure from the client (do it faster!) get the better of you and rack up bugs faster than a rotting body. Trust me, I've been there cutting corners everywhere I could to meet an impossible deadline and still be fixing bugs while the client was on his way to celebrate the release of his software... Get out of it before it puts you out! If they do not hire you afterwards because of the potential cost, it's at least that: cost, not the blame of possible incompetence, not implying you are here, which is devastating for your career. That said, it are though times, which is probably why you get no repeat business. -
How do you go about adding a small addition to a big system?
ignace replied to cs.punk's topic in Miscellaneous
Well I think it all depends. If the code is properly written and somewhat documented. Analyzing first, is a good approach (if this is the case, see below the --). However what are the chances, right? I have edited quite a few legacy systems, some of which you could not tell the difference between if the code was obfuscated first and then checked in, or just written like that. When you have to deal with a system where the typical variable name does not exceed one alphabet character, and function names describe their functionality as well as a 3-year old describes their toys. I highly recommend you code first, ask questions later. Followed by at least a few days of intensive testing, be sure to involve as many people as possible, and fix the bugs that apply to your code, put any other bugs you find in their bug tracking software (if they have that sort of thing). -- In a good case scenario there are some things you must do before you can even consider starting implementation. Fix bugs! If there are already multiple open bugs for the part of the system you are going to be editing, then it goes without saying that whatever you are going to do is going to make it worse. Probably what has been happening to you. If they apply unit-testing, your job is even easier to squash bugs! Done fixing bugs? But still not too comfortable? Refactor! Some functions body you will be using exceeds your screen height? Good candidate for refactoring! Break it up into smaller functions (literally copy-pasting parts of the parent function into the smaller function and resolving any missing local variables). If they apply unit-testing, again your job will be much easier. By now you will feel as if you wrote the damn thing. -
Something like this? $validator = $model->getValidator(); if (!$validator->isValid()) { $this->display(array('messages' => $validator->getMessages())); }
-
Anyone know what happens to Diamond PHP framework?
ignace replied to Hall of Famer's topic in Other Libraries
They realized PHP only implements half of Java's OO functionalities.. -
The site I made for my friend's new game. Opinions?
ignace replied to mcdan's topic in Website Critique
LOL @ the fake BarackObama post. -
Look at https://github.com/proem/proem/blob/develop/lib/Proem/Api/Signal/Event/Standard.php https://github.com/proem/proem/blob/develop/lib/Proem/Api/Signal/Manager/Standard.php For an example hook system. This has been developed by one of our members: thorpe. If you want to be able to stopPropagation aswell then take a look at https://github.com/zendframework/zf2/blob/master/library/Zend/EventManager/Event.php https://github.com/zendframework/zf2/blob/master/library/Zend/EventManager/EventManager.php Both have many similarities except for the stopPropagation.
-
If your template variable is called $template then pass it through use() $hook->register("hi", function() use($template, $hook) { $template->add("CONTENT", "Hello! I Am A Blog"); }); Or make sure to pass it when calling call_user_func(); $hook->register("hi", function($template) { $template->add("CONTENT", "Hello! I Am A Blog"); });
-
Hello and welcome! Browse through the PHP Coding Help section of the forum and look at some problems people have posted, try to answer some, and look at what others gave as a solution. Be particularly attentive when a member with a Guru/Alumni/Moderator/Admin/.. badge posts a response. These members have been hand-picked for their expertise in one or more area's.
-
hiding .php (or any other) extension with .htaccess
ignace replied to Pain's topic in Apache HTTP Server
http://newmediarts.blogspot.be/2007/01/hide-file-extensions-in-urls-with.html RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php -
Trust me. You don't want me near Photoshop...
-
Thank you Philip exactly the kind of information I was looking for. I'll be sure to reference you when I purchase I also found a designer willing to sell one of his design on his portfolio matching my needs for 250.
-
What do you charge avg/max for a website design? I want a proper design for my own finances system, and I want to hire someone to design it for me, but it's just a side-project so I don't feel like investing 2000+ on it. Before I am going to post in the freelance section I would like to know what to expect.
-
Because "we are getting booty!"
-
The PHP part remains a mistery
-
For future reference: you can also use a backslash as demonstrated by h5bp @ https://github.com/h5bp/html5-boilerplate/blob/master/index.html: <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.7.2.min.js"><\/script>')</script>
-
If you are going to typecast to an object then do so in the constructor (or use an ArrayObject) and not in every method.
-
If you don't have a bachelor's degree but you are, like kicken, over-qualified, just list one. The end justifies the means. At least it might get you in the job interview room. They are not going to fire you because you lied on your interview if you have been delivering good work so far. Just hope they don't find out on day one
-
Well it works in both cases. At least when I tried it. HTML5 boilerplate has had it, I think. I have been wondering about this for years as to why you need to do that. Only recently did I have the courage to go and try to find an explanation on the internet. But nothing has yet turned up, implied knowledge it seems or many are just using it without knowing what it's for...
-
Anybody here that can tell me why you need to write: file_put_contents('file.php', '<' . '?php ..'); document.write('<' + 'script>..</script>'); Instead of just writing <?php and <script ? It works without the concat, so why do I see it in some scripts? I tried Googling but it does not take symbols into account. Anyone of you guys know?