-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
To get the links to go different website addresses, you'll need to run some sort of if test. Perhaps you could use the $j variable to determine which link to show. For example: <?php echo '<a ' . colors('a'); if($j ==0) { echo ' href="https://www.absolutept.com/tendinopathy/" class="link">Tendinopathy</a>'; } elseif($j==1) { echo ' href="https://www.absolutept.com/neuropathy/" class="link">Neuropathy</a>'; } elseif($j==2) { echo ' href="https://www.absolutept.com/personal-training/personal-training-faqs/" class="link">Personal Training FAQ</a>'; } else { echo ' href="https://www.absolutept.com/blog/" class="link">Chad\'s Blog</a>'; } ?> Just keep in mind that if you modify the WordPress theme files directly, you'll need to re-make all the changes every time the theme developer pushes an update. To minimize the effect, you could create a Child Theme: https://codex.wordpress.org/Child_Themes
-
The backslashes don't seem to cause any problems; at least they worked when I tested the query through PHPMyAdmin. Note that the query could also be written as UPDATE `ipb_core_members` SET `signature` = replace(signature, '<p style="text-align:center;"> </p>', '') Are the empty paragraph tags written exactly like <p style="text-align:center;"> </p> If there is more than one space between the open and close tag, for example, the query won't replace anything.
-
Is the script that processes the form submission set to detect whether the fields are numeric? Perhaps the script only generates a Word document when all the form fields pass the required validation steps. Are you able to post the code which process the form submission?
-
How did you run the query? Did you run it through a PHP script...or directly in something like phpMyAdmin?
-
For what it's worth, you could avoid all the elseifs and cases by creating an array of possible values...and then testing for the existence of a value. For example: <?php $pageReferences = array( '1' => 'page.php', '1-1' => 'page.php', '1-2' => 'page.php' ); $link = $_GET['page']; if(isset($pageReferences[$link])){ include $pageReferences[$link]; } else { include 'home.php'; } ?>
-
Is PHP set to show all errors and warnings? To make sure, you can add the following to the top of your script during the debugging process: <?php error_reporting(E_ALL); ini_set('display_errors', 1); ?> Also note that file_put_contents() "returns the number of bytes that were written to the file, or FALSE on failure." Have you checked to see what the function returns?
-
Try removing the "enctype" attribute from the open form tag.
-
how do I do the multiplication table for php?
cyberRobot replied to xaznbabyx's topic in PHP Coding Help
Have you looked into using HTML form data with PHP? A quick example can be found here: http://php.net/manual/en/tutorial.forms.php -
As mac_gyver mentioned, it would be helpful to know the errors. One thing that I noticed is that your select box is named "discipline" <select name="discipline"> And the code that processes the form submission uses "user_discipline" as the index for $_POST $user_discipline =mysqli_real_escape_string($conn,$_POST['user_discipline']);
-
Note that you could also consider running the query outside of the loop. Instead of using $rowshow, you probably could just use the GET variable that was assigned to $id. $updatestatus = mysql_query ("UPDATE inv SET updatestartdate='$updatestartdate', updateenddate='$updateenddate', status='$status' WHERE id='".$id."'") or die ("updatestatus Error"); Of course, you would want to verify that $id contains an expected value to avoid SQL injection attacks.
-
Are you only looking to update the record which matches $id? If so, try changing this if (isset($_POST['Update']) and $_POST['Update'] == 'dataupdate'){ To this if (isset($_POST['Update']) and $_POST['Update'] == 'dataupdate' and $id==$rowshow['id']){
-
Help change the color of my drop-down when selected
cyberRobot replied to Chrisj's topic in CSS Help
The blue background comes from the browser showing which option is selected. To be honest, I'm not sure how you would override the color. I would imagine that it involves using JavaScript to detect which <option> tag is selected. Then applying a background color to that tag and remove the color from the other <option> tags. -
Need help to select the funder with the second highest percentage
cyberRobot replied to jmp98's topic in PHP Coding Help
You could create a second set of variables to hold the second highest number. Then whenever there is a new higher number, the old highest number becomes the second highest. You could try something like this: $highest=0; $highest_id=0; $second_highest=0; $second_highest_id=0; //... if($highest < $percent && $percent < 100) { //THE HIGHEST NUMBER IS NOW THE SECOND HIGHEST $second_highest = $highest; $second_highest_id = $highest_id; //STORE NEW HIGHEST NUMBER $highest = $percent; $highest_id = $list_id; } -
Have you looked through the documentation for number_format()? http://php.net/manual/en/function.number-format.php The first example shows how to use the function with variables. You'll want to use the function in the echo statement. Also note that the column tags should be surrounded by the row tags. Your script currently outputs the columns and then the row.
-
Have you looked into using CSS to hide the normal border of the fields? You can then add a <span> tag around the fields. CSS can then be added to the <span> tag to place a border around both fields to make them look like a single field.
-
Was it intentionally left blank...or is that something you're looking to fix? You can. You just need to run a test in your loop that builds the <option> tags. The test would check if the current <option> tag being built matches the one you are looking for. When a match is found, add the "selected" attribute.
-
While browsers do what they can to fix problems, they don't always get it right. It's best to validate your pages so it's one less variable you need to worry when something unexpected happens. For anyone interested, the following page provides some reasons to validate your code: https://validator.w3.org/docs/why.html
-
Did you scroll down to the "Source Listing" section? When I click on the W3C link provided in you post, I see content between the open and close table tags. Note that you need to include the GET variables when validating the other versions of the page. If you want to test the gallery_album page, for example, the validator needs the full link (including the GET variables): http://przembud.itecore.com/?page=gallery_album The validation results for the gallery_album page can be viewed here: https://validator.w3.org/check?uri=http%3A%2F%2Fprzembud.itecore.com%2F%3Fpage%3Dgallery_album&charset=%28detect+automatically%29&doctype=Inline&ss=1&outline=1&group=0&No200=1&verbose=1&st=1&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices
-
php code isn't getting executed,only the code in form tags are?
cyberRobot replied to snb2990's topic in PHP Coding Help
Side note: Surrounding form labels and form fields with <label> tags improves the accessibility of your website to visitors using assistive technologies like screen readers. <label>Name: <input type="text" name="name"></label> <label>password: <input type="password" name="password"></label> More information about the <label> tag can be found here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label More information about the accessibility of the <label> tag can be found here: http://webaim.org/techniques/forms/controls -
Try using a column alias. SELECT o.id AS orderID, The alias would be used in your loop like this: $id = $row['orderID'];
-
How can I find the CSS used in a form from a web page?
cyberRobot replied to simonp's topic in CSS Help
Which browser (Chrome, Firefox, etc.) do you use? In Chrome, for example, you can right click things like the submit button and click "Inspect Element". This opens the Developer Tools panel, highlights the HTML code for the element you right clicked, and shows the associated CSS in the Styles tab. More information about the Chrome Developer Tools panel can be found here: https://developer.chrome.com/devtools