Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to create a simple site for local test, but I need to show on URL the following:
?id=1
How can I do it?
You can do this by hyperlink, form submit, manually typing it into the URL bar and many other methods. Use a hyperlink:
ID1
Im not too sure what you are asking, but if you are looking to add an id variable to the URL you need to add it to the URL when you redirect
EX.
From link
Link
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
a challenge like this $_GET['2020'] snippet boring me a long time, i want to know how this work, but do not know which keywords to search, maybe how the parameter works?
$_GET reads querystring parameters from the URL. So if someone goes to your PHP script with a URL like http://servername/scriptname.php?2020=ABC then when the PHP script runs, the variable $_GET['2020'] will contain the value ABC.
More info is available in the documentation: https://www.php.net/manual/en/reserved.variables.get.php
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I am trying to make this page:
https://mediastreet.ie/media-jobs/role-65678
same as this page using htaccess:
https://mediastreet.ie/media-jobs/role
So basically /role-65678 is a parameter like role-{parameter}. So when on /role-65678 i have a script that fetches this (65678) and displays the job according to it.
Rather than editing your htaccess file, I would just reccomend sticking with a good old get method.
Use https://mediastreet.ie/media-jobs/role?id=65678
Then in the index.php file in the directory "role", use the get functionality as shown below.
<?PHP
$id = $_GET["id"];
//Code to follow
?>
Past experiance tells me this will save alot of htaccess headaches!
All the Best.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a page 'Error 404' and the address is like http://myurl.com/error404
the php file of error404 require's the index.php to properly show it.
I need a php code that will load or show the content in the url above without redirecting/changing the url. thanks
echo file_get_contents("http://myurl.com/error404");
Works also for URLs.
DOCS
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I have a situation here. I want one link to redirect to another link. I am using it in custom php project.
www.xyz.net/?ref=admin
to REDIRECT to registration page
www.xyz.net/user/register?ref=admin
admin could be replaced by any other name.
You can try this. Sorry I haven't time for check.
if(!empty($_GET['ref'])){
$ref = $_GET['ref'];
header("Location: http://example.net/user/register?ref=$ref");
exit;
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Currently I have:
Click here
This takes me to the index.php page
How do I change this in order to take me to another page?
Since you guys closed this. I will answer my own question:
The answer:
What you put in the WP_Query post_type = '(POST TYPE HERE)'
You can make a page called:
"single-(POST TYPE HERE).php
So once you click the link. This will take you to the:
"single-(POST TYPE HERE).php page
the_permalink() outputs the URL of the post currently being viewed in the loop. If you wanted to change the destination of the link then replace <?php the_permalink();?>.
Refs:
http://codex.wordpress.org/Function_Reference/the_permalink
http://codex.wordpress.org/The_Loop