
Graxeon
Members-
Posts
260 -
Joined
-
Last visited
Everything posted by Graxeon
-
Remove __ amount of characters?
Graxeon replied to Graxeon's topic in Editor Help (PhpStorm, VS Code, etc)
Wow...that works . So can you explain the "$[^"]*" search method in Notepad++ for me please? I'm not clear on how that functions. -
I have this file and I want to remove the first few characters of it: $file001 = array("http://site.com/file.php?url=001"); $file002 = array("http://site.com/file.php?url=002"); $file003 = array("http://site.com/file.php?url=003"); $file004 = array("http://site.com/file.php?url=004"); $file005 = array("http://site.com/file.php?url=005"); $file006 = array("http://site.com/file.php?url=006"); $file007 = array("http://site.com/file.php?url=007"); $file008 = array("http://site.com/file.php?url=008"); $file009 = array("http://site.com/file.php?url=009"); $file0010 = array("http://site.com/file.php?url=0010"); $file0011 = array("http://site.com/file.php?url=0011"); $file0012 = array("http://site.com/file.php?url=0012"); $file0013 = array("http://site.com/file.php?url=0013"); $file0014 = array("http://site.com/file.php?url=0014"); $file0015 = array("http://site.com/file.php?url=0015"); $file0016 = array("http://site.com/file.php?url=0016"); $file0017 = array("http://site.com/file.php?url=0017"); $file0018 = array("http://site.com/file.php?url=0018"); $file0019 = array("http://site.com/file.php?url=0019"); $file0020 = array("http://site.com/file.php?url=0020"); $file0021 = array("http://site.com/file.php?url=0021"); $file0022 = array("http://site.com/file.php?url=0022"); $file0023 = array("http://site.com/file.php?url=0023"); $file0024 = array("http://site.com/file.php?url=0024"); $file0025 = array("http://site.com/file.php?url=0025"); So in the end I just want this left: "http://site.com/file.php?url=001"); "http://site.com/file.php?url=002"); "http://site.com/file.php?url=003"); "http://site.com/file.php?url=004"); etc I know Notepad++ has a "Replace" feature but it doesn't remove all of the changing numbers next to "$file" Is there a PHP code or a tool that does this?
-
WORKS! Thank you VERY much everyone!
-
Now it's an exact copy of the link. It's being recognized as an XML file. Check yourself: http://fr33.ulmb.com/gr/grzid2.php
-
I just made the second XML as a copy that I can replace values with. It's the same thing, just different values. It was because I couldn't give out the actual content without permission with the owner. But again, I've done it with the real link. Here it is: <?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $myXML = curl_exec ($curl); curl_close($curl); $sxml = simplexml_load_string($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); ?> That gives a blank page: http://fr33.ulmb.com/gr/grzid2.php
-
I've tried, that just gives a blank page.
-
That gives this: <?xml version="1.0" encoding="UTF-8"?> <playlist version="1" xmlns="http://xspf.org/ns/0/"> <trackList> <track> <title>Zideo</title> <location>http://storage.zideo.nl/24851/109759.m4v</location> <duration>23:27</duration> <info>http://www.zideo.nl?zideo=6c49575a6e6c633d&playzideo=6b3447616f467478</info> <meta rel="type">m4v</meta> <image>mediaswf.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d&id=6c594b546e3135766e49453d&sharer=&.png</image> </track> <track> <title>6b3447616f467478</title> <location></location> <meta rel="type"></meta> </track> </trackList> </playlist>
-
That's odd... Well, I got permission from the owner so here's the link: http://www.zideo.nl/media.php?playzideo=6b3447616f467478&zideo=6c49575a6e6c633d That page shouldn't have loading problems like my test page.
-
Is there a way around that? But either way, it's the same content, isn't it?
-
Here are my files: http://fr33.ulmb.com/gr/grzid6.php <?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://fr33.ulmb.com/gr/xml.xml'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $myXML = curl_exec ($curl); curl_close($curl); $sxml = simplexml_load_string($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); ?> http://fr33.ulmb.com/gr/xml.xml <playlist version="1"> <trackList> <track> <title>SOCCER - RAINBOW</title> <location>http://www.site.com/soccer-rainbow.m4v</location> <duration>23:27</duration> <info>http://www.site.com/info.php?video=RAINBOW&title=SOCCER</info> <meta rel="type">m4v</meta> <image>images.php?title=SOCCER&video=RAINBOW</image> </track> <track> <title>SOCCER</title> <location/> <meta rel="type"/> </track> </trackList> </playlist> Did I mess something up?
-
Tried that, got this: Fatal error: Call to a member function xpath() on a non-object on line 10 Did the same thing as you (uploaded it remotely with NO "p=" and "z=" inputs). How is it a non-object? Alright, I'm off before I'm late.
-
I can't give you the actual website without confirmation from the owner. However, that XML file is the same exact copy. How it's generated is complex, however the final output is that. So, the URL that I'm giving is the basic setup that leads to that XML content. So it's the same thing. I can upload a plain XML file with that same content for you, but the "p=" and "z=" won't be part of the execution (though ofc that can be added later). Here's a test XML file with the same thing: http://fr33.ulmb.com/gr/xml.xml Sorry for taking up your time, I just really need to finish this. EDIT: I have to head out to work. If you want me to answer anything just leave a post, I'll be back in about 10 hours. Again, thatnks for your time!
-
Nope, still get a blank page. Is there a simpler way of getting the content within the "location" tags in the XML file?: http://www.site.com/xml.php?p=RAINBOW&z=SOCCER <playlist version="1"> <trackList> <track> <title>SOCCER - RAINBOW</title> <location>http://www.site.com/soccer-rainbow.m4v</location> <duration>23:27</duration> <info>http://www.site.com/info.php?video=RAINBOW&title=SOCCER</info> <meta rel="type">m4v</meta> <image>images.php?title=SOCCER&video=RAINBOW</image> </track> <track> <title>SOCCER</title> <location/> <meta rel="type"/> </track> </trackList> </playlist>
-
Like this? Cause this gives a blank page: <?php $title = $_GET['p']; $video = $_GET['z']; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'http://www.site.com/media.php?p=' .$title. '&z='.$video); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $myXML = curl_exec ($curl); curl_close($curl); $sxml = simplexml_load_file($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); ?> Or which code are you talking about?
-
Are you there Alex?
-
I don't really understand cURL. I'm not too great with PHP. Can you help me with it, please?
-
Yes, I am. However...this gives a blank page: <?php $title = $_GET['p']; $video = $_GET['z']; $myXML = 'http://www.site.com/media.php?p=' .$title. '&z='.$video; $sxml = simplexml_load_file($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); ?> So, I wanted to test to see if I'm even linking correctly and did this: <?php $myXML = 'http://www.site.com/xml.xml'; $sxml = simplexml_load_file($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); ?> And that gave me the fatal error. So, even when I link it directly to an already generated XML file, I get an error. Idk if that helps at all, though. THIS, however, works: <?php $myXML ='<playlist version="1"> <trackList> <track> <title>SOCCER - RAINBOW</title> <location>http://www.site.com/soccer-rainbow.m4v</location> <duration>23:27</duration> <info>http://www.site.com/info.php?video=RAINBOW&title=SOCCER</info> <meta rel="type">m4v</meta> <image>images.php?title=SOCCER&video=RAINBOW</image> </track> <track> <title>SOCCER</title> <location/> <meta rel="type"/> </track> </trackList> </playlist>'; $sxml = simplexml_load_string($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); ?> Why doesn't it work when I don't put the XML file in the $myXML var and just link to it?
-
The error is with the full link in place. So it's not a URL problem.
-
I just get a blank page with that change Edit: Even when I make $myXML = 'site.com/xml.xml' where "xml.xml" is the full XML file, I get this error: Fatal error: Call to a member function xpath() on a non-object on line 7
-
I have 2 files. The first is a PHP generated XML file that's dependent by 2 inputs. The second is a PHP file that grabs the content of the XML file. So I have this: site.com/xml.php?p=RAINBOW&z=SOCCER <playlist version="1"> <trackList> <track> <title>SOCCER - RAINBOW</title> <location>http://www.site.com/soccer-rainbow.m4v</location> <duration>23:27</duration> <info>http://www.site.com/info.php?video=RAINBOW&title=SOCCER</info> <meta rel="type">m4v</meta> <image>images.php?title=SOCCER&video=RAINBOW</image> </track> <track> <title>SOCCER</title> <location/> <meta rel="type"/> </track> </trackList> </playlist> I want to grab the contents of the "location" tags. So, I have this now: media.php?p=RAINBOW&z=SOCCER $title = $_GET['p']; $video = $_GET['z']; $myXML = 'www.site.com/xml.php?p=' .$title. '&z='.$video; $sxml = simplexml_load_string($myXML); list($node) = $sxml->xpath('/playlist/trackList/track/location'); header("Location: $node"); But I get the error "Fatal error: Call to a member function xpath() on a non-object on line 9". What variables did I mess up? Can someone help me fix it, please?
-
Sorry, I'm not using that flash player. I'm just trying to embed that XML file through a script Thanks for the link though, I may use it for other purposes
-
Umm...do I need to clarify my question? I hope Im not confusing anyone xD
-
I modified the code a little bit...but I still get a blank page. Idk why :/ <?php $title = $_GET['p']; $video = $_GET['z']; $url='http://www.site.com/media.php?title='.$title . '&video='.$video ; $string = file_get_contents($url); $sxml = new SimpleXmlElement($string); $node = $sxml->playlist/trackList/track/location; header('Location: '.$node); ?> Can anyone see the problem?