-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
Ahh...it looks like IE11 doesn't like the comma. Try adding a semi-colon between the "10" and your website address...like the following: <meta http-equiv="refresh" content="10; URL=http://www.google.com/"> More information about the meta refresh tag and its syntax can be found here: http://www.w3.org/TR/WCAG20-TECHS/H76.html
-
The following <meta> tag works for me: <meta http-equiv="refresh" content="10 ,URL=http://www.google.com/"> One thing that I noticed is your <meta> tag uses "http://www.desmond-otoole.co.uk/". But the text in your <h1> tag says the address is "www.des-otoole.co.uk". Which address is correct?
-
Showing a message can be useful for those that link to / bookmarked the old address. Hopefully they will see the message and correct their link(s) / bookmark(s). It's easier to miss the address change if you instantly direct them to the new location.
-
getting 500 internet server error while using php email
cyberRobot replied to Goinfory's topic in PHP Coding Help
You could try something like this: <?php //CONNECT TO DATABASE $con = mysqli_connect("host","database","password"); if (!$con){die('Could not connect: ' . mysqli_error($con));} mysqli_select_db($con,"database"); //GET EMAILS $sql = "SELECT email FROM emails WHERE id <= 600 AND email IS NOT NULL"; $result = mysqli_query($con,$sql); while($row = mysqli_fetch_assoc($result)) { echo $row['email']; } //CLOSE DATABASE mysqli_close($con); ?> Note: if you're not doing so already, you'll want to look into storing you're database connection script in an external file and use something like require_once() to import it. That way when you want / need to change the database login credentials, you'll only need to change it once. -
Have you tried contacting the plugin author?
-
You currently use getcwd() to define $dirpath: $dirpath = realpath(dirname(getcwd())); That function returns the working path. More information can be found here: http://php.net/manual/en/function.getcwd.php You'll need to find an alternative way to add the domain name. You could start here: https://www.google.com/search?q=php%20get%20domain%20name&rct=j Or...have you tried using a root-relative link? Instead of "http://ebsp.comt/uploads/filename", you could try "/uploads/filename".
-
If you wanted to move the starting point (y-position) down by 15 every time, you could do something like this: <?php //... imagestring($image, $fontsize, $leftside, $linedown, ($key+1).'..' . $driver, $font_red); //UPDATE Y-POSITION FOR NEXT LOOP ITERATION $linedown += 15; } ?>
-
The fourth argument for imagestring(), where you have $linedown, should represent the y-position for your text. As far as I can tell, that value isn't being changed for each iteration of the loop. Also, I would image that the call to imagestring() for the "Top 5 Drivers" header should be made outside the loop. Otherwise the header is added for every entry in $rows.
-
creating a Link to customers page using search
cyberRobot replied to moosey_man1988's topic in PHP Coding Help
Is PHP set to show all errors and warnings? Note that you can add the following to the top of your script(s) during the debugging process to show them: error_reporting(E_ALL); ini_set('display_errors', 1); Is $customer being set anywhere else in the script...besides when the "customerRef" GET variable is passed? Assuming it's not, you'll want to enclose all the statements involving $customer in that if construct. Note that you'll also want to use isset() in the if construct to avoid an undefined index warning. //IF CUSTOMER REFERENCE WAS PASSED, PROCESS IT if(isset($_GET['customerRef'])) { $customer = explode('~',$_GET['customerRef']); echo $customer[0]; //should be prefix echo $customer[1]; //should be custid $vars = $customer[1]; echo $vars; ///ELSE...SKIP PROCESSING / DISPLAY ERROR } else { echo '<p>GET variable is missing...</p>'; } -
Welcome and congrats on the nearly finished degree!
-
Have you tried using the WHERE clause? http://www.techonthenet.com/mysql/where.php If I'm understanding the problem correctly, you basically need to get the results WHERE the dealer ID is equal to the one chosen.
-
It looks like you're calling the mail() function twice. mail($to, $subject, $message, $headers); mail ($email, $subject, $message, "from:".$from); The second call was probably left in there by mistake.
-
Instead of using file_get_contents() here: if (file_get_contents($site_a) !== FALSE) $image = $site_a; else if (file_get_contents($site_b) !== FALSE) $image = $site_b; You could try using file_exists(), like you did before.
-
Just to clarify, are we still trying to get the following if/elseif/else structure working? if (isset($_GET['user'])) { $user = $_GET['user']; $skin = @imagecreatefrompng("http://halcyon-pvp.fr/skins/$user.png"); } elseif (isset($_GET['user'])) { $user = $_GET['user']; $skin = @imagecreatefrompng("http://skins.minecraft.net/MinecraftSkins/$user.png"); } else { // If skin could not be retrieved, display Steve $skin = imagecreatefrompng($default_skin_url); } Or do you have different code now?
-
If you always want the last part to take place when the first two parts fail, you'll want to use "else". <?php if (isset($_GET['user'])) { $user = $_GET['user']; $skin = @imagecreatefrompng("http://halcyon-pvp.fr/skins/$user.png"); } elseif (isset($_GET['user'])) { $user = $_GET['user']; $skin = @imagecreatefrompng("http://skins.minecraft.net/MinecraftSkins/$user.png"); } else { // If skin could not be retrieved, display Steve $skin = imagecreatefrompng($default_skin_url); } ?> Note that you don't indicate a condition with else.
-
Try changing this else (!$skin) { To this elseif (!$skin) {
-
You could test for the existence of a record before inserting a new record. If one exists, use update. Otherwise, use insert.
-
It may help to know what changes were made that caused the script to break. Are you getting any JavaScript errors? Note that you can right-click a page (on Windows) in Google Chrome and click "Inspect element" to view the Developer Tools panel. You can see if there are any JavaScript errors under the "Console" tab. Firefox and Internet Explorer also have a "Console" tab that can be accessed in the same way as Chrome. I'm just not as familiar with that feature in those browsers.
-
It kind of sounds like you're looking to populate a page based on a form submission. If that's the case, the PHP manual has a quick example here: http://php.net/manual/en/tutorial.forms.php
-
Try changing this $headers = 'From: reply.info@xxxxxx'. "\r\n" . $headers .= 'Reply-To: xxxxxxx' . "\r\n" . $headers .= 'Cc: admin@wxxxxx.ninja' . "\r\n" . X-Mailer: PHP/' . phpversion(); To this $headers = 'From: reply.info@xxxxxx'. "\r\n"; $headers .= 'Reply-To: xxxxxxx' . "\r\n"; $headers .= 'Cc: admin@wxxxxx.ninja' . "\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); Note that I replace the concatenation characters at the end with semi-colons. I also added the opening single quote for the "X-Mailer" header. By the way, you don't need to include the "Reply-To" address and the "X-Mailer" header...unless you need them.
-
As ginerjm indicated, $from doesn't look to be define. With that said, the "From" address is defined in $headers...so the fifth argument can be removed altogether. Side note: you define two variables which I assume contain the "To" address here: $email="info@xxxxxxninja"; $to ="info@xxxxxx.ninja"; However, the mail() function uses the $email variable. So technically you don't need both variables.
-
The "Cc" and "From" information need to be included as the fourth argument (where you have $headers). Example #2 in the documentation for mail() should help show you how. http://php.net/manual/en/function.mail.php
-
You could try something like this: //IF POST OR GET METHOD WAS USED if(in_array($_SERVER['REQUEST_METHOD'], array('POST', 'GET'))) { //DETERMINE WHICH FILTER TO USE $howToFilter = ($_SERVER['REQUEST_METHOD']=='POST') ? INPUT_POST : INPUT_GET; //GET INPUT $input['a'] = isset($_REQUEST['a']) ? filter_input($howToFilter, 'a', FILTER_SANITIZE_STRING) : NULL; }
-
can anyone help me with a full php -mysql project to learn
cyberRobot replied to s_pahari's topic in PHP Coding Help
What do you need help with? Is there a specific task you are trying to accomplish? Do you have any code to look at? Note that if you post code, please surround it with tags. It will make your post and code easier to follow.