Jump to content

MarPlo

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by MarPlo

  1. Hi Try this rule in htaccess: RewriteRule ^details/([a-zA-z0-9-]+)_([0-9]+)$ details.php?category=$1&id=$2 [NC,L] The URL will be: http://www.site.com/details/category_1
  2. The problem with @font-face is that the browsers not recognise the same file font format. IE supports Embedded OpenType Font format (.eot). Firefox, Chrome, Safari, and Opera support fonts of type OpenType Face (.otf) and TrueType Format (.ttf). You should add two @font-face, for the same font, with .eot, and .ttf files. The Font Squirrel @font-face Generator ( www.fontsquirrel.com ) takes any uploaded font and converts it into all the formats mentioned earlier as well as offers sample CSS embedding code.
  3. Hi, I know there is an ebook, "PHP Objects Patterns and Practice" with such examples, code and detailed explanations. I don't know how good it is because is to advanced for me.
  4. Hi, I made a similar chat script as an exercise to learn ajax and php. The solution i applied is to display the chat into a DIV, then the Ajax function gets the chat content from php and adds it into that Div, without any refresh. You can see it, and get the code here: Ajax-PHP Chat script.
  5. Hi, Try this; add the following code in the <select> tag: onchange="document.getElementById('query').value=this.value;" This code adds the selected option in the element with id="query".
  6. Hi, It is missing the starting <ul> for the list. Try this code: <div id="container"> <div id="header" style="background: url('/images/test.png') no-repeat; height: 286px;"><ul id="topnav"> <ul style="margin:0; padding:0;"> <li id="topnav-1"><a href="home.php" title="Home">Home</a></li> <li id="topnav-2"><a href="index.php" title="City">City</a></li> <li id="topnav-3"><a href="about-us.html" title="About Us">About Us</a></li> <li id="topnav-4"><a href="contact-us.html" title="Contact Us">Contact Us</a></li> <li id="topnav-5"><a href="contact-us.html" title="Contact Us">Contact Us</a></li> <li id="topnav-6"><a href="contact-us.html" title="Contact Us">Contact Us</a></li> <li id="topnav-7"><a href="contact-us.html" title="Contact Us">Contact Us</a></li> </ul> </div></div>
  7. Hi, Storing the return data into a variable is useful when you want to use again, or manipulate that data in your code. For example, calling a function three times requires more memory than storing the value in a variable and using the variable.
  8. Hi, Like in arithmetic, the paranthesis are used to control, and group the order of operations. For example, like: (2 + 3) * 4 = 20; and 2 + (3 * 4) = 14; In the code above, the result True or False of the first three conditionals is then grouped with && with the result of the 4th conditional.
  9. Hi, Maybe the problem is in the php script, which uses get_magic_quotes_gpc() function, something like: if(get_magic_quotes_gpc()) ... In this case, the get_magic_quotes_gpc() must be deleted from code, and perhaps to rewrite that part of script.
  10. Hi, I think this code is good for what you want: $url = 'http://www.cooltools.org/videos/how-to-style-menu/'; if(preg_match('#(http://){0,1}(www.){0,1}cooltools.org/videos/([^/]+)#i', $url, $mc)) { $video = $mc[3]; echo $video; // how-to-style-menu }
  11. Hi, You can an absolute path for the '.css' file: <link rel="stylesheet" type="text/css" href="http://localhost/myroot/denbix/view/style.css" /> Or, try add a <base> for all relative paths, in the Head zone of the html document generated by 'knuffix_list.php': <base href="http://localhost/myroot/denbix/" />
  12. Hi, If you want to get the substring after 'sobi2Id=' in a dinamic string, try this example: $url = 'http://domain/page.php?sobi2Id=xyz'; if(preg_match('/sobi2Id=(.*)$/i', $url, $tag)) { echo $tag[1]; // xyz } But if the 'sobi2Id=' is part of current url, is better to use $_GET (as mentioned in the response above). if(isset($_GET['sobi2Id'])) echo $_GET['sobi2Id'];
  13. Hi, I think you can open the PhpMyAdmin , and browse the table "donations", then click Insert to add manually a new row.
  14. Hi I think the error is because the column 'id' is between simple quotes, try this: "SELECT COUNT(id) FROM textiles"
  15. Hi, The $_POST['week'] can get only the data added in the "value" attribute of the selected option. You cannot get in php the text between <option>text</option>. A solution could be to use value="id^text" , then, in php separate with explode('^', $_POST['week']) id and text.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.