505 Posted Topics

Member Avatar for jeffadrian

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 …

Member Avatar for shlokka
0
163
Member Avatar for iamthwee

> Is PHP cross-browser? > http://stackoverflow.com/questions/2118755/questions-every-good-php-developer-should-be-able-to-answer#answer-2118910 :)

Member Avatar for blocblue
0
116
Member Avatar for arcticM

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 …

Member Avatar for arcticM
0
155
Member Avatar for laura301019

Iterate through the array using a for loop, but start at the highest index and decrement.

Member Avatar for blocblue
0
195
Member Avatar for din3sh

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).

Member Avatar for din3sh
0
334
Member Avatar for jshesek

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.

Member Avatar for jshesek
0
142
Member Avatar for gauravbhandari

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", …

Member Avatar for extjac
0
215
Member Avatar for dany12

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');

Member Avatar for blocblue
0
211
Member Avatar for vishalonne

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 …

Member Avatar for vishalonne
0
360
Member Avatar for kamil_hism

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; }

Member Avatar for blocblue
0
189
Member Avatar for JameB

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.

Member Avatar for JameB
0
172
Member Avatar for smokewpn
Member Avatar for trektrak

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/

Member Avatar for blocblue
0
229
Member Avatar for dourvas

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 …

Member Avatar for blocblue
0
158
Member Avatar for combat.mz

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.

Member Avatar for vinay7868
0
110
Member Avatar for goody11

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.

Member Avatar for diafol
0
355
Member Avatar for ssembusi.david
Member Avatar for shhh

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.

Member Avatar for blocblue
0
238
Member Avatar for Danny159

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?

Member Avatar for Danny159
0
198
Member Avatar for bsewell
Member Avatar for Sanchixx
Member Avatar for Sanchixx
1
93
Member Avatar for kutchbhi

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';`

Member Avatar for blocblue
1
849
Member Avatar for anita.kcx

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 …

Member Avatar for blocblue
0
126
Member Avatar for viktor.jiracek.5

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!" - …

Member Avatar for puneet bassi
0
273
Member Avatar for carol.cable.37

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']) ? …

Member Avatar for blocblue
0
317
Member Avatar for ecinevenice

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.

Member Avatar for blocblue
0
181
Member Avatar for LastMitch

Can you confirm whether the PHP code appears immediately before the HTML code in the same file, addinfo.php?

Member Avatar for LastMitch
0
218
Member Avatar for keyroche

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. …

Member Avatar for keyroche
0
161
Member Avatar for rob.peters.1257
Member Avatar for blocblue
0
193
Member Avatar for rayidi
Member Avatar for Pidgetastic
Member Avatar for McLaren

It might help if you were a little more descriptive about the problem, other than "not ok"...

Member Avatar for McLaren
0
89
Member Avatar for rayidi

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));

Member Avatar for blocblue
0
358
Member Avatar for smoothe19

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?

Member Avatar for blocblue
0
129
Member Avatar for latooplat
Member Avatar for diafol
0
84
Member Avatar for calvinmicklefin

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 …

Member Avatar for calvinmicklefin
0
185
Member Avatar for spowel4

When referencing class instance variables, you need to do so as follows: $this->errorFile = ERROR_FILE;

Member Avatar for spowel4
0
191
Member Avatar for rrajgor
Member Avatar for phpHelp

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 …

Member Avatar for phpHelp
0
199
Member Avatar for phpHelp

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 />"; }

Member Avatar for phpHelp
0
2K
Member Avatar for phorce
Member Avatar for Khav

The site is probably using something like this: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule view/(.*) images/$1 [L]

Member Avatar for Khav
0
324
Member Avatar for NZSnowMan

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.

Member Avatar for Melarlo
0
258
Member Avatar for adishardis

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>";

Member Avatar for blocblue
0
125
Member Avatar for vasvigupt

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);

Member Avatar for Que336
0
277
Member Avatar for ronhymes

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');

Member Avatar for ronhymes
0
197
Member Avatar for LastMitch

How about: foreach($futures as $index => $elements) { echo "Layer {$index}<br />"; foreach($elements as $element) { echo "{$element[0]} | {$element[1] | {$element[2]}<br />"; } }

Member Avatar for blocblue
0
364
Member Avatar for devilhacker

**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 …

Member Avatar for pritaeas
0
264
Member Avatar for Violet_82

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() …

Member Avatar for Violet_82
0
89
Member Avatar for arcticM

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 …

Member Avatar for blocblue
0
134

The End.