505 Posted Topics
Re: I'm not aware of a definitive method for preventing direct access to the test1.php script. The issue is that it is being requested from the client side by the frame, in the same way as it would be accessed via a direct request. If you were including it on the … | |
![]() | Re: > Is PHP cross-browser? > http://stackoverflow.com/questions/2118755/questions-every-good-php-developer-should-be-able-to-answer#answer-2118910 :) |
![]() | Re: Something like this should work. The `/` at the beginning and end of the pattern are delimiters. The `^` denotes the start of the line or string. The `$` denotes the end of the line or string. Thus everything between the `^` and `$` must match the expression, as opposed … ![]() |
Re: Iterate through the array using a for loop, but start at the highest index and decrement. | |
Re: Can you post a link to the slider API? Also, the reel is set to `display:none;` on line #517. Removing that gets the images to display. However, without seeing the API it's hard to know whether that's something the slider should be doing (without trawling through the JS source too). | |
Re: Do you mean a <select> element? If so, no, not with the traditional element. It opens up or down based on the current scroll position and space required to display the options. If you mean another type of drop down, e.g. <ul> elements, then yes. Please post your code. | |
Re: Start by writing a standard PHP script that can accomplish the tasks you have outlined. This can then be secured so it can only be called from the CLI, if required. Once that's working, here's a [post](http://www.thegeekstuff.com/2011/07/php-cron-job/) I found at the top of the Google results for "php cron task", … | |
Re: Rightly or wrongly, I usually use the init action. /** * Load stylesheet and scripts. * * @return void */ function load_styles_scripts() { // Register stylesheets wp_register_style('custom', get_bloginfo('stylesheet_directory') . '/stylesheets/custom.css'); wp_enqueue_style('custom'); // Register scripts wp_register_script('custom', get_bloginfo('stylesheet_directory') . '/javascripts/custom.js'); wp_enqueue_script('custom'); } add_action('init', 'load_styles_scripts'); | |
Re: You've outputted HTML to the page before calling session start. To resolve the problem, you need to call `session_start();` at the beginning of your file. Or you could try something like: <?php session_start(); $_SESSION['views'] = isset($_SESSION['views']) ? $_SESSION['views'] + 1 : 1; ?> <div class='sfm_cr_box' style='padding:3px; width:350px'> <hr /> <div … | |
Re: No, you're right to use z-index. But z-index only works when the element to which it's applied is positioned. Try: .class_div{ position: absolute; border: 100px solid; width:100px; height:50px; left:0px; z-index:1; } .class_span{ float: left; position:relative; z-index:2; } | |
Re: function goto(id) { if (id == "form") window.location = 'http://localhost:8080/form_2.php'; } This is your problem. On form submission, you're redirecting the user to form_2.php, rather than processing the form submission itself. | |
Re: I came across this class a while back and have found it to be very useful. http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/ | |
Re: You're correct that you need to use JavaScript to capture the change event on the select element. You then need to use AJAX to send an asynchronous request to the server for information. I would suggest using a JavaScript framework to do the heavy lifting for you. My JavaScript framework … | |
Re: If you post your code, we can help you with specific problems. If you're looking for someone to write the code for you, you might be better posting it in the Jobs forum and hiring a developer. | |
Re: I'm not sure I understand the problem. Are you talking about creating an HTML table? If so, you can ensure even columns by explicitly setting a column width. And if you omit a row height, the row will automatically expand to enclose the cell content. ![]() | |
Re: Please post your code and say where you're having problems. | |
Re: The class cannot be found, which hints that you may not have the correct extensions installed and/or enabled. Have you ensured the XML and XSLT libraries are enabled in your php.ini file? See the [manual](http://www.php.net/manual/en/xsl.setup.php) for requirement details. | |
Re: Use `var_dump` instead. This will allow you to determine whether `json_decode` is returning `null` because the JSON cannot be decoded. If you're pulling the data from a database, did you add slashes or anything when inserting? | |
Re: `RewriteCond %{REQUEST_URI} !/admin/.*$` | |
Re: >What is the best free php host? Remember - you get what you pay for... | |
Re: This is a complete shot in the dark, but seeing as you've had no other replies, I'll post it anyway. This [post](http://sonit181083.wordpress.com/2011/08/25/solution-to-php-imap_open-invalid-certificate-failure-self-signed-certificate-or-untrusted-authority/) references the solution for self-signed certficates as being: `$server = '{mail.booksnearby.in:143/novalidate-cert}INBOX';` | |
Re: Working on the basis that your directory and file structure is as follows: / .htaccess Client/ index.php Try: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule Client/([^/]+) Client/index.php?clientname=$1 [L] You may also need to disable MultiViews, as the Client directory may be getting matched by mistake. You can do … | |
Re: To redirect a user to a new page, the server needs to send response headers. Likewise, when you output content to the page, the server needs to send response headers. Response headers can only be sent once. On line 68, you're displaying the message "You have successfully logged in!" - … | |
Re: The indexes in the `$_POST` array on lines 2 - 6 are undefined until the form has been submitted. You could replace each line with: $first = isset($_POST['first']) ? $_POST['first'] : null; $last = isset($_POST['last']) ? $_POST['last'] : null; $email = isset($_POST['email']) ? $_POST['email'] : null; $phone = isset($_POST['phone']) ? … | |
Re: You would need to set the worksheet orientation through whatever Excel library you're using, not through the response headers. PEAR and PHP Excel are two such libraries, both which support page orientation. | |
![]() | Re: Can you confirm whether the PHP code appears immediately before the HTML code in the same file, addinfo.php? ![]() |
Re: Certainly older versions of Internet Explorer will choke on CSS declarations without a value. Other browsers may encounter issues too. The SEO of a site should have nothing to do with CSS. As far as I am aware, it's only the HTML markup that is considered - e.g. semantics, etc. … | |
Re: Glad you solved your problem. And thank you for taking the time to post the solution. | |
Re: You're also missing a semi colon after mysql_close(); | |
Re: It might help if you were a little more descriptive about the problem, other than "not ok"... | |
Re: The original string is for a JSON encoded **object** not an **array**. To use the output as an array, you would need to convert it to an array. Notice the second argument for `json_decode` is `true`. var_dump(json_decode($json, true)); | |
Re: The [example image URL](http://www.powerme.edu/me/images/faculty/70_70/gkumar_2012.jpg) you provided wouldn't load even when accessed directly. Have you checked that your images have 644 permissions? | |
Re: What is the relationship between the keys and values in the $words_assoc array? ![]() | |
Re: I wasn't aware that you could use logic in switch case statements. Have you tried if / else if / else blocks? if($interval > 0) $message .= $item_101_product_title . '<br />'; elseif($interval > 21) $message .= $item_102_product_title . '<br />'; elseif($interval > 53) $message .= $item_103_product_title . '<br />'; elseif($interval … | |
Re: When referencing class instance variables, you need to do so as follows: $this->errorFile = ERROR_FILE; | |
Re: If you want it to be dynamic, pass all of the form values as a single array and use the `array_sum` function: <form method="post" action="sum.php"> <input type="text" name="sum[a]" /> <input type="text" name="sum[b]" /> <input type="text" name="sum[c]" /> <input type="text" name="sum[d]" /> <input type="text" name="sum[e]" /> <input type="text" name="sum[f]" /> <input … | |
Re: I would suggest you iterate through the `$_POST['radio']` array. E.g.: // Attempt to retrieve answers $answers = isset($_POST['radio']) ? $_POST['radio'] : array(); // Iterate through each answer foreach($answers as $question_id => $answer) { echo "Q{$question_id}: {$answer}<br />"; } | |
Re: The site is probably using something like this: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule view/(.*) images/$1 [L] | |
Re: If the other session data is correct, then the key must be getting regenerated on every page request. Without actual code to review, it's impossible to help any further. | |
Re: Or seeing as PHP will already parse the entire string because you're using double quotes, you could avoid string contatenation and just include the parameter directly in the string: $Totalt = 'abc123'; $table1 = "<div id=\"container\"><table id=\"table-3\" cellspacing=\"0\"><thead><tr><th>{$Totalt}</th><th>{$Totalt}</th><th>Benchmark</th><th>Differans</th></tr></thead><tbody>"; | |
Re: If you're new to PHP, read the docs at PHP.net. For this specific problem, try the [sort](http://php.net/manual/en/function.sort.php) function. $a = array(12,5,78,10,63,11); sort($a, SORT_NUMERIC); // $a = array(5,10,11,12,63,78); | |
Re: How about something like: <a href="/mail-to.php?email=hello@world.co.uk" title="Email hello@world.co.uk">hello@world.co.uk</a> # mail-to.php // Retrieve email address $email = isset($_GET['email']) ? $_GET['email'] : false; // Validate email address? // Update database if($email) header("location: mailto:{$email}"); die('Invalid email address'); | |
![]() | Re: How about: foreach($futures as $index => $elements) { echo "Layer {$index}<br />"; foreach($elements as $element) { echo "{$element[0]} | {$element[1] | {$element[2]}<br />"; } } |
Re: **Misread your question. I'll leave my answer here for those who are looking for the same, but with a timestamp column** You can either select the timestamp from MySQL returning it in the format you desire - see [FROM_UNIXTIME](http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_from-unixtime) SELECT FROM_UNIXTIME(`timestamp`, '%Y %D %M') AS `date FROM `table`; -- 2007 … | |
Re: Your context is off. You have a click action on a.header elements. When you're in the function for that click event, the context of $(this) changes to the a element, not the parent list. The unordered list is therefore a sibling, not a child of the a element. Try: $(function() … | |
![]() | Re: Yes, a function can have more than one default parameter value. You can call such functions as follows: `function func(1, 2, 3); // A, B, C` `function func(1, 2, null, 4); // A, B, C (default), D` Notice that you have to explicitly pass the default value for C if … |
The End.