My pages contain this kind of url:
http://fashion.piliapp.com/author/http%3A%2F%2Fwww.wretch.cc%2Fblog%2Fwiwinnie/
which created by
"http://fashion.piliapp.com/author/" . rawurlencode("http://www.wretch.cc/blog/wiwinnie") . "/"
HTML looks like
<cite>♡winnie♡(。→v←。)♡</cite>
It occur lots of time on each pages, and I also added in sitemap.xml , but it only have one result in site:fashion.piliapp.com/author/
It should have thousands pages.
I think the problem are:
- Google considers as those pages are typo pages.
- CITE tag will not be indexed.
- this kind of urls are invalid.
Shell I change anything?
Thanks.
Yes, if you can change the url still, go ahead and do change it.
Just make sure everything still works fine if you change it :)
or if you want you, may use some base_encode, then base_decode techniques.
<?php
$url = base64_encode($url) . '.htm';
$url = "http://fashion.piliapp.com/author/" . $url;
?>
then when displaying the actual page, get url later by decoding it
<?php
$uri = $_SERVER['REQUEST_URI'];
$url = str_replace("http://fashion.piliapp.com/author/",'',$url);
$url = str_replace(".htm",'',$url);
$url = base64_decode($url);
//$url should contain the actual url afterwards
?>
Related
I'm using Gravity PDF and have a Nested field from Gravity Perks. I can view fields in the normal exploded results just fine, but am having trouble when I want to display the Nested field in a particular location using the PHP option.
To be clear, I can get the normal $form_data['field'] and $form_data['list'] options to work just fine. But when I try to get one of those to fire a Gravity Form Nested Field I have issues. I've used a lot of combinations...
<?php echo $form_data['field'][27.72]; ?>
<?php echo $form_data['gpnf'][27]['gpnf']; ?>
<?php echo $form_data['field'][27]['gpnf']; ?>
<?php echo $form_data['field']['gpnf_display_value_27_72']; ?>
Thoughts?
Got it! Got it working earlier today and been fiddling with it all day. Just had to setup an API. First you use the original $form_data to get the Entry_ID
$client = $form_data['field'][32];
Then you point the API to the form_id you want:
$form_id2 = '27';
$entry2 = GFAPI::get_entry( $client );
And then it was a really easy variant of the rgar:
You need to setup $form_id2 and $entry2 or something like that because if you don't it changes the other ones in the PDF that are pointed at the original Form.
From here I've been able to customize the heck out of it.
Don't know the answer, but I use gravity forms and perks, and the perks support is really good and usually get back quickly with a response. Might try emailing them if you haven't already.
I am creating an API to feed some apps.
So the app could call these possible URLs to get information from the database;
mysite.com/api/v1/get/menus/list_tblname1.json.php
mysite.com/api/v1/get/menus/list_tblname1.json.php?type=arr
mysite.com/api/v1/get/menus/list_tblname2.json.php
mysite.com/api/v1/get/menus/list_tblname2.json.php?type=arr
In php I have already the code that grabs the tblname from the URL and give me back all the table content. It works good (it is not the final version).
But now I find myself copying and pasting the same code for each page where the URL points to. Here is the code:
<?php
header('Content-Type:application/json');
include_once '../../../../class/db.php';
$verb=$_SERVER['REQUEST_METHOD'];
$filePath=$_SERVER['SCRIPT_NAME'];
$split1 = explode("/", $filePath);
preg_match("/(?<=_)[^.]+/", $split1[5], $matches);
$tableName = $matches[0];
if ($verb=="GET") {
header("HTTP/1.1 200 ok");
if(isset($_GET['type']) && $_GET['type']=="arr"){
echo db::get_list($tableName,'arr');//Reply ARRAY
}
else{
echo db::get_list($tableName);//Reply JSON
}
}
else{
die("Nothing for you at this page!");
}
I mean, I have the same code inside each these pages.
list_tblname1.json.php
list_tblname2.json.php
I am not sure how to solve this situation but I think that this is case for
rewrite rules.
So, I think a possible solution is to create one page that could call
returncontent.php for example and create rules in the server that should point to the same page when certanlly pages are requested and pass the parameter $tableName to the page. I think I should pass the regex to my server and grab the $tableName with $_GET[] (I think) inside returncontent.php.
I am not sure about it.
I am using NginX.
How to implement it in this scenario?
As a rule, it's bad practice to parse a URI in NginX and pass the result downstream.
Rather: mysite.com/api/v1/get/menus/returncontent.php?file=list_tblname2.json
No changes to NginX needed. Parse the query param (file) in PHP.
I'm new to phalcon and I need assistance because i cannot find a way to get full path url (and add it in an email message) such as :
"http://phalcon.mydomain.com/auth/confirmRegistration"
the most i could get is "/auth/confirmRegistration"
using $this->url->getStatic('auth/confirmRegistration')
there might be a build in function but i could not discover it, or maybe i should put the 'http://phalcon.mydomain.com' part in a global variable ??
thank you in advance
Here's a simple way to get the url of the current page in Phalcon:
echo $this->router->getRewriteUri();
You could do two things. Per documentation you could set the full domain url:
<?php
$url = new Phalcon\Mvc\Url();
//Setting a relative base URI
$url->setBaseUri('/invo/');
//Setting a full domain as base URI
$url->setBaseUri('//my.domain.com/');
//Setting a full domain as base URI
$url->setBaseUri('http://my.domain.com/my-app/');
Or you could simply use HTTP_HOST / SERVER_NAME to get the host name and append the rest of it, e.g:
echo 'http://' . $_SERVER['SERVER_NAME'] . '/auth/confirmRegistration';
Is there a simple php coding way how to add variable(s) "dynamic or fixed types" to include in a link so that the link doesn't show up as a clean url. And this an example of what I mean:
www.example.com/folder/sense/home
To
www.example.com/folder/sense/index.php?type=article&id=25&date_written=20100322
Or
www.example.com/folder/sense/index.php?id=25
I hope it is clear what I'm up to.
P.S: this is all in Apache
Thanks
The http_build_query function (http://php.net/manual/en/function.http-build-query.php) will convert an array of data into an urlencoded string of variables.
Example from the link above:
<?php
$data = array('foo'=>'bar',
'baz'=>'boom',
'cow'=>'milk',
'php'=>'hypertext processor');
echo http_build_query($data) . "\n";
?>
will output
foo=bar&baz=boom&cow=milk&php=hypertext+processor
I am not sure i get it, but if you use a form with post, $_POST array will keep variables and they will not be visible in the url
I am creating a website in which user enters his position(which can only be the ones stored in my database). To make it user friendly, I want to show him the available choices of positions as he types the positions. Is there a way to cache all the values in SQL(around 30 to 40) in browser beforehand, so that user can see them while typing.
You can query your data base through PHP and most other server side scripts and call them through ajax. You can also use pure javascript with the new html5 specs (but they are only supported in webKit browsers at the moment).
If you want to do it without ajax, you can get the values when the user accesses the page and put them in a javascript array. This way when the computer reads the javascript the custom values are already there. The problem with this meathod is it will significantly slow your websites response time.
Example: (php/pesudocode)
<?php
$options = $mysql->getOptions(); // This is the pesudo-code bit.
echo 'options = [';
foreach ( $opt in $options )
{
echo '"' . $opt.name . '"' . ',';
}
echo '];"
?>
This gives something like
options = [ "opt1", "opt2", "opt3", ];
which should be read as an array in javascript. The only problem is the extra comma but you should be able to solve that easy enough. (and firefox didn't even give a warning)