Php has a page a to pass value to page B to accept and store data in the database.

Source: Internet
Author: User
Php has a page to pass values to B page B to accept and store data to database problem a page has 1, 2, 3, 4, 5 buttons, each button has a corresponding link, click each button to send a value to page B, and upload the id, name, url, and so on. page B is responsible for adding records to the database. The record content is the id name url, now the problem is to add the corresponding type to the database, but the url cannot be added to the database, and B. php page jump is always the first button link address. Please help solve it

Code
A. php
$ Path = $ _ GET [path];
$ Url = "http://bj. TV .wo.com.cn ";
$ Result = mysql_query ("select * from new where path = '3' order by id desc limit 0, 1 ");
While ($ row = mysql_fetch_array ($ result )){
?>
& Name = & Url = ">
}
?>

B. php
Include ("conn. php ");
$ Id = $ _ GET [id];
$ Type = $ _ GET [type];
$ Showtime = date ("Y-m-d ");
$ Url = $ _ GET [url];
$ Resultc = mysql_query ("insert into total_counter (time, type, url) values ('$ Showtime',' $ type', '$ URL ')");
$ Result = mysql_query ("select * from new where id = $ id ");
While ($ row = mysql_fetch_array ($ result )){
?>
Script
Location = "url of the corresponding button link (the url of the button chain to the button )";
Script
}
?>


Reply to discussion (solution)

Is your source code like this ??? I didn't see the changed url.

The url carries a diagonal line and needs to be escaped before being inserted into the database.

The problem has been solved.

If the problem is solved, paste it to the score. you should have a small problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.