QuickOldCar
Staff Alumni-
Posts
2,972 -
Joined
-
Last visited
-
Days Won
28
Everything posted by QuickOldCar
-
You may have to do a new install for it, then place plugins back one by one.
-
Most likely a bad or outdated plugin causing the issue. FTP into the site and create a new folder, slide all your plugins into it, install plugins back one by one to see the culprit.
-
To me it can eliminate something earlier not allowed before having to call the pecl extension. I'd say check both.
-
Having trouble writing to my database, Help Please :)
QuickOldCar replied to Ashcartwright's topic in PHP Coding Help
So that means will still work because browsers fix thousands of issues, but will show up in a validator possibly? -
There comes a time when people should use current versions, or at least close to current as possible. PHP 7 is right around the corner What's sad is you can only use up to PHP 5.4 in CentOS Using those old versions places your entire server at risk. http://www.sitepoint.com/run-multiple-versions-php-one-server/
-
http://forums.phpfreaks.com/forum/13-php-coding-help/
-
Welcome Do yourself a favor and at least read through the php manual.
-
Most likely need this plugin for the subdomain https://wordpress.org/plugins/options-framework/ You can enable multisites in wordpress and it would share all same files. Is no need to install multiple instances of wordpress. http://codex.wordpress.org/Create_A_Network In the root directory edit wp-config.php define( 'WP_ALLOW_MULTISITE', true );
-
Use the document root /home/content/n/h/i/nhirsch/html/nsp/wp-content/themes/bayside/header.php
-
The best thing to do is talk to this supplier and have them make a csv or an api that clients can access it. Do not know the supplier. There won't be an all around script for such a thing as site scraping is usually specific to a site. I'm sure are programmers here that can make such a script for a price. You can post any jobs in the freelance section
-
Am all for api's, concerning ip lookups they all have limits. Seems the biggest issues are the spammers, at least the bots and indexers could bring you traffic. $remote_ip = $_SERVER['REMOTE_ADDR']; if (strstr($remote_ip, ', ')) { $ips = explode(', ', $remote_ip); $remote_ip = $ips[0]; } $spam_ip = "http://api.stopforumspam.org/api?ip=".$remote_ip; $spamdata = @simplexml_load_file($spam_ip); if ($spamdata) { $spamarray = array(); $spamarray = json_decode(json_encode($spamdata), TRUE); if($spamarray['appears'] == "yes" ){ die('spammer'); } } There are some huge apache rules and lists around which block spammy servers and bots. Just know when start using ip blocks or cidr ranges are blocking a real lot. A robot.txt file can take care of legit bots, the bad ones will ignore it If you want to discover domain names from an ip then match them in an array can use gethostbyaddr() Some other related functions there as well.
-
Just need an advice about job relate with PHP
QuickOldCar replied to sigmahokies's topic in PHP Coding Help
A dedicated server, virtual dedicated server or virtual private server are the better ones in that order, anything shared and could run into limitations. I have had many that say godaddy is horrible hosting, they should stick to domain registrations There is a difference between a web designer and a web developer. A web designer (style and appearance) could be making templates for themes and may use dreamweaver, it's not in any sense ready to use for a website. A web developer (planning and coding) will code a working website such as a cms, add any style or templates to it. I should add that making a html5 template and using css is common. Other routes are using a template engine such as twig or smarty -
Is a few different color related functions this page. http://michaelburri.ch/generate-different-shades-of-a-color/
-
Hansford's post is the right way to do it. Many lines in a file grows too large. Having a file each year actually does less work. You can make multiple text files in a folder with each year and file named as the year. Inside is just a number count. When you add to it are fetching the single number count that is in the file and incrementing it +1 and save. If you do all dates a single file, it would be like an array except the values use a delimiter like a csv. When you access the file would explode the line by it's delimiters and is an array. Using a switch or if/elseif/else when the date matches would increment that count +1 Save the files new data while imploding it with the delimiters.
-
readonly input can not be modified you are using it as a post field which it will always be empty unless you populated it when the form is made If this value exists in database $prospect_id=$test['prospect_id']; <input name="prospect_id" type="text" id="prospect_id" value="<?php echo $prospect_id?>" readonly> If the user is supposed to submit the prospect_id <input name="prospect_id" type="text" id="prospect_id" value="<?php echo $prospect_id?>">
-
If you use the default session handler can change the expire times before starting the session. //every 3600 seconds is an hour ini_set('session.gc_maxlifetime', 7200); session_set_cookie_params(7200); session_start();
-
Maybe you are seeing old results in browser? try clearing the browser cache.
-
file_get_contents doesn't pass a referrer, you would have to make a stream context and them send the current page as a referrer if (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { $scheme = "https"; } else { $scheme = "http"; } $referer = filter_var($scheme."://" . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'], FILTER_SANITIZE_STRING); if (!empty($_SERVER["QUERY_STRING"])) { $referer .= "?" . filter_var($_SERVER['QUERY_STRING'], FILTER_SANITIZE_STRING); } $opts = array( 'http'=>array( 'header'=>array("Referer: $referer\r\n") ) ); $context = stream_context_create($opts); echo file_get_contents("http://short.domain.net?K=ezzyWFRUyhxp", false, $context); Or as the others said have them also pass additional information a url parameter echo file_get_contents("http://short.domain.net?K=ezzyWFRUyhxp&domain=".$_SERVER['HTTP_HOST']); It's best to have accounts set up your site and each account is associated with their website A lot can be spoofed or someone send wrong data, if it's something important should make an api system and track through that. I don't have much time today, but I would be willing to explain some ways with making an api and that a person can not cheat it.
-
Need help posting to mysql and sending email from form
QuickOldCar replied to gabbymiles's topic in PHP Coding Help
@Barand, I know that, shouldn't the script throw an error because multiple lines and no semicolon to end the statement? I just tried it and doesn't throw a parse error. I tend to be more consistent for better readability, like indentations, curly braces, returns and so on. It goes against what they say. As in C or Perl, PHP requires instructions to be terminated with a semicolon at the end of each statement. The closing tag of a block of PHP code automatically implies a semicolon; you do not need to have a semicolon terminating the last line of a PHP block. The closing tag for the block will include the immediately trailing newline if one is present. I would do it all one line. // Define variables and initialize with empty values $txtaddressErr = $txtmainErr = $txtsubjectErr = $txttitle2Err = $txtbusinesstitleErr = $txtaddress2Err = ""; $txtaddress = $txtmain = $txtsubject = $txttitle2 = $txtbusinesstitle = $txtaddress2 = ""; -
Need help posting to mysql and sending email from form
QuickOldCar replied to gabbymiles's topic in PHP Coding Help
define all these with = ""; $txtaddressErr = $txtmainErr = $txtsubjectErr = $txttitle2Err = $txtbusinesstitleErr = $txtaddress2Err =""; $txtaddress = $txtmain = $txtsubject = $txttitle2 = $txtbusinesstitle = $txtaddress2 = ""; Checking if post was submit twice if(isset($_POST['submit'])){ Only need to include this once include ("connect.php"); mysql_* functions are deprecated and being removed in php7. Use pdo or mysqli You should really use the escape functions for any values inserting into the mysql query. -
How Do I Revise Old Code To Work In New Version?
QuickOldCar replied to spock9458's topic in PHP Coding Help
Missed one Email: <a href='mailto:$row['email']'><?= $row['email'] ?></a> to: Email: <a href='mailto:<?= $row['email'] ?>'><?= $row['email'] ?></a> -
How Do I Revise Old Code To Work In New Version?
QuickOldCar replied to spock9458's topic in PHP Coding Help
You are better off not using a comma for concatenation and use a decimal point instead. In some cases like returning from a function a comma won't work. Return will only do a single expression while an echo will do a list. Comma creates a list of expressions for echo, echo concatenates the list when it prints it on one line. A decimal point is the concatenation operator, use that to avoid any future issues. <?php error_reporting(E_ALL); ini_set("display_errors", 1); // Connection to DB $mysqli = new mysqli("localhost", "user", "password", "database"); if ($mysqli->connect_errno > 0) { die('Unable to connect to database [' . $mysqli->connect_error . ']'); } // Retrieve all matching legislators $query = "SELECT * FROM contact_info WHERE branch = 'House' AND district = '10' ORDER BY district"; $result = $mysqli->query($query) or die($mysqli->error . __LINE__); /* determine number of rows result set */ $row_cnt = mysqli_num_rows($result); echo "There are $row_cnt rows in the result."; // Start building the table for showing results using "while" loop echo "<table width='75%' border='0' cellpadding='10' cellspacing='0' bgcolor='#f0f0f0' style='margin-left:100px; margin-bottom:20px'>"; // Here is the "while" loop while ($row = $result->fetch_array(MYSQLI_ASSOC)) { // Print out the contents of each row into a table row echo "<tr valign='top'><td width='45%'><b>"; echo "House District: </b><font color='red'>" . $row['district'] . "</font><br>"; echo $row['first_name'] . " " . $row['last_name'] . "<br>"; echo $row['address'] . "<br>"; echo $row['csz'] . "</td>"; echo "<td width='55%'><b>County(ies): </b><font color='red'>" . $row['county'] . "</font><br>"; echo "Capitol Phone: <font color='green'>" . $row['cap_phone'] . "</font><br>"; echo "Office Phone: <font color='green'>" . $row['bus_phone'] . "</font><br>"; echo "Home Phone: <font color='green'>" . $row['home_phone'] . "</font><br>"; echo "Email: <a href='mailto:" . $row['email'] . "'>" . $row['email'] . "</a></td></tr>"; } echo "</table>"; ?> -
php mysql rollback the transaction when user abort the connection
QuickOldCar replied to madura31's topic in MySQL Help
InnoDB supports rollback but I think you should do all the checks prior and have the file before you do any insertions. -
Convert from text file to html table using php.
QuickOldCar replied to Tyka95's topic in PHP Coding Help
Always like seeing your full explanations Jacques