Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #9559 > unrolled thread
| Started by | richard <noreply@example.com> |
|---|---|
| First post | 2013-05-23 23:23 -0400 |
| Last post | 2013-05-24 15:12 -0700 |
| Articles | 12 — 7 participants |
Back to article view | Back to comp.lang.php
testing for source to use richard <noreply@example.com> - 2013-05-23 23:23 -0400
Re: testing for source to use "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2013-05-24 03:36 +0000
Re: testing for source to use JohnT <john@example.com> - 2013-05-24 10:17 +0000
Re: testing for source to use Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-24 10:50 +0000
Re: testing for source to use Tim Streater <timstreater@greenbee.net> - 2013-05-24 12:53 +0100
Re: testing for source to use The Natural Philosopher <tnp@invalid.invalid> - 2013-05-24 13:23 +0100
Re: testing for source to use Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-24 13:10 +0000
Re: testing for source to use richard <noreply@example.com> - 2013-05-24 15:10 -0400
Re: testing for source to use Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-05-24 21:41 +0000
Re: testing for source to use Scott Johnson <noonehome@chalupasworld.com> - 2013-05-24 05:38 -0700
Re: testing for source to use richard <noreply@example.com> - 2013-05-24 15:22 -0400
Re: testing for source to use Scott Johnson <noonehome@chalupasworld.com> - 2013-05-24 15:12 -0700
| From | richard <noreply@example.com> |
|---|---|
| Date | 2013-05-23 23:23 -0400 |
| Subject | testing for source to use |
| Message-ID | <1ij92ldq768qa.1x65hwkghfrwa.dlg@40tude.net> |
In this bit of code, the procedure is fairly simple.
1) get the value from the database.
2) check the value to find out what the first character is.
3) if the first character is "/" then the source is my site.
4) if not, the source is youtube.
I chose the / because I've never seen it used in the values on youtube.
and it makes finishing off the url easier.
the problem is, no matter what link I select, the url is always MY SITE!
What other ways can I do this?
Oh, and Beau dear? Shut the fuck up with seeing a big blank page because
that makes you a liar.
www.mroldies.net/test4.php
$result = mysql_query("SELECT avid FROM A$year WHERE id = $number");
if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
$vid = mysql_fetch_row($result);
echo $vid[0];
$v=$vid[0];
$v1=substr($v,0,1);
$yt="http://www.youtube.com/watch?v=".$vid[0];
if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
echo "<br />".$yt;
[toc] | [next] | [standalone]
| From | "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> |
|---|---|
| Date | 2013-05-24 03:36 +0000 |
| Message-ID | <knmn7a$vkd$1@dont-email.me> |
| In reply to | #9559 |
richard the sto0pid wrote: > Oh, and Beau dear? Shut the fuck up with seeing a big blank page because > that makes you a liar. > > www.mroldies.net/test4.php That's not the same page, sto0pid. Your previous iteration - that which I was talking about - was completely blank when JavaScript is blocked or not enabled. This: http://www.mroldies.net/test3.html which at this moment is still active, and blank. BTW, you should hire someone who has at least a scrap of artistic abilities. You certainly don't. -- -bts -This space for rent, but the price is high
[toc] | [prev] | [next] | [standalone]
| From | JohnT <john@example.com> |
|---|---|
| Date | 2013-05-24 10:17 +0000 |
| Message-ID | <knnenn$spo$1@dont-email.me> |
| In reply to | #9559 |
On Thu, 23 May 2013 23:23:51 -0400, richard wrote:
>
> if ($v1="/"){$yt="http://mroldies.net".$vid[0];} echo "<br />".$yt;
Should be:
if ($v1=="/"){$yt="http://mroldies.net".$vid[0];} echo "<br />".$yt;
I think you've been advised of a similar error recently.
Regards
JohnT
[toc] | [prev] | [next] | [standalone]
| From | Doug Miller <doug_at_milmac_dot_com@example.com> |
|---|---|
| Date | 2013-05-24 10:50 +0000 |
| Message-ID | <XnsA1CA4644ADFF2dougmilmaccom@78.46.70.116> |
| In reply to | #9559 |
richard <noreply@example.com> wrote in news:1ij92ldq768qa.1x65hwkghfrwa.dlg@
40tude.net:
[...]
> the problem is, no matter what link I select, the url is always MY SITE!
>
[...]
> if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
Same problem you had on your last question: the above is an assignment statement, not a
comparison. The equality comparison operator in php is ==, not =.
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2013-05-24 12:53 +0100 |
| Message-ID | <timstreater-B96075.12530724052013@news.individual.net> |
| In reply to | #9568 |
In article <XnsA1CA4644ADFF2dougmilmaccom@78.46.70.116>,
Doug Miller <doug_at_milmac_dot_com@example.com> wrote:
> richard <noreply@example.com> wrote in news:1ij92ldq768qa.1x65hwkghfrwa.dlg@
> 40tude.net:
>
> [...]
> > the problem is, no matter what link I select, the url is always MY SITE!
> >
> [...]
>
> > if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
>
> Same problem you had on your last question: the above is an assignment
> statement, not a
> comparison. The equality comparison operator in php is ==, not =.
Fuckin' Ada, richard, how about *learning* some shit before posting
dopey questions, eh? How about looking through your code for simple
errors and, like, *fixing* them before posting here, eh?
--
Tim
"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[toc] | [prev] | [next] | [standalone]
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Date | 2013-05-24 13:23 +0100 |
| Message-ID | <knnm4l$6a3$3@news.albasani.net> |
| In reply to | #9570 |
On 24/05/13 12:53, Tim Streater wrote:
> In article <XnsA1CA4644ADFF2dougmilmaccom@78.46.70.116>,
> Doug Miller <doug_at_milmac_dot_com@example.com> wrote:
>
>> richard <noreply@example.com> wrote in
>> news:1ij92ldq768qa.1x65hwkghfrwa.dlg@
>> 40tude.net:
>>
>> [...]
>> > the problem is, no matter what link I select, the url is always MY
>> SITE!
>> > [...]
>>
>> > if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
>>
>> Same problem you had on your last question: the above is an
>> assignment statement, not a comparison. The equality comparison
>> operator in php is ==, not =.
>
> Fuckin' Ada, richard, how about *learning* some shit before posting
> dopey questions, eh? How about looking through your code for simple
> errors and, like, *fixing* them before posting here, eh?
>
because he is a Dick?
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[toc] | [prev] | [next] | [standalone]
| From | Doug Miller <doug_at_milmac_dot_com@example.com> |
|---|---|
| Date | 2013-05-24 13:10 +0000 |
| Message-ID | <XnsA1CA5E0DF85B1dougmilmaccom@78.46.70.116> |
| In reply to | #9570 |
Tim Streater <timstreater@greenbee.net> wrote in news:timstreater-B96075.12530724052013 @news.individual.net: > Fuckin' Ada, richard, how about *learning* some shit before posting > dopey questions, eh? How about looking through your code for simple > errors and, like, *fixing* them before posting here, eh? You don't understand who you're dealing with here. This may help: https://groups.google.com/forum/?fromgroups#!search/richard$20the$20stoopid https://groups.google.com/forum/?fromgroups#!search/richard$20the$20sto0pid
[toc] | [prev] | [next] | [standalone]
| From | richard <noreply@example.com> |
|---|---|
| Date | 2013-05-24 15:10 -0400 |
| Message-ID | <1f2h8l3xg19eu$.qdytiuo8qvql$.dlg@40tude.net> |
| In reply to | #9573 |
On Fri, 24 May 2013 13:10:58 +0000 (UTC), Doug Miller wrote: > Tim Streater <timstreater@greenbee.net> wrote in news:timstreater-B96075.12530724052013 > @news.individual.net: > >> Fuckin' Ada, richard, how about *learning* some shit before posting >> dopey questions, eh? How about looking through your code for simple >> errors and, like, *fixing* them before posting here, eh? > > You don't understand who you're dealing with here. This may help: > > https://groups.google.com/forum/?fromgroups#!search/richard$20the$20stoopid > https://groups.google.com/forum/?fromgroups#!search/richard$20the$20sto0pid Bringing up ancient history is not good for YOU. That moniker was given to me by a guy who simply edited an email I had sent him, which he posted. The good boys of AUK took it and made it their signature. It's been politcally correct over the years to harass me for anything I say, even though someone else who says the same damn thing, gets applauded. I will remind you, that it was this very KOOK (RtS), who shot down and identified the very kookmeister who made RtS his personal punching bag. When I found out who he really was, the chicken shit high tailed to parts unknown and would never say another word to me. So I'm stupid huh? Then how come my IQ is routinely tested at 125? Now let's see how smart you are. You have a set of equal squares lined up in a 3x3 pattern. How many boxes do you see? 86% of the people get the answer wrong. Brought to you by the "Lord of the Bull!".
[toc] | [prev] | [next] | [standalone]
| From | Doug Miller <doug_at_milmac_dot_com@example.com> |
|---|---|
| Date | 2013-05-24 21:41 +0000 |
| Message-ID | <XnsA1CAB49125993dougmilmaccom@78.46.70.116> |
| In reply to | #9609 |
richard <noreply@example.com> wrote in news:1f2h8l3xg19eu$.qdytiuo8qvql$.dlg@ 40tude.net: > On Fri, 24 May 2013 13:10:58 +0000 (UTC), Doug Miller wrote: > >> Tim Streater <timstreater@greenbee.net> wrote in news:timstreater- B96075.12530724052013 >> @news.individual.net: >> >>> Fuckin' Ada, richard, how about *learning* some shit before posting >>> dopey questions, eh? How about looking through your code for simple >>> errors and, like, *fixing* them before posting here, eh? >> >> You don't understand who you're dealing with here. This may help: >> >> https://groups.google.com/forum/?fromgroups#!search/richard$20the$20stoopid >> https://groups.google.com/forum/?fromgroups#!search/richard$20the$20sto0pid > > Bringing up ancient history is not good for YOU. > That moniker was given to me by a guy who simply edited an email I had sent > him, which he posted. And with good reason, too. > The good boys of AUK took it and made it their signature. And with good reason, too. > It's been politcally correct over the years to harass me for anything I > say, even though someone else who says the same damn thing, gets applauded. No, Richard, you don't get harassed "for anything [you] say". This is what you get "harassed" for: - asking the same questions, over and over - not listening to the answers... - ... or worse, *arguing* with the answers - criticizing people who are trying to help you - never even considering that the problems you have are the direct result of _your own_ repeated failures to learn from experience > [...] > So I'm stupid huh? > Then how come my IQ is routinely tested at 125? Is that all? Seriously. That's really not especially high. I certainly wouldn't go around bragging about a 125 IQ. > > Now let's see how smart you are. > You have a set of equal squares lined up in a 3x3 pattern. You mean like this? http://math.about.com/od/weeklyproblem/ss/howmanysq.htm > How many boxes do you see? > 86% of the people get the answer wrong. > > Brought to you by the "Lord of the Bull!". Evidently, I'm enough smarter than you to see that your question is ambiguous: does "boxes" mean squares? or rectangles? or *any* enclosed figures?
[toc] | [prev] | [next] | [standalone]
| From | Scott Johnson <noonehome@chalupasworld.com> |
|---|---|
| Date | 2013-05-24 05:38 -0700 |
| Message-ID | <knnmpb$bcj$1@dont-email.me> |
| In reply to | #9559 |
On 5/23/2013 8:23 PM, richard wrote:
>
> $result = mysql_query("SELECT avid FROM A$year WHERE id = $number");
> if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
> $vid = mysql_fetch_row($result);
>
> echo $vid[0];
> $v=$vid[0];
> $v1=substr($v,0,1);
>
>
> $yt="http://www.youtube.com/watch?v=".$vid[0];
>
> if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
> echo "<br />".$yt;
>
Richard.....*lost for words*
*refound*
Brother you really should start keeping notes of these simple errors.
You keep revisiting the errors that people do when they first start
using PHP.
Many in the NG have taken their own time to point these out and give you
good advice, and to not learn or write the solutions down is being very
disrespectful to those peoples times, which is why you probably get many
disparaging comments.
I have a very bad memory myself but I keep a notebook and revisit it
whenever I run into an error to ensure I (or someone else) have not
already solved it previously.
Just a suggestion.
Scotty
[toc] | [prev] | [next] | [standalone]
| From | richard <noreply@example.com> |
|---|---|
| Date | 2013-05-24 15:22 -0400 |
| Message-ID | <1v457my8r62xi$.1sjc4errknv11$.dlg@40tude.net> |
| In reply to | #9572 |
On Fri, 24 May 2013 05:38:44 -0700, Scott Johnson wrote:
> On 5/23/2013 8:23 PM, richard wrote:
>
>>
>> $result = mysql_query("SELECT avid FROM A$year WHERE id = $number");
>> if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
>> $vid = mysql_fetch_row($result);
>>
>> echo $vid[0];
>> $v=$vid[0];
>> $v1=substr($v,0,1);
>>
>>
>> $yt="http://www.youtube.com/watch?v=".$vid[0];
>>
>> if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
>> echo "<br />".$yt;
>>
>
> Richard.....*lost for words*
>
> *refound*
>
> Brother you really should start keeping notes of these simple errors.
> You keep revisiting the errors that people do when they first start
> using PHP.
>
> Many in the NG have taken their own time to point these out and give you
> good advice, and to not learn or write the solutions down is being very
> disrespectful to those peoples times, which is why you probably get many
> disparaging comments.
>
> I have a very bad memory myself but I keep a notebook and revisit it
> whenever I run into an error to ensure I (or someone else) have not
> already solved it previously.
>
> Just a suggestion.
>
> Scotty
FYI, I found that I could use the substr() function to solve my problem
with.
With everything that I had read, there was one very important thing every
one of these writers left out!
That being, the natural mind says the first character is "1" and therefore
the number 1 should be used if you want to start at the begining.
e.g.
substr("123",1,1)
The output is "1" correct?
Wrong!
It is "2".
To output the "1", the correct code is substr("123",0,1).
Why?
I suspect that this is due to the fact the substring is treated as an array
and the array always begins with [0] by default.
[toc] | [prev] | [next] | [standalone]
| From | Scott Johnson <noonehome@chalupasworld.com> |
|---|---|
| Date | 2013-05-24 15:12 -0700 |
| Message-ID | <knoocq$ijt$1@dont-email.me> |
| In reply to | #9610 |
On 5/24/2013 12:22 PM, richard wrote:
> On Fri, 24 May 2013 05:38:44 -0700, Scott Johnson wrote:
>
>> On 5/23/2013 8:23 PM, richard wrote:
>>
>>>
>>> $result = mysql_query("SELECT avid FROM A$year WHERE id = $number");
>>> if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; }
>>> $vid = mysql_fetch_row($result);
>>>
>>> echo $vid[0];
>>> $v=$vid[0];
>>> $v1=substr($v,0,1);
>>>
>>>
>>> $yt="http://www.youtube.com/watch?v=".$vid[0];
>>>
>>> if ($v1="/"){$yt="http://mroldies.net".$vid[0];}
>>> echo "<br />".$yt;
>>>
>>
>> Richard.....*lost for words*
>>
>> *refound*
>>
>> Brother you really should start keeping notes of these simple errors.
>> You keep revisiting the errors that people do when they first start
>> using PHP.
>>
>> Many in the NG have taken their own time to point these out and give you
>> good advice, and to not learn or write the solutions down is being very
>> disrespectful to those peoples times, which is why you probably get many
>> disparaging comments.
>>
>> I have a very bad memory myself but I keep a notebook and revisit it
>> whenever I run into an error to ensure I (or someone else) have not
>> already solved it previously.
>>
>> Just a suggestion.
>>
>> Scotty
>
> FYI, I found that I could use the substr() function to solve my problem
> with.
> With everything that I had read, there was one very important thing every
> one of these writers left out!
> That being, the natural mind says the first character is "1" and therefore
> the number 1 should be used if you want to start at the begining.
> e.g.
> substr("123",1,1)
> The output is "1" correct?
> Wrong!
> It is "2".
> To output the "1", the correct code is substr("123",0,1).
> Why?
> I suspect that this is due to the fact the substring is treated as an array
> and the array always begins with [0] by default.
>
Yes that is the expected return/functionality of substr(), especially if
you read the 'manual' on the function. It specifies that 0 is the base.
Always remember (or write it down). php.net is your friend.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web