hansford
Members-
Posts
562 -
Joined
-
Last visited
-
Days Won
4
Everything posted by hansford
-
$ids = array(); foreach($menu as $array) { $ids[$array['id']] = $array; } ksort($ids); $menu = array_values($ids); print_r($menu);
-
localhost url with project and sub-project name
hansford replied to jason_15's topic in PHP Coding Help
What results are you expecting? dirname() // returns the path to the parent directory of the passed path value -
PHP file_get_contents for lazy loading websites
hansford replied to ChiragJhaveri's topic in PHP Coding Help
If they waned their content to be shared they would have an API which you could tap into. Site scraping can open you up to legal battles etc.. Not a place a legitimate web development operation wants to be. -
Pulling values from a table using HTML form select option
hansford replied to basil60's topic in PHP Coding Help
If you absolutely need the html extension you can add an .htaccess file to the folder with the following code: RewriteEngine on RewriteRule ^(.*)\.html $1\.php However, simply naming it with the correct extension would be the better option. -
Make a connection to the database. Query the database for the information you require. Then use a loop to display each row returned from the query. <?php $con = new PDO('fill in information here'); $sql = "SELECT image_url, project_name, email, skype_id FROM TableName"); foreach($con->query($sql) as $row) { ?> //html mixed with embedded PHP code goes here //where you need to grab something from the database to fill in the blanks use: //<?php echo $row['image_url']; ?> etc etc }
-
Sounds like you are in over your head. As the Admin told you, you need to add a password field to the form. <tr><td><label class="">User Password</label></td><td><input type="password" name="userpass" id="userpass" width="200" value="<?php echo $memberedit->password;?>" onblur="checkPass(this.value)"></td></tr> You should actually have two fields...one for the password and another to confirm that they typed the password in correctly. You are then going to need to write a javascript function checkPass() to validate the password for acceptable length, chars etc. You will need to fill in the password form value from the database just as the code does with the other field values. You will need to add additional sql to update the database with the password field value. It looks like the admin gets sent an email after an update, so depending if he wants to know the password used, you will have to add this to the email form as well.
-
I don't know what you plan on loading the pdf file into. I used an iframe as an example. If you wanted the whole page to open the pdf file you could just use: document.location = selection; <H3><B>My Notes</B></H3> <select name="mymonth" id="mymonth"> <option value="" selected>Select Pdf File</option> <option value="FF_Mar06.pdf">Mar 20</option> <option value="FF_Mar13.pdf">Mar 13</option> <option value="NotAvail.pdf">Mar 06</option> </select> <script type="text/javascript"> var pdfSelect = document.getElementById('mymonth'); pdfSelect.addEventListener('change', function() { var selection = this.options[this.selectedIndex].value; var frame = document.getElementById('pdf_frame'); frame.src = selection; }); </script> <br /> <iframe id="pdf_frame" src="" width="100%"></iframe> </body>
-
It works fine. You just need to call the load() function like so: window.onload = load;
-
Any ideas on how you implement a button that you can gaze at and click. I built the app using JavaScript, but I have no clue on this magic button thing. Thanks
-
Retaining apostrophes in email subject line
hansford replied to ohboyatoytruck's topic in PHP Coding Help
Requinix is right - post the rest of the code. And is the charset set to match the chars in the database. Content-Type: text/html; charset=utf-8 -
Passing variable to php script for google charts
hansford replied to Kris1988's topic in PHP Coding Help
<form> <select name="users" onchange="showUser(this.value);drawChart();"> you call it drawChart() but pure JavaScript - not jQuery which is your ajax call. Re-post in the JavaScript forum. -
Where is your development site. Two sites - exactly the same - one to screw up, test etc and one for the public.
-
Nothing weird - perfectly normal - do the research.
-
echo html_entity_decode('—', ENT_COMPAT, 'UTF-8');
-
You can throw errors all day long - don't waste the time. A critical error - DB ect - log it - but there is zero recovery - tell your users - 'hello' is about it. Another less critical-error - ok, continue on with a polite message. But - error checking every thing will just drive you crazy and won't do anything in the end.
-
Retaining apostrophes in email subject line
hansford replied to ohboyatoytruck's topic in PHP Coding Help
And is the data coming from the database. Character corruption. -
Welcome #2 You are a programmer - no gentle for you lol
-
Croatia! - hold on...let me Google that lol Welcome.
-
Over my head as well - Jacques - concrete example in PHP.
-
use preg_match()
- 8 replies
-
- php
- contact form
-
(and 1 more)
Tagged with:
-
Post the code.
-
Ugly, but great question - we will find you an answer.
-
That is not an htaccess file
-
Passing variable to php script for google charts
hansford replied to Kris1988's topic in PHP Coding Help
async: false, Remove that line - you want it to be async. Set a change handler on the drop down to call the ajax every time a change occurs and update the data.