Is str_replace supposed to work when the subject (haystack) is an array of arrays, not just a simple array?
Here's an example:
$old_array[0] = array("needle1","needle2","needle3");
$old_array[1] = array("needle4","needle5","needle6");
$new_array = str_replace("needle","pin", $old_array);
echo...
Is there any reason the following setup wouldn't be secure?
Server 1:
- Shopping cart system that accepts credit cards.
- ASP, IIS, unknown database, SSL.
- I have very little access to this server.
Server 2:
- Used to customize additional content for Server 1 (cannot be done on Server 1...
I have a PHP site on a shared host (PHP version: 5.3.3-7.1+hw2). The session variables (e.g.: $_SESSION["some_variable"]) usually time out too fast (under 5 minutes). On the local test server (PHP 5.4.10) there is no problem.
The hosting tech support guys are no help.
phphinfo (below) shows...
I'm trying to loop through an array of variable names to grab values from a form and assign the values to variables. It's not working--none of the form values get picked up. Here's what I've tried:
$field_list = array("field1","field2",etc.)
foreach ($field_list as $value)
{
$$value =...
My ASP website connects to a remote MySQL server like this:
connectstring = "Driver={MySQL ODBC 3.51 Driver}; Server=myserverip; Port=3306; Database=mydbname; USER=myusername; PASSWORD=mypassword;"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(connectstring)
After...
Documentation for T-SQL says that the conversion from varchar to money is implicit (http://msdn.microsoft.com/en-us/library/ms187928.aspx see chart about 1/3 down the page).
But, when I try inserting into a money column like this:
sql = "INSERT INTO myTable (myMoney) VALUES ('" &...
I've got to update records in a table containing about 210,000 records and I'm curious if different versions of the query will make much difference in the time it takes to execute.
Specifically, is it better to use IN with a subquery that returns a large recordset or NOT IN with a subquery...
I'm working on an CSS menu but I've hit a couple of problems:
1) I want the links to work and the text color to change when rolling over anywhere in a <li>. RIght now, this only happens if the cursor is over the text. Is there some way to do this with CSS only (no images and no Javascript)? I...
I want queries and their results to cache, but get updated once per day.
I was going to use PHP to add a sort of dummy date string to queries, so that they change every day:
"start of query WHERE ".date("d") = date("d")." AND rest of query"
But I don't want to kludge all my queries. There...
I've got an ASP page that retrieves and displays text from a MySQL5 DB. The text is in English and Japanese. Works fine on the production server. On the development server the Japanese displays as gibberish (E.g., €šã‚‚ç´?å¾—ã?®å“?ã?žã‚?ã?ˆã?¨ï¼“æ‹?å ?ã??ã‚?ã).
The page uses the same connection...
I'm using XMLHTTP to load the output of an ASP page that contains dynamically created CSS. The CSS modifies existing CSS that is imported to the head section via @import. The ASP page gets data from a MySQL database on a different host.
JavaScript is the only scripting language available in the...
I am using MAMP (version 1.7) to test PHP sites locally. I set up an alias in the Apache http.conf file. It works properly when I am browsing the directories, but includes in my PHP files don't work.
E.g., if I set an alias like this
Alias /mysite.com/website/aliasfolder/...
I have several PHP sites which use common code (about 90% of the code is the same). All the sites are hosted on a dedicated Windows server.
Is there any reason I can't put the common code in a single directory and then use virtual directories in each site to access the code?
If so, where...
My customer's host was bought out and the site was transferred to a new server. Since then, most of the time I get the following server error when session_start() is on the top of certain pages (this does not happen on all pages, and it does not happen every time on the affected pages)...
Recently a hosting company tech who was trying to fix a server issue changed the code on one of my pages (without permission and without telling me!) from session_start() to #session_start() This change did not produce an error, and the effect seemed to be the same as commenting out the line...
I have a table of dated invoices. I would like to display bi-weekly sub-totals of invoice amounts. E.g.:
1/1/9 - 1/14/9 $500
1/15/9 - 1/28/9 $392
etc.
The starting date (1/1/9 in the example) is variable.
Is this possible with a SQL query? Or, will I have to do the summing with, say...
I was told by an MS engineer that every time the browser connects to the server the session variables are sent to the server from the browser (well, actually references to the session variables) and that the way to prevent session hijacking is to force an SSL connection at all times.
So, I am...
I have some code which sends out emails. It runs fine if I put it in an ASP page and then browse to that page. But, when I put the code in a vbs file and try running it as a scheduled task, it generates this error:
Microsoft VBScript runtime error: Object required: 'Server'
The line generating...
Well, this may or may not be a SQL question but . . .
I'm using the timezone functions referenced in the second post of this thread:
thread183-1262278
(thanks bborissov)
but I don't understand how to update the timezone table. The codeprojects post says:
"The tbTimeZoneInfo table contains...
Am I correct that vbScript does not have a command for exiting a While Wend loop? Should I use a Do While Loop instead if I want to have an exit condition? Is there any functional difference that I should be aware of?
I'm looping through record sets like this:
While NOT rsSomeData.EOF
. . ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.