sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
This works: <?php $lines = file('http://www.yourfile.com'); foreach ($lines as $line_num => $line) { if ($line_num == 0){ echo str_replace(""," ",htmlentities($line)) . "<br />\n"; } } ?>
-
<?php $lines = file('http://www.yoursite.com'); foreach ($lines as $line_num => $line) { echo str_replace(""," ",htmlentities($line)) . "<br />\n"; } ?> I used this to get all lines of a file, and in this case it was a html file. If you adjust the looping I'm sure you can print just the first line.
-
it doesn't just magically print "thankyou for registering". You will have to search through your scripts and find the one that is outputing that.
-
It's for sure not going to work because you can't have a header redirect that far down in the script. You need to look at your register.php. That is what is giving the message.
-
It probably oughta be something like this: if (preg_match('/^\\<form\\s\\z/', $string)) { echo "1"; } else { echo "no match found"; }
-
you have specified that your delimiter is a less than sign. You should have done this: $regex = "|<form\s|";
-
This works, I checked it: <?php $row['title'] = 'whatever'; echo "<font color='#660000'>".$row['title']."</font>"; ?>
-
echo "<font color='#660000'>$row['title']</font>"; paste your error if this doesn't work
-
Parsing RSS feeds where allow_url_fopen=OFF
sKunKbad replied to warpdesign's topic in PHP Coding Help
can you use simplexml_load_file ? -
You may need to use: CURLOPT_FOLLOWLOCATION CURLOPT_MAXREDIRS or CURLOPT_AUTOREFERER if there are any redirections going on during the post to Imageshack. The rest of your code seems fine, but just to make sure, you might want to send the curl post to a test page and print the post variables. Just for your viewing pleasure, I'm including a curl post that I made up so you can see how I did it on my project. <?php if ($aCleanedValues['opt-in'] == 'Y'){ $prename = $_POST['realname']; $nameRegex = "/^[A-Z\s\.,'-]+$/i"; $preemail = $_POST['email']; $emailRegex = "/^(?:^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|gov|mobi|tv|biz|info|jobs|museum)$)$/i"; if(preg_match($nameRegex,$prename) && preg_match($emailRegex,$preemail)) { $name = $prename; $email = $preemail; $url = "http://newsletters.somedomain.com/subscribe.aspx?Task=Join"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); // set url to post to curl_setopt($ch, CURLOPT_FAILONERROR, 1); //needed for some reason curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //so you dont see the process, it just happens before the redirect curl_setopt($ch, CURLOPT_POST, 1); // set POST method curl_setopt($ch, CURLOPT_POSTFIELDS, array('Name'=>"$name", 'Email'=>"$email", 'DeliveryFormat'=>'HTML', 'Password'=>'RandomNumber', 'NewsletterListID'=>'526', 'JoinType'=>'Menu', 'SID'=>'{CDFEB2A7-0B0C-4541-A50B-CC975DDB114A}')); // add POST fields curl_exec($ch); // run the whole process curl_close($ch); } } ?> One thing that I'm wondering about is how imageshack is going to know you are logged in?
-
You'll have to wait till somebody else can help you with v4. V5 is super easy, so it's too bad you don't have v5.
-
you should post your xml file so we can see what we are parsing, and you should also let us know your version of php.
-
if you recently installed php on your system, then you most likely installed version 5, and many hosts are still running version 4. You can verify this by adding the following to your script, or a blank php file, uploading it to your server, and then viewing it in your browser: phpinfo(); If your host isn't running php5... I'd look for another host. php5 makes a lot of scripting WAY easier.
-
[SOLVED] Help with previous and next button in gallery
sKunKbad replied to rondog's topic in PHP Coding Help
I think what you are trying to do is called "pagination", and you should find endless tutorials online regarding the subject. -
Are you using php5. I wrote a php5 amazon bookstore, and using php 5 will save you a lot of marbles. If your host isn't running php5, get a new host. Life is much easier with php5. Send me a private message if you want to see my php. By the way, I have it all set up to run with mod rewrite, which is definately what you want to do to get the most SEO out of your amazon store. The script also uses a session to make sure that people that hit the back button don't lose their cart contents and that kind of good stuff.
-
you are talking about the basics of MySQL. You just need a dummies book or something. I don't know where one is online, but I'm sure the library has one you can check out if you don't want to buy one.
-
you wouldn't getcookie, you would start your session and then: $var = $_SESSION['user_id']; //to get the user id, assuming user_id is in the $_SESSION array. $var2 = $_SESSION['user_name']; //to get the user name, assuming user_name is in the $_SESSION array.
-
Properly formatted xml file named name_email.xml: <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <content> <author> <name>John Doe</name> <email>johndoe@example.com</email> </author> </content> </rss> php5 script: <?php $feed = simplexml_load_file('name_email.xml'); $name = $feed->content->author->name; $email = $feed->content->author->email; echo "<a href='$email'>$name</a>"; ?> That's as easy as it gets.
-
You would make a lot of work for yourself echoing all the output.
-
You will need to show your script before anybody will know if it can be optimized.
-
what version php are you running?
-
If you view the site on a 800x600 browser, it REALLY looks bad. I think you need to get rid of the rag on the top left, and get rid of the "NORTHERN FLAME" free high quality ringtones blah blah blah. Take that nf3.png out. When that lowered area is on top you will start having a decent web page. If you still like the idea of nf3.png, then at least make it wider and shorter. Make sure the site looks good for a person with a 800x600 browser too. If you track users coming to your website, you will see that a pretty good percentage still have 800x600 browers. Also, somebody with a large monitor can put their resolution on 800x600 if they have poor eyesight. My mom does it, so it does happen.
-
No, that's not my yatch (yacht). I pay $80USD to go out on that fishing boat for about 12 hours. I love it, but sometimes it is cold and if I get sea sick it can be a LONG day!
-
[SOLVED] Works with Firefox but fails with IE
sKunKbad replied to stockton's topic in Javascript Help
i had an issue where I was trying to split my response with | and it wasn't working well. instead, I changed what I split my response with to something like <p>split-here</p>. -
I wasn't even for a second thinking about php when I caught that fish