-
Posts
830 -
Joined
-
Last visited
Everything posted by gerkintrigg
-
Hi everyone, I've created a website: http://www.neiltrigger.com/truro/index.php and the Ajax works fine on the homepage, but if I were to go into to one of the pages that I use with a mod re-write, it doesn't work. (example here: http://www.neiltrigger.com/truro/pages/reader.php?profile=Unclaimed~Pages&page=tin~gifts) I know the example above is long-form, but it doesn't seem to make a difference. When you click on "Log In", it loads a page called login.php I know what's happening, but not how to solve it... it's loading my error page into the login div tag. You don't need to log in to see the error, so if you can have a look and let me know what you think might be causing it, that'd really help. I'm referencing to $root correctly, I think. Neil
-
perfect, that'll do it. thanks!
-
Hello. A few years ago, I spent ages working on a way to replace multiple substrings within a large body of text. I can't remember what I did, where I stored the code or how to do it, so I was hoping you could help. I want to take a large body of text and replace keywords from within the text with links to a page about that topic in a similar way to wikipedia. Is there an easy way of doing this without manually adding the links? Bear in mind that the database will grow quite a lot and so str_replace is probably going to be innadequate. Thanks. Neil
-
This is driving me bonkers! I want to be able to dynamically change the value of a text field using this function: function popup_blanket(ID2Delete) { document.getElementById("blanket").style.visibility = "visible"; document.getElementById("confirmation_centre_screen").style.visibility = "visible"; //alert('ID: '+ID2Delete); document.forms['DeletePageForm'].elements['Page2Delete'].value=ID2Delete; } Then I will simply call it using this link: <a href="javascript: popup_blanket(<?php echo $rpages['page_id'];?>)"><img src="<?php echo $root;?>furniture/delete.jpg" alt="Delete This Page" width="30" height="30" border="0" title="Delete This Page" /></a> The problem is that the value of the text box is not responding. I have set up a test alert to check that the function is being called correctly (now commented out above) but that worked fine. What am I doing wrong?
-
thorpe, As always, I bow to your superior intellect. It works great. The final script can be seen at http://ghostlypublishing.co.uk/members/admin/mailing_list/admin/ All the best, gerkintrigg
-
Hello. I think I have worked out where my problem lies, but have no clue how to fix it. I'm posting the first name, surname and email to a newsletter signup script I found online. The original script only used the email address, but I wanted to make it a little more dynamic (a bit like aweber in that it can accept [fname] and replace it with the name from the database). Everything works except actually inserting the fname and sname variables into the database. (I was testing it using the SQL back end, originally). I have tracked the issue to a Javascript snippet which originally said this: data: 'email=' + $('#email').val(), // data to post Thinking logically (or not), i changed it to this: data: 'email=' + $('#email').val()+ 'fname=' + $('#fname').val()+ 'sname=' + $('#sname').val(), // data to post This was initially just to prove to myself that the data is there and being passed to the script... it is, but it currently outputs like this: [email protected]=firstnamesname=surname Could someone please let me know what I'm doing wrong. I'm fine with PHP, but to say that I "muddle through" the javascript aspect is probably about right.
-
If I were to do it, I'd use a while loop to output all records that match your criteria and probably skip some of the echo stuff and just have something like this: ?><a href='curso_guitarra.php'><img src="<?php echo $dados['image_curso'];?>"/> <br /> <?php echo $dados['nome_curso'];?></a><?php that way you will be able to see the format of the data in your program (like Dreamweaver) to make sure that any errors you have is in the PHP and not basic HTML formatting (which can be very messy in tables, the way you're doing it). Just a thought and it might help.
-
it should be pretty simple to do. Have a look on W3Schools (Google it... W3 Schools) but to be honest, I may be confusing a simple question... but I'm not sure I really know what the problem is. Is it just a case of the options needing to be in a select command? the neatest way of doing it might be to use an array in the PHP, but it sounds like this might be a HTML issue rather than a PHP one.
-
Bummer. Thanks.
-
I understand the round corner command in CSS and it works when I use it like this: .round_corner_image{ -moz-border-radius: 15px;; border-radius: 15px; margin:2px; } My question is how to make a box like the logo here: http://ghostsinplymouth.co.uk/furniture/small_logo.jpg I want to make a box in CSS which has the same shape as the rusted metal and figured it's probably possible in CSS 3. I've tried negative values but that doesn't work. Any suggestions? Thanks.
-
Hello, I'm trying to work out how to align the text search box with the search button on http://www.sary.co.uk The thing is that it works in rockmelt but Internet Explorer's having issues... so I sort it for IE and rockmelt displays it wrong. I need something that'll work for all browsers. Any ideas? I've currently got these styles applied to the form elements: .go_btn { border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; background-image: url(furniture/go_btn.jpg); background-repeat:no-repeat; border-top-width: 3px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 0px; border-top-color: #F06; border-right-color: #F06; border-bottom-color: #F06; border-left-color: #F06; height:25px; width:38px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: bold; font-variant: normal; text-transform: capitalize; color: #FFF; text-decoration: none; position: relative; left: -2px; } .search_box { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: bold; font-variant: normal; text-transform: none; color: #000; background-image: url(furniture/search.jpg); background-repeat: no-repeat; height: 17px; padding-left: 25px; border-top-width: 3px; border-right-width: 0px; border-bottom-width: 3px; border-left-width: 3px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #F06; border-right-color: #F06; border-bottom-color: #F06; border-left-color: #F06; }
-
Ah! it works. To reply directly to your points: 1) Yes. 2) D'oh! 2) Sorted. Thanks very much. )
-
1) I should have a rewrite engine - I do on other sites on the same server, but this site is very new and I have to admit that I never used it before. 2) The URL I'm trying to match is http://www.sary.co.uk/products/2_Product-2.html to http://www.sary.co.uk/products/reader.php?id=2 3) This should now be a working URL - I know I had a small code error in the destination URL, but that shouldn't have effected the mod re-write rule.
-
I dunno whether I'm being stupid here, but I have this rewrite rule and I have no idea why it's just not doing anything (at all) RewriteRule ^products/([^/\.]+)?$ http://sary.co.uk/products/reader.php?id=$1.php?id=$1 [L] the error pages work fine, so I think HTACCESS support is live.
-
I sorted it... http://www.manteya.com/spin
-
cool, I'll sort that out, then. Thanks.
-
I'm trying to use a function I saw online called mb_strpos() but I keep getting this error Fatal error: Call to undefined function mb_strpos() Is it a code error or is it just not installed? If it's not installed, how'd I sort that out?
-
Thanks, it works with the example but it has issues when I use the string in the example below, but I think this is pretty close: $str='this is a [good,strong,hard,easy] test, although I think that [you, me, we] may find it difficult to [use,work with] it.'; $var_start='['; $arr=explode('[',$str); foreach ($arr as $key => $value) { $split=explode (']',$value); $variables[$key]=$split[0]; #define the variable bank that will be replaced by each variable within the bank: if($key!=0){ $variable_bank[$key]=$split[0]; } } foreach ($variable_bank as $key => $value) { $each_var=explode(',',$value); foreach ($each_var as $key2 => $value2) { echo str_replace('['.$value.']',$value2,$str).'<br />'; } } This outputs this is a good test, although I think that [you, me, we] may find it difficult to [use,work with] it. this is a strong test, although I think that [you, me, we] may find it difficult to [use,work with] it. this is a hard test, although I think that [you, me, we] may find it difficult to [use,work with] it. this is a easy test, although I think that [you, me, we] may find it difficult to [use,work with] it. this is a [good,strong,hard,easy] test, although I think that you may find it difficult to [use,work with] it. this is a [good,strong,hard,easy] test, although I think that me may find it difficult to [use,work with] it. this is a [good,strong,hard,easy] test, although I think that we may find it difficult to [use,work with] it. this is a [good,strong,hard,easy] test, although I think that [you, me, we] may find it difficult to use it. this is a [good,strong,hard,easy] test, although I think that [you, me, we] may find it difficult to work with it. I think that if we combined both approaches, we'd probably solve it.
-
thanks jasonrichardsmith, but I don't seem able to get that to work... I have tried without Preg functions: $str='this is a [good,strong,hard,easy] test, although I think that [you, me, we] may find it difficult to work with it.'; $var_start='['; $arr=explode('[',$str); foreach ($arr as $key => $value) { $split=explode (']',$value); $variables[$key]=$split[0]; #define the variable bank that will be replaced by each variable within the bank: $variable_bank='[good,strong,hard,easy]'; } foreach ($variables as $key => $value) { if($key!=0){ $key--; $var_array[$key] =explode(',',$value); foreach ($var_array[$key] as $key => $value) { echo str_replace($variable_bank,$value,$str).'<br>'; } echo '<br>'; } } It comes close, but doesn't actually output what I need as you can see here: http://manteya.com/test/ It's almost like I need to output the $variable_bank variables as an array together with the $variables to replace the bank with, and then run them all the way through as a for-each type argument. The issue is having more than one variable bank...
-
Hi everyone! I'm trying to get the variables out of a string like this: $string='this is a sentence with a load of [great, clever, textual] variables '; What I want to do is output a list of strings that have used the variables to create unique strings like this: this is a sentence with a load of great variables this is a sentence with a load of clever variables this is a sentence with a load of textual variables I tried exploding the string into arrays, but what I really need to do is explode on '[' then output the words to an array (until I get to the closing ']') and then move on... The eventual string will have potentially loads of variables, but let's do one thing at a time. What's the best way of starting a project like this? Neil
-
Im not sure about the output from the feedURL variable (and I'm on my iPhone now so I can't test it) but if you could use echo "<pre>".file_get_contents($feedURL)."</pre>" That would at least tell you what you're dealing with. You may have nested arrays which you can then deal with easily.
-
Awesome, I'll try that and let you know how it goes.
-
I know that PHP is server-side, but I wondered whether anyone had a similar issue that they got around... here's my problem... I've made a psycho-analysis tool for Facebook where it runs your Facebook friends through a database of words to get their psychological preferences (that all works)... I then have a link so that users can tell their friends about the service (it's free, so I want to get it to spread virally) but I'm having a few issues with the link... At the moment, it all works from a Facebook point of view, but when they click on the link, it takes them to an almost-blank page with a bit of code on it. I know what this code is and why it's there, but I'd like to hide it behind a branded page, ideally with Ajax. When I tried to use Ajax for it, it wouldn't accept the URL that was sent. The link has to have a URL sent to Facebook like this: https://graph.facebook.com/feed?access_token=149324721793321|HarGd6ioqoroENE9gv2758rfeYY&message=I%27ve+just+psycho-analysed+my+Facebook+friends+using+Manteya%27s+Facebook+Friend+Checker+%28http%3A%2F%2Fwww.manteya.com%2Ffacebook-friend-checker%29+so+that+I+can+communicate+better+with+you.&id=100001925276042 but for obvious reasons, you can't post it as an Ajax variable by using the: http://www.url.com/test.php?id=$variable; Is there a way I can get around the problem? I guess the issue is that Facebook needs the detail in the URL, but PHP won't let me send it like this. I have thought about uploading the URL to a database and shortening the URL, then posting that, which would then re-direct, but that's a messy way around I'm sure you smart people have done something like this before. To see my existing (almost) working example, visit http://www.manteya.com/ffc Thanks, Neil
-
Will do. But it looks like I am going to have to buy one. Nevermind.
-
I admire the thought process, but I want the database to double as a stand-alone system on a desktop, so I really need a thesaurus database. I'm fine with multiple tables in a database, but I do need a thesaurus that I can move around and even access without net connectivity (fancy that!)