PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 3rd, 2009, 06:51 AM
modestmj modestmj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 3 modestmj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m
Reputation Power: 0
PHP-General - Page redirection

Hello everyone,

I am not an expert in PHP. So please bear with me if my post doesn't make sense.

I'm developing a site where users can send sms to their customers who register in their website. The problem is, I want to direct to the URL of the sms gateway to send sms. After the message is sent, I want the control to come back to my webpage.

Please help me with this. Thanks in advance..

Reply With Quote
  #2  
Old July 3rd, 2009, 07:21 AM
purpleshadez purpleshadez is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Bradford, West Yorkshire. UK
Posts: 6 purpleshadez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 47 m 11 sec
Reputation Power: 0
Send a message via MSN to purpleshadez
Quote:
Originally Posted by modestmj
Hello everyone,

I am not an expert in PHP. So please bear with me if my post doesn't make sense.

I'm developing a site where users can send sms to their customers who register in their website. The problem is, I want to direct to the URL of the sms gateway to send sms. After the message is sent, I want the control to come back to my webpage.

Please help me with this. Thanks in advance..


This would depend on where you are directing the user.
If the sms script is a part of your site and assuming it doesn't send any data back to the browser you can use the header() function like this:

PHP Code:
// code that sends the sms based on form data
header('location: index.php'); 

Reply With Quote
  #3  
Old July 3rd, 2009, 07:28 AM
modestmj modestmj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 3 modestmj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m
Reputation Power: 0
Quote:
Originally Posted by purpleshadez
This would depend on where you are directing the user.
If the sms script is a part of your site and assuming it doesn't send any data back to the browser you can use the header() function like this:

PHP Code:
// code that sends the sms based on form data
header('location: index.php'); 


Thank you purpleshadez for your reply..But I forgot to mention that the sms script is not a part of my site. It is a different site which sends only smses.

Reply With Quote
  #4  
Old July 3rd, 2009, 07:33 AM
purpleshadez purpleshadez is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Bradford, West Yorkshire. UK
Posts: 6 purpleshadez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 47 m 11 sec
Reputation Power: 0
Send a message via MSN to purpleshadez
If it is an external site then I do not think it would be possible.

The only thing I can think of is if the SMS site was account based and it had an option to set a referer which would re-direct the user back to your site once finished but I think it would be unlikely.

Another option would be to open the SMS site in a new tab or window. I think that would need to be done using javascript though.?

Reply With Quote
  #5  
Old July 3rd, 2009, 09:26 AM
chrisjacob.us chrisjacob.us is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: United States
Posts: 68 chrisjacob.us User rank is Sergeant Major (2000 - 5000 Reputation Level)chrisjacob.us User rank is Sergeant Major (2000 - 5000 Reputation Level)chrisjacob.us User rank is Sergeant Major (2000 - 5000 Reputation Level)chrisjacob.us User rank is Sergeant Major (2000 - 5000 Reputation Level)chrisjacob.us User rank is Sergeant Major (2000 - 5000 Reputation Level)chrisjacob.us User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 21 h 17 m 32 sec
Reputation Power: 32
Quote:
Originally Posted by purpleshadez
If it is an external site then I do not think it would be possible.

The only thing I can think of is if the SMS site was account based and it had an option to set a referer which would re-direct the user back to your site once finished but I think it would be unlikely.

Another option would be to open the SMS site in a new tab or window. I think that would need to be done using javascript though.?


Yeah, you could use something like Javascript (maybe it's AJAX, I'm not sure) to call another PHP page that will complete the SMS request...so while it's doing that, the user is alerted that it's been sent.

Reply With Quote
  #6  
Old July 4th, 2009, 03:08 AM
modestmj modestmj is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 3 modestmj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 26 m
Reputation Power: 0
Thanks for you help purpleshadez and Chris...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Page redirection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT