Search found 27 matches

by train
Wed Jan 31, 2007 11:08 am
Forum: Miscellaneous
Topic: custom 404 redirection
Replies: 5
Views: 1952

If your web server is Apache, you can use .htaccess files quite often. Many hosts have mod_rewrite enabled for their users too. I am not being clear, I guess... We have access to client browsers only. We are not in control of any web servers whatsoever. This has to be entirely client-side. I was th...
by train
Tue Jan 30, 2007 9:31 pm
Forum: Miscellaneous
Topic: custom 404 redirection
Replies: 5
Views: 1952

There are several Apache directives (and IIS ones too) that can control the behavior of the server when a 404 is encountered. If you do not have access to the main configuration, you can possibly use mod_rewrite or equivalent to detect the nonexistent file or directory. If you want to know more abo...
by train
Mon Jan 29, 2007 9:21 pm
Forum: Miscellaneous
Topic: custom 404 redirection
Replies: 5
Views: 1952

custom 404 redirection

Hi, If I wanted to (via a plugin, or cooperation with an ISP, or some other way) have people redirected to a page of my choosing whenever they received a 404 error, how could this be done? Even if I do not have access to the files on the server that is handing out the 404's, is there a way to have t...
by train
Thu Sep 21, 2006 12:16 pm
Forum: PHP - Code
Topic: 2 easy questions
Replies: 1
Views: 302

2 easy questions

I have a form with a multi select. This is the code: td><select size="5" multiple="multiple" name="contact[]" id="custom_21" class="form-select required"> <option value="Morning">Morning</option> <option value="Afternoon">Afternoo...
by train
Tue Sep 19, 2006 9:22 pm
Forum: PHP - Code
Topic: Need a pointer towards instruction
Replies: 6
Views: 1282

cURL or some other related library may be of interest. Okay, this is more difficult than I hoped. I thought maybe I could do an include, or just resubmit everything... Okay, I did it. And this is my code: $ch = curl_init("http://oldserver.mycompany.com/somepage.php"); curl_setopt($ch, CUR...
by train
Tue Sep 19, 2006 8:53 am
Forum: PHP - Code
Topic: Need a pointer towards instruction
Replies: 6
Views: 1282

feyd wrote:cURL or some other related library may be of interest.
Okay, this is more difficult than I hoped.

I thought maybe I could do an include, or just resubmit everything...
by train
Tue Sep 19, 2006 6:39 am
Forum: PHP - Code
Topic: Need a pointer towards instruction
Replies: 6
Views: 1282

Thanks... so then can I...

Thank you, Sir, for your response. Maybe someone will indulge me here: It makes sense, then, as a temporary solution, for me to submit to my web sever and then have my web server submit to the private box. If I have this form submit to some file on the web server, the $_POST variables are there on t...
by train
Mon Sep 18, 2006 9:20 pm
Forum: PHP - Code
Topic: Need a pointer towards instruction
Replies: 6
Views: 1282

Need a pointer towards instruction

Hi, I am a big dummy. I was using a form that a previous developer made for my company. I was going to adopt it and put it on our public website. It updates a machine on our network with a private IP. The form is PHP and our web server is IIS, ASP. The form talks to a machine that is really useless ...
by train
Wed Sep 06, 2006 3:00 pm
Forum: Miscellaneous
Topic: Is PHP the right tool for this project?
Replies: 2
Views: 1396

Well, PHP's certainly more of an accepted crossplatform system. If that's what you need, then it's up there. More than likely the .Net results will be tailored to IE, so that may be a sticking point (it certainly is around these parts.) I appreciate the response and I know it is kind of a silly que...
by train
Wed Sep 06, 2006 7:47 am
Forum: Miscellaneous
Topic: Is PHP the right tool for this project?
Replies: 2
Views: 1396

Is PHP the right tool for this project?

I have to find a developer to build a database application. The organization I am working with has SQL Server already (licensed until the end of time), and is vendor-neutral though quick to accept anything M$. They have someone offering to build this application with .NET but I would like to stay aw...
by train
Mon Aug 21, 2006 10:10 am
Forum: PHP - Code
Topic: get array values?
Replies: 12
Views: 749

jayshields wrote:You should still use a loop...

Code: Select all

foreach($_POST['custom_12'] as $k => $v) {
  if($v == 1) {
    //do this
  }
}
Will do. Thank you.
by train
Mon Aug 21, 2006 9:59 am
Forum: PHP - Code
Topic: get array values?
Replies: 12
Views: 749

I still cant read $_POST[custom_12][2] I'm not suprised. I said $_POST['custom_12'][2]. Don't use multiple if's. Use a loop. foreach($_POST['custom_12'] as $k => $v) { //do this } The action will vary depending on which member of the array is true, so I dont think the loop will work well. Thanks. I...
by train
Mon Aug 21, 2006 9:16 am
Forum: PHP - Code
Topic: get array values?
Replies: 12
Views: 749

To see where everything is.. echo '<pre>' . print_r($_POST, true) . '</pre>'; Yeah, thats really cool. Thanks man. But still, I need to evaluate the array... so if custom_12[2] is 1, a certain action happens. I guess I can just if (custom_12[1] = 1) { (do this); } if (custom_12[2] = 1) { (do this);...
by train
Mon Aug 21, 2006 9:03 am
Forum: PHP - Code
Topic: get array values?
Replies: 12
Views: 749

You would need to refer to it as $_POST['custom_12'][2] I think, not sure though. Referring to your original question: Why not set the value of the checkboxes to the email address you want to send to. It would make things alot easier for you. You could then take astions code and modify it like so. ...
by train
Mon Aug 21, 2006 8:43 am
Forum: PHP - Code
Topic: get array values?
Replies: 12
Views: 749

You can nest foreach loops if your dealing with arrays containing arrays.. foreach ($_POST as $key => $data) { if (is_array($data)) { foreach ($data as $key => $value) { echo "{$key}={$value}<br />\n"; } } else { echo "{$key}={$data}<br />\n"; } } Now I get 1=1 2=1 3=1 4=1 5=1 f...