473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Is there any way to combine "url rewrite" and Header()

30
Can anyone explain how to combine "url rewrite" and header() function.

example:
header('Location: http://www.abc.com/a.php?username=abc&password=bsd');
rewrite url as: http://www.abc.com/a.php?somethingelse
Jul 30 '07 #1
5 2483
kovik
1,044 Expert 1GB
Can anyone explain how to combine "url rewrite" and header() function.

example:
header('Location: http://www.abc.com/a.php?username=abc&password=bsd');
rewrite url as: http://www.abc.com/a.php?somethingelse
You could perform URL rewriting through the header function, but why? You would lose all of the functionality that URL rewriting is supposed to give you. Look into mod_rewrite and read my URL parsing tutorial.
Jul 30 '07 #2
aRTx
30
This is the problem:

header('Location: http://www.abc.com/a.php?username=abc&password=bsd');

The "header" go to another web(when i have an account) to post my data, but my clients can see the username and password, so what can I do to prevent anyone to steal my username and password!

Thanks!
Jul 31 '07 #3
kovik
1,044 Expert 1GB
This is the problem:

header('Location: http://www.abc.com/a.php?username=abc&password=bsd');

The "header" go to another web(when i have an account) to post my data, but my clients can see the username and password, so what can I do to prevent anyone to steal my username and password!

Thanks!
Don't put it in the URL. Why would you ever do this? What are you trying to do?
Jul 31 '07 #4
aRTx
30
This is what i am doing:

I have an "Internet caffe", and i want to give to my client a limited sms gratis. I have an account at www.smsdiscount.com and they let user to use service with url: https://myaccount.smsdiscount.com/clx/sendsms.php?username=xxx&password=xxx&from=xxx&per =xxx&text=xxx";

I have created a simple html form and I am working with php. In html form I have this:

[HTML]<form action="sms.php" onMouseOver="window.status='aRTx center'; return true;" onMouseOut="window.status=''; return true method="post" >
<label for="to">Numri</label><br/>
<input type="text" name="to" value="+37744xxxxxx" size="20" >
<p>
<label for="from">Sender</label><br/>
<input type="text" name="from" value="<?echo $_SESSION['user']; ?>" size="20" ><br/>
</p>
<label for="text">Message</label><br/>
<textarea size="50" rows="8" name="text" cols="40" onKeyDown="limitText(this.form.text,this.form.coun tdown,160);"
onKeyUp="limitText(this.form.text,this.form.countd own,160);" > </textarea>
</p>
<table>
<td valign="top">&nbsp;</td>
<td><input name="submit" type="submit" id="submit" value="submit" onSubmit=mbylle() />

When i post this at "sms.php", there I put my username and password of my account at the service, but to have the url that accept the service I used header like this:

$url = "https://myaccount.smsdiscount.com/clx/sendsms.php?username=".$username."&password=".$pas sword."&from=".$from."&to=".$to."&text=".$text;

header('Location: '.$url);[/HTML]

But my clients steal my password in the URL. I have hide it with the frameset but It was a siple trick to hack it. So what should I do to prevent the hacking my account.
Thanks for support!
Jul 31 '07 #5
kovik
1,044 Expert 1GB
Maybe you should try to use cURL.
Aug 1 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: NotGiven | last post by:
I changed my POST to GET and find appended to the url, the above string. Why and what can I do to NOT have them appended? Thanks.
0
by: Andrew Morton | last post by:
Windows Server 2003 SP1, IIS6.0, .NET1.1, VS2003 I got the "URL Is In the Internet Zone" error when trying to debug an ASP.NET application, with 403.0 followed by 401.5 errors in the IIS log. ...
10
by: not_a_commie | last post by:
I've seen studies before showing that it is better to rewrite code when more than 25% (or whatever) of the code needs to be changed. I can't seem to locate any references for that at the moment. Do...
5
by: tabariz | last post by:
Hello everybody can anyone tell me whats the correct syntax to add a variable previously declared to the url in the command header("refresh: 5, url:) for example i want my URL to be ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.